Update a Fulfillment Return Order

HTTP Request

PUT /v1/returns/{returnOrderId}

Summary

This operation updates an order for a return to a fulfillment center. You must pass the whole return order object again to make the update. You cannot pass a partial object.

Request URLs

Sandbox: https://shipping-api-sandbox.pitneybowes.com/shippingservices/fulfillment/v1/returns/{returnOrderId}
Production: https://shipping-api.pitneybowes.com/shippingservices/fulfillment/v1/returns/{returnOrderId}

Path Parameter

Name

Description

returnOrderId


Required. The fulfillment return order ID assigned by Pitney Bowes.

Request Headers

Name


Description

Authorization

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

X-PB-TransactionId

Required. A unique identifier for the request, up to 25 characters. The following characters are allowed: letters, numbers, hyphens (-), and underscores (_).

Important: Ensure this is a unique ID.

Request / Response Elements

This PUT operation sends and receives the Returns object, described in the table below. Fields required in the request are marked Required. All other fields are optional, except fields marked RESPONSE ONLY, which appear only in the response.

Name

Data Type

Description

clientId

String

Required. The client ID assigned by Pitney Bowes.

brand

String

The manufacturer’s brand name for the item.

Maximum length: 30 characters

orderId

String

The Pitney Bowes ID for the original order.

returnClientOrderId

String

The client ID for the fulfillment return order.

Maximum length: 50 characters

originalClientOrderId

String

The client ID for the original order.

returnOrderId

String

RESPONSE ONLY. The Pitney Bowes ID for the fulfillment return order.

rmaNumber

String

The client’s RMA number for the return. The RMA number (Return Merchandise Authorization number) is used as a tracking number for parcel being returned to the fulfillment center.

Maximum length: 35 characters

references

Array[References Object]

Additional reference information for the order. Each object in the array is a name-value pair that defines a reference field and value.

createDate

String

Reserved for future use.

updateDate

String

Reserved for future use.

pbCreateDate

String

RESPONSE ONLY. The date and time Pitney Bowes receives information about the fulfillment return order, specified in the ISO 8601 format: YYYY-MM-DDThh:mm:ssZ

pbUpdateDate

String

RESPONSE ONLY. The date and time Pitney Bowes receives updated information about the fulfillment return order, specified in the ISO 8601 format: YYYY-MM-DDThh:mm:ssZ

node

String

The Pitney Bowes Fulfillment Center where the return is expected to be processed.

fromAddress

Address Object

The address of the consumer who is sending back the package.

shippingDetails

Shipping Details Object

The carrier details for the fulfillment return order.

returnOrderCurrency

String

The default currency for the item-level costs.

returnOrderLines

Array[Return Order Lines Object]

The items included in the return order. Each item is a different object in the array.

returnReason

Array[String]

The reasons for the return order.

operation

String

Specifies whether to create or update a given return order in a Bulk Return Orders operation. This field applies only to Bulk Return Orders. If this field is not specified for a return order, the system will search for the order and, if it is found, the system will update the order. If the order is not found, the system will create the order. This field takes the following values:

  • CREATE

  • UPDATE

Sample Request

curl -X PUT ".../v1/returns/{returnOrderId}" \
-H "Authorization: Bearer <oauth_token>" \
-H "X-PB-TransactionId: <unique_identifier>" \
-d '
{
    "clientId": "1234",
    "orderId": "ORDAA1267912211CO",
    "returnClientOrderId": "ORCLIENT8976r4w",
    "originalClientOrderId": "ORCLIENT8976r4w",
    "rmaNumber": "RMAzxjj1128811azz",
    "node": "160",
    "fromAddress": {
        "name": "John Smith",
        "company": "ABC",
        "phone": "111-111-1111",
        "email": "john@example.com",
        "addressLines": [
            "2352 Bent Creek Rd"
        ],
        "cityTown": "Auburn",
        "stateProvince": "AL",
        "postalCode": 36830,
        "countryCode": "US"
    },
    "shippingDetails": {
        "carrier": "FedEx",
        "serviceId": "STANDARD",
        "serviceName": "string",
        "trackingNumber": "FX123909771101"
    },
    "returnOrderCurrency": "USD",
    "returnOrderLines": [ {
        "orderLineId": 1,
        "itemDetail": {
            "sku": "PRODUCT-SKU-111",
            "unitPrice": 50,
            "description": "Sport Colorblocked Relaxed Hoodie"
        },
        "lineTotal": 100,
        "returnReason": [
            "WRONG SIZE"
        ],
        "quantity": 2
    } ],
    "returnReason": [
        "reason code"
    ]
}'

Sample Response

{
    "clientId": "1234",
    "orderId": "ORDAA1267912211CO",
    "returnClientOrderId": "ORCLIENT8976r4w",
    "originalClientOrderId": "ORCLIENT8976r4w",
    "returnOrderId": "RO1234A7891178032111US",
    "rmaNumber": "RMAzxjj1128811azz",
    "pbCreateDate": "2022-03-23T20:47:44.747Z",
    "node": "160",
    "fromAddress": {
        "name": "John Smith",
        "company": "ABC",
        "phone": "111-111-1111",
        "email": "john@example.com",
        "addressLines": [
            "2352 Bent Creek Rd"
        ],
        "cityTown": "Auburn",
        "stateProvince": "AL",
        "postalCode": 36830,
        "countryCode": "US"
    },
    "shippingDetails": {
        "carrier": "FedEx",
        "serviceId": "STANDARD",
        "serviceName": "string",
        "trackingNumber": "FX123909771101"
    },
    "returnOrderCurrency": "USD",
    "returnOrderLines": [ {
        "orderLineId": 1,
        "itemDetail": {
            "sku": "PRODUCT-SKU-111",
            "unitPrice": 50,
            "description": "Sport Colorblocked Relaxed Hoodie"
        },
        "lineTotal": 100,
        "returnReason": [
            "WRONG SIZE"
        ],
        "quantity": 2
    } ],
    "returnReason": [
        "reason code"
    ]
}

Error Codes

For lists of error codes returned by the Fulfillment APIs, please see 80-Prefix Error Codes (Fulfillment APIs).