Authorize a Merchant who Signed up via Merchant Portal

HTTP Request

POST /v1/developers/{developerId}/merchants/credentials

Summary

This operation retrieves the credentials for a merchant who signed up for a PB Postage Account via Merchant Portal. The operation applies if you use the Individual Postage Account enrollment model and if your merchants sign up for their postage accounts via a Merchant Portal signup page specific to your developer account.

To use this API, do the following:

  1. Direct merchants to your signup page on Merchant Portal. Your signup page uses following URLs, depending on the environment. Replace {ID} with your developer ID

    Production environment:

    https://www.pbshippingmerchant.pitneybowes.com/home?developerID={ID}

    Sandbox environment:

    https://developer.pbshippingmerchant.pitneybowes.com/home?developerID={ID}

  2. Once a merchant signs up, use this POST operation to retrieve the merchant’s Shipper ID. The Shipper ID lets you print labels and request transactions on the merchant’s behalf.

Important: This POST operation sends the username and password of the merchant’s PB Postage Account. Ensure you use TLS encryption when sending the request.

See also: Merchant Accounts

Request URIs

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

Path Parameter

Name Description
developerId
Required. Your Pitney Bowes developer ID.

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 Elements

Name Data Type Description
username String Required. The username for the merchant’s PB Postage Account.
password String Required. The password for the merchant’s PB Postage Account.

Response Elements

The operation returns a merchant object. The table below describes all possible fields in a merchant object.

Some fields might not apply to your operation.

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:

carrierAccountObject Array[Object] Coming Soon to the Sandbox Environment: This applies if the merchant has registered additional commercial carrier accounts with Pitney Bowes, other than Newgistics or PB Presort. Each object in this array contains information on a specific carrier account.
    carrier String The carrier.
    accountNumber String The merchant’s account number with the carrier.
    X-PB-CarrierShipperAccountID String The unique identifier to use when the merchant performs an operation that uses this carrier account. The identifier is passed in the X-PB-Shipper-Carrier-AccountId request header of the API request.

Sample Request

Important: You must use TLS encryption when passing the merchant credentials using this POST operation. The APIs require TLS. For the required TLS version, see TLS.

curl -X POST .../v1/developers/<developer_id>/merchants/credentials \
-H "Authorization: Bearer <oauth_token>" \
-H "Content-Type: application/json" \
-H "X-PB-UnifiedErrorStructure: true" \
-d '
{
    "username":"John Smith",
    "password":"PAs5W0rD!"
}'

Sample Response

{
    "fullName": "John Smith",
    "email": "johnsmith@example.com",
    "registeredDate": 1444608000000,
    "deactivatedDate": null,
    "paymentAccountNumber": "1234567",
    "enterpriseAccount": "2345678",
    "subscriptionAccount": "3456789",
    "postalReportingNumber": "55555555",
    "merchantStatus": "ACTIVE",
    "merchantStatusReason": null,
    "parcelProtection": false,
    "paymentMethod": "LineOfCredit/Prepaid"
}

Error Codes

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