Deactivate a Merchant

HTTP Request

POST /v2/developers/{developerId}/accounts/{postalReportingNumber}/deactivate

Summary

This operation disables an active merchant and starts the process of refunding the merchant’s postage balance. Once deactivated, a merchant can no longer print labels. Refunds to the merchant’s postage account are processed within 30 days. The account remains open for 90 days for any Scan-Based Return labels that get scanned and for any adjustments made through the USPS APV program.

Things to Consider

  1. You must issue this call using the same developer ID that was used to create the merchant’s account.
  2. The merchant’s account must be in the ACTIVE state, as defined by the merchantStatus field in the merchant object.
  3. The merchant is uniquely identified by the postalReportingNumber field. Do not use a different field.

Request URIs

Sandbox: https://api-sandbox.pitneybowes.com/shippingservices/v2/developers/{developerId}/accounts/{postalReportingNumber}/deactivate
Production: https://api.pitneybowes.com/shippingservices/v2/developers/{developerId}/accounts/{postalReportingNumber}/deactivate

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.
Accept-Language String Language and country code. Default: en-US

Request Elements

Name Data Type Description
reason String Required. The reason for the account closure.

Response Elements

IMPORTANT: Some fields might not apply to your operation. This table describes all the possible fields in a merchant object.

Name Data Type Description
fullName String The merchant’s full name.
email String The merchant’s email address.
registeredDate Number The date the merchant’s account was created, shown as milliseconds since the Unix Epoch. You can convert the date to human-readable form by rounding from milliseconds to seconds and then using the Unix timestamp conversion algorithm, or by using a web site that converts milliseconds since the Epoch, such as https://currentmillis.com.
deactivatedDate Number

The date the merchant’s account was deactivated, if applicable, shown as milliseconds since the Unix Epoch. A deactivated merchant can no longer print labels. For an active merchant, the field is set to null.

To convert the value to human-readable form, round from milliseconds to seconds and then apply the Unix timestamp conversion algorithm. Alternatively, use a web site that converts milliseconds since the Epoch, such as https://currentmillis.com.

paymentAccountNumber String The Pitney Bowes customer account number assigned to the merchant.
enterpriseAccount String An enterprise account number that is associated with the merchant.
subscriptionAccount String Any subscription account that the merchant might have.
postalReportingNumber String

The unique ID used to identify the merchant.

Note: This value is also the merchant’s Shipper ID. You must specify Shipper ID when creating a shipment.

merchantStatus String

The merchant’s status. Possible values are:

  • ACTIVE
  • INACTIVE
merchantStatusReason String If you change a merchant’s status from ACTIVE to INACTIVE, you must give a reason for the change. The reason is recorded here. For an active merchant, the field is set to null.
parcelProtection String If true, the merchant can choose to insure a parcel with PB Parcel Protection when creating a shipment.
paymentMethod String

This is returned only for the Authorize Merchant API call. This field indicates the payment method for the merchant’s PB Postage Account. Possible values are:

Sample Request

curl -X POST .../v2/developers/<developer_id>/accounts/<postal_reporting_number>/deactivate \
–H "Authorization: Bearer <oauth_token>" \
-H "Content-Type: application/json" \
-H "Accept-Language: en-US" \
-d '
{
    "reason": "cost"
}'

Sample Response

The operation returns a merchant object.

{
    "fullName": "John Doe",
    "email": "johndoe@example.com",
    "registeredDate": 1480982400000,
    "deactivatedDate": 1490128851018,
    "paymentAccountNumber": "1234567",
    "enterpriseAccount": "2345678",
    "subscriptionAccount": "3456789",
    "postalReportingNumber": "55555555",
    "merchantStatus": "INACTIVE",
    "merchantStatusReason": "cost",
    "parcelProtection": false
}

Error Codes

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