Shipment transactions happen when the status of the shipment changes. For example, when a shipment goes from label_created to shipped, a transaction occurs.

​Use the Order Shipment Transactions API to retrieve the shipment transactions for an order.

Fields

The following table shows all fields that exist for this API and those that are returned when you retrieve a list. All fields are returned when you retrieve a single item.

Name Description Type List
user_id The unique ID of the authenticated user string X
site_id ID of a Weebly site, unique to the currently authenticated user​ string X
order_id The unique order ID (within the store) of the order. string X
order_shipment_id The unique ID (within the order) of the shipent. integer X
order_shipment_transaction_id An incrementing ID unique to this shipment. integer X
tx_id ID for this transaction string
tx_type Shipping method (as defined by the merchant) used for this transaction, for example UPS. string
tx_date Date the transaction was created. ​Unix timestamp in GMT
tx_status Status for this transaction.
Valid values are:
  • label_created
  • label_returned
  • shipped
string
created_date Date the transaction was created. Unix GMT Timestamp
updated_date Date the transaction was last updated. Unix GMT Timestamp

GET
Retrieve a List of Shipment Transactions

GET /v1/user/sites/{SITE_ID}/store/orders/{ORDER_ID}/shipments/{ORDER_SHIPMENT_ID}/transactions

Returns all transactions for the given shipment. Only list fields are returned.


scope: read:store-orders

Example CURL request returning all shipment transactions:

curl --request GET \
--url https://api.weebly.com/v1/user/sites/987654321/store/orders/456789/shipments/1/transactions \
--header 'accept: application/vnd.weebly.v1+json' \
--header 'content-type: application/json' \
--header 'x-weebly-access-token: [YOUR_TOKEN]"

Example response:

[
    {
        "user_id": "123456",
        "site_id": "987654321",
        "order_id": "456789",
        "order_shipment_id": 1,
        "order_shipment_transaction_id": 1
    },
    {
        "user_id": "123456",
        "site_id": "987654321",
        "order_id": "456789",
        "order_shipment_id": 1,
        "order_shipment_transaction_id": 2
    },
    {
        "user_id": "123456",
        "site_id": "987654321",
        "order_id": "456789",
        "order_shipment_id": 1,
        "order_shipment_transaction_id": 3
    },
    {
        "user_id": "123456",
        "site_id": "987654321",
        "order_id": "456789",
        "order_shipment_id": 1,
        "order_shipment_transaction_id": 4
    }
]

GET
Retrieve the Number of Transactions for a Shipment

GET /v1/user/sites/{SITE_ID}/store/orders/{ORDER_ID}/shipments/{ORDER_SHIPMENT_ID}/transactions/count

Returns the number of transactions for a shipment.


scope: read:store-orders

Example CURL request:

curl --request GET \
--url https://api.weebly.com/v1/user/sites/987654321/store/orders/456789/shipments/1/transactions/count \
--header 'accept: application/vnd.weebly.v1+json' \
--header 'content-type: application/json' \
--header 'x-weebly-access-token: [YOUR_TOKEN]"

Example response:

{
    "count": 4
}

GET
Retrieve Details for a Shipment Transaction

GET /v1/user/sites/{SITE_ID}/store/orders/{ORDER_ID}/shipments/{ORDER_SHIPMENTS_ID}/transactions/{ORDER_SHIPMENT_TRANSACTION_ID}

Returns all fields for the given shipment transaction.


scope: read:store-orders

Example CURL request:

curl --request GET \
--url https://api.weebly.com/v1/user/sites/987654321/store/orders/45678/shipments/1/transactions/2 \
--header 'accept: application/vnd.weebly.v1+json' \
--header 'content-type: application/json' \
--header 'x-weebly-access-token: [YOUR_TOKEN]"

Example response:

See Fields table. All fields for the shipment transaction are returned.

{
    "user_id": "123456",
    "site_id": "987654321",
    "order_id": "45678",
    "order_shipment_id": "1",
    "order_shipment_transaction_id": "2",
    "tx_id": "123331",
    "tx_type": "USPS",
    "tx_date": 1443548303,
    "tx_status": "label_returned",
    "created_date": 1443548303,
    "updated_date": 1443548303
}

Help make these docs better!









Tags: