Update Auto Refill Settings

HTTP Request

POST /v1/developers/{developerId}/merchants/{postalReportingNumber}/autorefillrule

Summary

This operation updates the auto refill settings on a merchant’s PB Postage Account. To retrieve the current settings, see Get Auto Refill Settings. For more information on auto refill, see When does auto refill trigger?

Request URLs

Sandbox: https://shipping-api-sandbox.pitneybowes.com/shippingservices/v1/developers/{developerId}/merchants/{postalReportingNumber}/autorefillrule
Production: https://shipping-api.pitneybowes.com/shippingservices/v1/developers/{developerId}/merchants/{postalReportingNumber}/autorefillrule

Path Parameters

Name

Description

developerId


Required. Your Pitney Bowes developer ID. To retrieve your developer ID, log into Developer Hub and click your username and select Profile.

postalReportingNumber

Required. The unique ID used to identify the merchant. To retrieve the merchant’s postalReportingNumber, invoke the Get Merchants API.

Request Headers

Name


Description

Authorization

Required. OAuth token generated using the Generate an OAuth Token API.

Content-Type

Required. The media type of the request entity. Set this to application/json.

X-PB-UnifiedErrorStructure

Recommended. Set this to true to use the standard error object if an error occurs.

Request / Response Elements

Name

Data Type

Description

merchantID

String

Required. The value of this field depends on whether the object is part of the request or the response:

  • Request: This field is set to the postalReportingNumber for the merchant, retrievable through the Get Merchants API.

  • Response: This field is set to the paymentAccountNumber for the merchant, retrievable through the Get Merchants API.

Note: The merchant’s postalReportingNumber is separate from the merchant’s paymentAccountNumber.

threshold

Number

Defines the amount at which the merchant’s PB Postage Account is refilled. The account refills when the balance falls below this value. For more information, see When does auto refill trigger?

Required if you are doing any of the following:

  • Enabling automatic refill

  • Updating the threshold

  • Updating the refill amount

Important: If you do not include this field, the value is null, which disables automatic refill for the account.

addAmount

Number

Defines the amount added to the merchant’s PB Postage Account when the balance falls below the threshold value. For more information, see When does auto refill trigger?

Required if you are doing any of the following:

  • Enabling automatic refill

  • Updating the threshold

  • Updating the refill amount

Important: If you do not include this field, the value is null, which disables automatic refill for the account.

enabled

Boolean

If set to true, automatic refill is enabled. The default value is false.

Note: If you do not include this field, the value is set to false.

Sample Request

curl -X POST ".../v1/developers/12345678/merchants/9024324564/autorefillrule" \
-H "Authorization: Bearer <oauth_token>" \
-H "Content-Type: application/json" \
-H "X-PB-UnifiedErrorStructure: true" \
-d '
{
    "merchantId": "9024324564",
    "threshold": 200,
    "addAmount": 500,
    "enabled": true
}'

Sample Response

{
    "merchantId": "12345678",
    "threshold": 200,
    "addAmount": 500,
    "enabled": true
}

Error Codes

For a list of all error codes returned by the Ecommerce APIs, please see Error Codes.