Cancel a Bulk Order

HTTP Request

PUT /v1/orders/bulk/cancel

Summary

This operation cancels multiple orders at once. For each, the operation cancels the entire order. This operation does not modify an order.

Important

This operation cancels complete orders.

Request URLs

Sandbox: https://shipping-api-sandbox.pitneybowes.com/shippingservices/fulfillment/v1/orders/bulk/cancel
Production: https://shipping-api.pitneybowes.com/shippingservices/fulfillment/v1/orders/bulk/cancel

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 Elements

This PUT operation sends the CancelOrdersRequest array.

Name

Data Type

Description

CancelOrdersRequest

Array[Orders Object]

Required. The orders to cancel. Each object in the array is a separate order.

Orders Object

The CancelOrdersRequest array contains the Orders object, described in the table below. The table describes the Orders object for all operations that use it. Fields required in the request are marked Required. All other fields are optional, except fields marked RESPONSE ONLY, which do not apply to this operation.

Name

Data Type

Description

clientId

String

Required. The client ID assigned by Pitney Bowes.

orderId

String

RESPONSE ONLY. The order ID assigned by Pitney Bowes.

clientOrderId

String

Required. The order ID assigned by the client.

Maximum length: 50 characters

customerOrderId

String

The customer-specific order number. Typically this is the order number from the website or ERP system.

Maximum length: 50 characters

brand

String

The manufacturer’s brand name for the item.

Maximum length: 50 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.

salesChannel

Object

Reserved for future use.

inputShippingDetails

Input Shipping Details Object

Required. The requested shipping-service details for the order.

actualShippingDetails

Actual Shipping Details Object

RESPONSE ONLY. The actual shipping-service details set during processing of the order.

orderType

String

The type of order. Possible values:

  • eCom (default)

  • Retail

createDate

String

Required. The date and time the order was created in the client system, specified in the ISO 8601 format: YYYY-MM-DDThh:mm:ssZ

updateDate

String

The date and time the order was updated in the client system, specified in the ISO 8601 format: YYYY-MM-DDThh:mm:ssZ

pbCreateDate

String

RESPONSE ONLY. The date and time the order was created in the Pitney Bowes system, returned in the ISO 8601 format: YYYY-MM-DDThh:mm:ssZ

pbUpdateDate

String

RESPONSE ONLY. The date and time the order was updated in the Pitney Bowes system, returned in the ISO 8601 format: YYYY-MM-DDThh:mm:ssZ

fromNode

String

The warehouse facility ID.

shipOnDate

String

The date and time by which the order is promised to be shipped, specified in the ISO 8601 format: YYYY-MM-DDThh:mm:ssZ

fulfillmentReleaseDate

String

The date and time the order is to be released for fulfillment, specified in the ISO 8601 format: YYYY-MM-DDThh:mm:ssZ

promisedDeliveryDate

String

The date and time the order is promised to be delivered, specified in the ISO 8601 format: YYYY-MM-DDThh:mm:ssZ

orderHandling

String

Possible value:

  • X: Normal (default)

  • R: Rush order (Reserved for future use)

  • E: Emergency order (Reserved for future use)

orderLines

Array[Order Lines Object]

Required. The items included in the order.

orderCharges

Order Charges Object

Cost details.

toAddress

Address Object

Required. The order’s destination address.

billingAddress

Address Object

The order’s billing address.

isGift

Boolean

If true, the order is a gift.

giftMessageText

String

The gift message to be printed on the pack slip and included in the shipment.

Maximum length: 1,024 characters

valueAddedServices

Array[Object]

Reserved for future use.

paymentDetails

Array[Object]

Reserved for future use.

customsInfo

Object

Customs information for an international order.

customsInfo.customsDeclaredValue

Number

The value that is declared in customs.

customsInfo.importerCustomsReference

String

A reference number used by the importer, such as a VAT number, PO number, or insured number.

Maximum length: 100 characters

customsInfo.importerCustomsReferenceType

String

The type of reference number.

Maximum length: 50 characters

status

String

RESPONSE ONLY. Status of the order. Possible values are:

  • BACKORDER

  • CANCELED

  • HOLD

  • INPROGRESS

  • ONHOLD

  • RECEIVED

  • RETURNED

  • SHIPPED

isOnHold

Boolean

RESPONSE ONLY. If true, the order is on hold.

holdReason

Array[String]

RESPONSE ONLY. Reason codes for the hold.

internalNotes

String

Any notes associated with the order for internal reference.

Maximum length: 255 characters

Sample Request

curl -X PUT ".../v1/orders/bulk/cancel" \
-H "Authorization: Bearer <oauth_token>" \
-H "X-PB-TransactionId: <unique_identifier>" \
-d '
{
    "CancelOrdersRequest": [ {
        "clientId": "1234",
        "orderId": "8901234567890",
        "clientOrderId": "ORCLIENT8976"
        },
        ...
        ]
}'

Sample Response

{
    "clientId": "1234",
    "orderId": "8901234567890",
    "clientOrderId": "ORCLIENT8976",
    "customerOrderId": "0987654321",
    "inputShippingDetails": {
        "carrier": "PITNEY BOWES",
        "serviceId": "NGSPS",
        "serviceName": "Newgistics Parcel Select",
        "trackingNumber": "95605332216"
    },
    "actualShippingDetails": {
        "carrier": "NGS",
        "serviceId": "NGSPS",
        "serviceName": "Newgistics Parcel Select"
    },
    "orderType": "eCom",
    "createDate": "<date>",
    "updateDate": "<date>",
    "pbCreateDate": "<date>",
    "pbUpdateDate": "<date>",
    "fromNode": "<String>",
    "shipOnDate": "<date>",
    "fulfillmentReleaseDate": "<date>",
    "promisedDeliveryDate": "<date>",
    "orderHandling": "X",
    "orderLines": [ {
        "lineId": 0,
        "sku": "<String>",
        "originCountryCode": "<String>",
        "originStateProvince": "<String>",
        "unitPrice": 0,
        "hSTariffCode": "<String>",
        "hSTariffCodeCountry": "<String>",
        "orderedQuantity": 0,
        "lineTotal": 0,
        "inventoryType": "<String>"
    } ],
    "orderCharges": {
        "orderCurrency": "<String>",
        "shippingAmount": 0,
        "totalItemAmount": 0,
        "totalDutyAmount": 0,
        "dutyDetails": [ {
            "name": "<String>",
            "fee": 0,
            "currency": "<String>",
            "percentage": 0
        } ],
        "totalTaxAmount": 0,
        "taxDetails": [ {
            "name": "<String>",
            "fee": 0,
            "currency": "<String>",
            "percentage": 0
        } ],
        "totalDiscountAmount": 0,
        "discountDetails": [ {
            "name": "<String>",
            "fee": 0,
            "currency": "<String>",
            "percentage": 0
        } ],
        "otherChargeDetails": [ {
            "name": "<String>",
            "fee": 0,
            "currency": "<String>",
            "percentage": 0
        } ],
        "totalOrderAmount": 0
    },
    "toAddress": { ... },
    "billingAddress": { ... },
    "isGift": true,
    "giftMessageText": "<String>",
    "customsInfo": {
        "customsDeclaredValue": 0,
        "importerCustomsReference": "<String>",
        "importerCustomsReferenceType": "<String>"
    },
    "status": "<String>",
    "isOnHold": true,
    "holdReason": [
        "<String>"
    ],
    "internalNotes": "<String>"
}

Error Codes

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