UNPKG

@sp-api-sdk/merchant-fulfillment-api-v0

Version:

With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services.

46 lines (45 loc) 1.38 kB
import { createAxiosInstance } from '@sp-api-sdk/common'; import { Configuration, MerchantFulfillmentApi } from './api-model'; export const clientRateLimits = [ { method: 'post', // eslint-disable-next-line prefer-regex-literals urlRegex: new RegExp('^/mfn/v0/eligibleShippingServices$'), rate: 6, burst: 12, }, { method: 'get', // eslint-disable-next-line prefer-regex-literals urlRegex: new RegExp('^/mfn/v0/shipments/[^/]*$'), rate: 1, burst: 1, }, { method: 'delete', // eslint-disable-next-line prefer-regex-literals urlRegex: new RegExp('^/mfn/v0/shipments/[^/]*$'), rate: 1, burst: 1, }, { method: 'post', // eslint-disable-next-line prefer-regex-literals urlRegex: new RegExp('^/mfn/v0/shipments$'), rate: 2, burst: 2, }, { method: 'post', // eslint-disable-next-line prefer-regex-literals urlRegex: new RegExp('^/mfn/v0/additionalSellerInputs$'), rate: 1, burst: 1, }, ]; export class MerchantFulfillmentApiClient extends MerchantFulfillmentApi { constructor(configuration) { const { axios, endpoint } = createAxiosInstance(configuration, clientRateLimits); super(new Configuration(), endpoint, axios); } }