Get Account Balances¶
HTTP Request¶
GET /v1/developers/{developerId}/merchants/{postalReportingNumber}/account-balance
Summary¶
This operation retrieves the current balances for the PB Postage Account and, if present, the PB Line of Credit. The operation retrieves the balances at the time the API call was made and does not reflect transactions still in progress.
The PB Postage Account is the account from which the merchant pays for postage. A PB Line of Credit is an account that a merchant can use to fund a PB Postage Account. Note that amerchant might instead fund the PB Postage Account using a non-Pitney Bowes payment method, such as a credit card. In that case, the API returns only the merchant’s PB Postage Account.
Request URLs¶
Sandbox: https://shipping-api-sandbox.pitneybowes.com/shippingservices/v1/developers/{developerId}/merchants/{postalReportingNumber}/account-balance
Production: https://shipping-api.pitneybowes.com/shippingservices/v1/developers/{developerId}/merchants/{postalReportingNumber}/account-balance
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 |
Request Header¶
Name |
Description |
---|---|
Authorization |
Required. OAuth token generated using the Generate an OAuth Token API. |
X-PB-UnifiedErrorStructure |
Recommended. Set this to |
Response Elements¶
Name |
Data Type |
Description |
---|---|---|
accounts |
Array[Accounts Object] |
An array that contains a different object for each of the merchant’s Pitney Bowes accounts. If the merchant has only a PB Postage Account, the array contains just one object. |
Accounts Object¶
The accounts
array returns the accounts object.
Name |
Data Type |
Description |
---|---|---|
accountType |
String |
The type of account. Possible values are:
|
accountNumber |
String |
The account number. |
currencyCode |
String |
The ISO currency code. Currently supported currency code: |
availableBalance |
Number |
The balance on the PB Postage Account. |
balanceOwed |
Number |
PB Line of Credit only. The amount of used credit and therefore the total amount owed. |
availableCredit |
Number |
PB Line of Credit only. The amount of unused credit. |
creditLimit |
Number |
PB Line of Credit only. The maximum credit allowed. |
minimumAmountDue |
Number |
PB Line of Credit only. The minimum amount that must be paid by the due date. |
minimumDueDate |
String |
PB Line of Credit only. The date on which the minimum amount must be paid. |
Sample Request¶
curl -X GET ".../v1/developers/<developer_id>/merchants/<postal_reporting_number>/account-balance" \
-H "Authorization: Bearer <oauth_token>" \
-H "X-PB-UnifiedErrorStructure: true"
Sample Response for a Merchant with a Postage Account Only¶
{
"accounts": [ {
"accountType": "Postage Account",
"accountNumber": "****6051",
"currencyCode": "USD",
"availableBalance": 457.22
} ]
}
Sample Response for a Merchant with a PB Line of Credit¶
{
"accounts": [ {
"accountType": "Postage Account",
"accountNumber": "****6062",
"currencyCode": "USD",
"availableBalance": 71.89
},{
"accountType": "PB Line of Credit",
"accountNumber": "************8952",
"currencyCode": "USD",
"balanceOwed": 0,
"availableCredit": 500,
"creditLimit": 5000,
"minimumAmountDue": 45,
"minimumDueDate": "2020-12-01"
} ]
}
Error Codes¶
For a list of all error codes returned by the Ecommerce APIs, please see Error Codes.