Order shipments hold information about how the the order was shipped, including shipping address, weight, box size, shipping provider, and status. Orders can have more than one shipment. ​ Use the Order Shipment API to retrieve information about the shipment 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 shipment ID (within the order) for this shipment. integer X
shipping_provider Company used for this shipment. string
weight Weight of the box integer
weight_unit The weight unit used for this order (kg or lb).
Valid values are:
  • lb
  • kg
If not set, defaults to the store's weight unit.
string
height Height of the box. integer
width Width of the box integer
depth Depth of the box. integer
full_name Full name of the addressee. string
email Email of the addressee. string
phone Phone number of the addressee. string
business_name Business name of the addressee, if used. string
street Shipping street address entered by customer. string
street2 Second line of shipping street address, if used. string
city Shipping city entered by customer. string
region Shipping state or region entered by customer. string
country Shipping country entered by customer. string
postal_code Shipping postal code entered by customer string
shipment_tax_total Total amount of tax charged against the shipping amount. integer
shipment_tax_rates Rate of tax charged against the shipping amount. integer
price ​Amount charged for shipping decimal
shipment_total Amount charged for shipping including any tax integer
charges_taxes_on_shipping Whether or not this store charges tax on shipping.
Valid values are:
  • true
  • false
boolean
title Shipping method used for this box, for example "UPS" or "DHL" string
shipment_date Date this box was shipped. Returns null if status is not shipped. ​Unix timestamp in GMT
tracking_number Shipping provider's tracking number integer
status Status for this shipment.
Valid values are:
  • label_created
  • label_returned
  • shipped
string
transactions An array of Shipment Transaction objects. array
created_date Date the shipment was created. Unix GMT Timestamp
updated_date Date the shipment was last updated. Unix GMT Timestamp

GET
Retrieve a List of Shipments for an Order

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

Returns all shipments for the given order. Only list fields are returned.


scope: read:store-orders

Example CURL request returning shipments:

curl --request GET \
--url https://api.weebly.com/v1/user/sites/987654321/store/orders/456789/shipments \
--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
    },
    {
        "user_id": "123456",
        "site_id": "987654321",
        "order_id": "456789",
        "order_shipment_id": 2
    }
]

GET
Retrieve the Number of Shipments for an Order

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

Returns the number of shipments for an order.


scope: read:store-orders

Example CURL request:

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

Example response:

{
    "count": 2
}

GET
Retrieve Details for an Order's Shipment

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

Returns all fields for the given 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 \
--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 are returned.

{
    "user_id": "123456",
    "site_id": "987654321",
    "order_id": "456789",
    "order_shipment_id": "1",
    "shipping_provider": "UPS",
    "weight": 2,
    "weight_unit": "lb",
    "height": 3,
    "width": 4,
    "depth": 5,
    "full_name": "John Doe",
    "email": "johndoe@email.com",
    "phone": "555-555-5555",
    "business_name": null,
    "street": "460 Bryant St",
    "street2": null,
    "city": "San Francisco",
    "region": "CA",
    "country": "US",
    "postal_code": "94107",
    "shipment_tax_total": 0,
    "shipment_tax_rates": null,
    "price": 3,
    "shipment_total": 3,
    "charge_taxes_on_shipping": false,
    "title": "UPS",
    "shipment_date": 1442891179,
    "tracking_number": 123331,
    "status": "shipped",
    "created_date": 1443305683,
    "updated_date": 1443547605,
    "transactions": [
        {
            "order_id": "456789",
            "order_shipment_id": 1,
            "order_shipment_transaction_id": 1,
            "tx_id": "123331",
            "tx_type": "UPS",
            "tx_date": 1443547605,
            "tx_status": "shipped",
            "user_id": "123456",
            "site_id": "987654321",
            "created_date": 1443547605,
            "updated_date": 1443547605
        },
        {
            "order_id": "456789",
            "order_shipment_id": 1,
            "order_shipment_transaction_id": 2,
            "tx_id": "123331",
            "tx_type": "UPS",
            "tx_date": 1443548303,
            "tx_status": "shipped",
            "user_id": "123456",
            "site_id": "987654321",
            "created_date": 1443548303,
            "updated_date": 1443548303
        }
    ]
}

Help make these docs better!









Tags: