Update 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 Refill Settings. For more information on auto refill, see When does auto refill trigger?

Request URIs

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

Path Parameters

Name Data Type Description
developerId String Required. Your Pitney Bowes developer ID. To retrieve your developer ID, log into Developer Hub and click your username and select Profile.
postalReportingNumber String Required. The unique ID used to identify the merchant. To retrieve the merchant’s postalReportingNumber, issue the Get All Merchants API call.

Request Headers

Name Data Type Description
Authorization String Required. OAuth token generated using the Generate an OAuth Token API.
Content-Type String Required. The media type of the request entity. Set this to application/json.

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, as found in the merchant object.
  • Response: This field is set to the paymentAccountNumber for the merchant, as found in the merchant object.

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

threshold Number

The amount at which the merchant’s PB Postage Account is refilled. The account refills when the balance falls below this value.

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 set to null, which effectively disables automatic refill for the account.

For more information, see When does auto refill trigger?.

addAmount Number

The amount added to the merchant’s PB Postage Account when the balance falls below the threshold value.

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 set to null, which effectively disables automatic refill for the account.

For more information, see When does auto refill trigger?.

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/<developer_id>/merchants/<postal_reporting_number>/autorefillrule \
–H "Authorization: Bearer <oauth_token>" \
-H "Content-Type: application/json" \
-d '
{
    "merchantId": "9024998978",
    "threshold": 200,
    "addAmount": 500,
    "enabled": true
}'

Sample Response

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

Error Codes

For a list of all PB Shipping APIs error codes, see Error Codes.