UNPKG

shopify-admin-api

Version:

Shopify Admin API is a NodeJS library built to help developers easily authenticate and make calls against the Shopify API. It was inspired by and borrows heavily from ShopifySharp.

36 lines (35 loc) 1.3 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ApplicationCredits = void 0; const infrastructure_1 = require("../infrastructure"); /** * A service for offering credits for payments made via the Application Charge, Recurring Application Charge, and Usage Charge APIs. */ class ApplicationCredits extends infrastructure_1.BaseService { constructor(shopDomain, accessToken) { super(shopDomain, accessToken, "application_credits"); } /** * Creates a new Application Credit. */ create(credit) { return this.createRequest("POST", ".json", "application_credit", { application_credit: credit }); } /** * Gets an application credit with the given id. * @param id The id of the credit to get. * @param options Options for filtering the result. */ get(id, options) { return this.createRequest("GET", `${id}.json`, "application_credit", options); } /** * Retrieves a list of all past and present application credits. * @param options Options for filtering the result. */ list(options) { return this.createRequest("GET", ".json", "application_credits", options); } } exports.ApplicationCredits = ApplicationCredits; exports.default = ApplicationCredits;