Skip to main content

Order

The Order API lets storefront JavaScript read and act on orders. Every endpoint that takes an order id needs a signed-in customer and works only on that customer's own orders. POST /{locale}/api/order_verify is the exception: it trades an order number and the email address on the order for the address of the order page, and an anonymous visitor can call it.

The examples below send an X-CSRF-Token header. See Authentication for how to read the token from the cookie.

All Ajax API requests should use locale-aware URLs to give visitors a consistent experience.

List a customer's orders

GET /{locale}/api/orders.json

List the orders of the signed-in customer.

Example request

fetch(window.SHOPLAZZA.routes.root + '/api/orders.json?page=1&per_page=10')
.then((response) => response.json())
.then((data) => {
// do something...
});

Request parameters

    pagenumber

    The page of orders to return.

    per_pagenumber

    The number of orders per page.

Response

  • order_list object
    countstring

    Total number of orders.

    orders object[]

    List of orders.

  • Array [
  • idstring

    ID of the order.

    numberstring

    Order number.

    payment_methodstring

    Payment method used for the order, for example credit_card.

    financial_statusstring

    Payment status of the order, for example waiting, paid.

    fulfillment_statusstring

    Fulfillment status, for example waiting, shipped, finished.

    statusstring

    Status of the order, for example opened, placed, finished.

    currency_codestring

    Currency code of the order, for example USD.

    fail_codestring
    shipping_address object

    Shipping address of the order.

    addressstring

    Street address of the recipient.

    address1string

    Primary street address.

    areastring

    Area or district of the address.

    citystring

    City of the address.

    companystring

    Company name of the address.

    countrystring

    Country name of the address.

    country_codestring

    ISO country code of the address.

    emailstring

    Email address associated with the address.

    extra_info object
    object
    first_namestring

    First name of the customer or recipient.

    idstring

    ID of the address.

    last_namestring

    Last name of the customer or recipient.

    origin_idstring
    phonestring

    Phone number associated with the address.

    phone_area_codestring

    Area code of the phone number.

    provincestring

    Province or state of the address.

    province_codestring

    Province or state code.

    zipstring

    Postal or ZIP code.

    post_sale_statusstring

    After-sales status of the order.

    create_atstring

    Time when the order was created.

    customer_emailstring

    Email address of the order's customer.

    customer_phonestring

    Phone number of the order's customer.

    customer_namestring

    Full name of the order's customer.

    customer_idstring

    ID of the order's customer.

    totalstring

    Total price the customer pays, including tax, shipping and discounts.

    fulfillment_countnumber

    Number of shipments created for the order.

    create_timestring

    Time when the order was created; same as create_at.

    allowed_actions object

    Which actions the customer can perform on this order.

    delete_orderboolean

    Whether the order can be deleted.

    cancel_orderboolean

    Whether the order can be cancelled.

    repay_orderboolean

    Whether the order can be paid again.

    pay_orderboolean

    Whether the order can be paid.

    add_to_cartboolean

    Whether the items of the order can be added to the cart again.

    download_invoiceboolean

    Whether an invoice can be downloaded for the order.

    finish_fulfillmentboolean

    Whether the customer can confirm receipt of the order.

    gift_card_totalstring

    Total gift card amount applied to the order.

    paid_totalstring

    Total amount already paid for the order.

    payment_duestring

    Amount of the order that is still unpaid.

    payment_progressnumber

    Payment progress of the order; 3 means the order is fully paid.

    real_paid_totalstring

    Amount actually paid for the order.

    line_items object[]

    List of line items.

  • Array [
  • compare_at_pricestring

    Compare-at price of the item.

    fulfillment_statusstring

    Fulfillment status, for example waiting, shipped, finished.

    idstring

    ID of the line item.

    image object

    Image of the line item's variant.

    altstring

    Alt text of the image.

    heightnumber

    Height of the image, in pixels.

    pathstring

    Path of the image file on the image server.

    srcstring

    URL of the image.

    widthnumber

    Width of the image, in pixels.

    notestring

    Note attached to the line item.

    options object[]

    Option values of the line item's variant.

  • Array [
  • namestring

    Name of the product option, for example Color.

    valuestring

    Value selected for this product option.

  • ]
  • pricestring

    Price of a single unit of the line item.

    product_handlestring

    Handle of the product.

    product_idstring

    ID of the product.

    product_titlestring

    Title of the product.

    product_urlstring

    Relative URL of the product page.

    propertiesstring

    Custom properties captured on the line item.

    quantitynumber

    Quantity of the item.

    requires_shippingboolean

    Whether shipping is required.

    skustring

    SKU of the variant, used for inventory tracking.

    taxableboolean

    Whether tax is charged.

    totalstring

    Total price of the line item.

    variant_idstring

    ID of the variant.

    variant_titlestring

    Title of the variant, for example Blue, Size M.

    vendorstring

    Vendor of the product.

    weightstring

    Weight of the variant.

    weight_unitstring

    Unit of the weight, for example kg.

    barcodestring

    Barcode of the variant.

    customboolean

    Whether the line item is a custom item.

    trunk_pricestring

    Trunk price of the line item.

    main_currency_prices object

    Order amounts converted into the store's main currency.

    compare_at_pricestring

    Compare-at price of the item.

    pricestring

    Unit price converted into the store's main currency.

    totalstring

    Total converted into the store's main currency.

    trunk_pricestring

    Trunk price of the line item.

    actual_ratestring

    Exchange rate used for the conversion.

  • ]
  • order_urlstring

    Relative URL of the order page.

    checkout_urlstring

    Relative URL of the checkout page for the order.

    fulfillmentsundefined[]

    List of shipments for the order.

    main_currency_prices object

    Order amounts converted into the store's main currency.

    totalstring

    Total converted into the store's main currency.

    actual_ratestring

    Exchange rate used for the conversion.

    actual_rate_showstring
    order_typenumber

    Order type; 0 is a regular order, 1 is a gift card order.

  • ]

Get an order

GET /{locale}/api/orders/{order_id}.json

Get one order of the signed-in customer, with its addresses, line items and prices.

Example request

fetch(window.SHOPLAZZA.routes.root + '/api/orders/2446407211602194455359.json')
.then((response) => response.json())
.then((data) => {
// do something...
});

Request parameters

    order_idstring

    The id of the order.

Response

  • order object
    billing_address object

    Billing address of the order.

    addressstring

    Street address of the recipient.

    address1string

    Primary street address.

    areastring

    Area or district of the address.

    citystring

    City of the address.

    countrystring

    Country name of the address.

    country_codestring

    ISO country code of the address.

    emailstring

    Email address associated with the address.

    first_namestring

    First name of the customer or recipient.

    idstring

    ID of the address.

    last_namestring

    Last name of the customer or recipient.

    origin_idstring
    provincestring

    Province or state of the address.

    province_codestring

    Province or state code.

    zipstring

    Postal or ZIP code.

    phonestring

    Phone number associated with the address.

    phone_area_codestring

    Area code of the phone number.

    customer object

    The customer details.

    customer_idstring

    ID of the order's customer.

    emailstring

    Email address of the customer.

    first_namestring

    First name of the customer or recipient.

    last_namestring

    Last name of the customer or recipient.

    namestring

    Full name of the customer.

    order_countnumber

    Number of orders placed by the customer.

    phonestring

    Phone number of the customer.

    user_idstring
    line_items object[]

    List of line items.

  • Array [
  • compare_at_pricestring

    Compare-at price of the item.

    fulfillment_statusstring

    Fulfillment status, for example waiting, shipped, finished.

    idstring

    ID of the line item.

    image object

    Image of the line item's variant.

    altstring

    Alt text of the image.

    heightnumber

    Height of the image, in pixels.

    pathstring

    Path of the image file on the image server.

    srcstring

    URL of the image.

    widthnumber

    Width of the image, in pixels.

    notestring

    Note attached to the line item.

    options object[]

    Option values of the line item's variant.

  • Array [
  • namestring

    Name of the product option, for example Color.

    valuestring

    Value selected for this product option.

  • ]
  • pricestring

    Price of a single unit of the line item.

    product_handlestring

    Handle of the product.

    product_idstring

    ID of the product.

    product_titlestring

    Title of the product.

    product_urlstring

    Relative URL of the product page.

    propertiesstring

    Custom properties captured on the line item.

    quantitynumber

    Quantity of the item.

    requires_shippingboolean

    Whether shipping is required.

    skustring

    SKU of the variant, used for inventory tracking.

    taxableboolean

    Whether tax is charged.

    totalstring

    Total price of the line item.

    variant_idstring

    ID of the variant.

    variant_titlestring

    Title of the variant, for example Blue, Size M.

    vendorstring

    Vendor of the product.

    weightstring

    Weight of the variant.

    weight_unitstring

    Unit of the weight, for example kg.

    barcodestring

    Barcode of the variant.

    customboolean

    Whether the line item is a custom item.

    trunk_pricestring

    Trunk price of the line item.

    shipping_statusstring

    Shipping status of the line item.

    main_currency_prices object

    Order amounts converted into the store's main currency.

    compare_at_pricestring

    Compare-at price of the item.

    pricestring

    Unit price converted into the store's main currency.

    totalstring

    Total converted into the store's main currency.

    trunk_pricestring

    Trunk price of the line item.

    actual_ratestring

    Exchange rate used for the conversion.

    discount_totalstring

    Total discount applied.

    tax_totalstring

    Total tax applied to the order.

    discount_detailsundefined[]
    final_pricestring

    Price of a single unit of this line item, after line-level discounts.

    final_totalstring

    Final total of the order.

    is_free_giftboolean

    Whether the item is a free gift.

    duty_pricestring

    Customs duty of the line item.

  • ]
  • order_info object

    Summary information of the order.

    code_discount_totalstring

    Total discount from the discount code applied to the order.

    configstring

    Configuration of the order.

    create_timestring

    Time when the order was created; same as create_at.

    currency_codestring

    Currency code of the order, for example USD.

    customer_notestring

    Note the customer left during checkout.

    discount_applicationsstring

    Discounts applied to this object.

    discount_codestring

    Discount code applied to the order.

    discount_totalstring

    Total discount applied.

    fail_codestring
    financial_statusstring

    Payment status of the order, for example waiting, paid.

    fulfillment_statusstring

    Fulfillment status, for example waiting, shipped, finished.

    idstring

    ID of the order.

    line_item_discount_totalstring

    Total discount applied to the line items of the order.

    notestring

    Note the merchant added to the order.

    order_nostring

    Order number.

    post_sale_statusstring

    After-sales status of the order.

    refer_info object

    Information about how the customer reached the store.

    address_checkboolean
    client_idstring
    countrystring
    customer_sessionstring
    domainstring
    fbcstring
    fbpstring
    inventory_deductionstring
    ipstring

    The visitor's IP address.

    segstring
    session_idstring
    sourcestring
    user_agentstring
    shipping_address_editableboolean

    Whether the shipping address can still be edited.

    shipping_totalstring

    Total shipping fee of the order.

    statusstring

    Status of the order, for example opened, placed, finished.

    sub_totalstring

    Sum of the line item prices before order-level discounts.

    tax_totalstring

    Total tax applied to the order.

    totalstring

    Total price the customer pays, including tax, shipping and discounts.

    updated_atstring

    Last update time, in ISO-8601 format.

    total_tip_receivedstring

    Total tip received for the order.

    cancelableboolean

    Whether the order can still be cancelled.

    create_atstring

    Time when the order was created.

    gift_card_totalstring

    Total gift card amount applied to the order.

    paid_totalstring

    Total amount already paid for the order.

    payment_duestring

    Amount of the order that is still unpaid.

    payment_progressnumber

    Payment progress of the order; 3 means the order is fully paid.

    real_paid_totalstring

    Amount actually paid for the order.

    checkout_urlstring

    Relative URL of the checkout page for the order.

    order_urlstring

    Relative URL of the order page.

    main_currency_prices object

    Order amounts converted into the store's main currency.

    sub_totalstring

    Sum of the line item prices before order-level discounts.

    shipping_totalstring

    Total shipping fee of the order.

    tax_totalstring

    Total tax applied to the order.

    discount_totalstring

    Total discount applied.

    totalstring

    Total converted into the store's main currency.

    total_tip_receivedstring

    Total tip received for the order.

    actual_ratestring

    Exchange rate used for the conversion.

    actual_rate_showstring
    final_totalstring

    Final total of the order.

    order_typenumber

    Order type; 0 is a regular order, 1 is a gift card order.

    shipping_tax_typenumber
    shipping_tax_totalstring

    Total shipping tax of the order.

    product_tax_includedboolean

    Whether product prices include tax.

    additional_totalstring

    Total additional charges of the order.

    additional_prices object

    Breakdown of the additional charges.

    object
    tax_linesundefined[]

    Tax breakdown of the order.

    duty_totalstring

    Total customs duty and tax of the order.

    payment_line object

    Payment details of the order.

    namestring

    Display name of the payment method.

    channelstring

    Payment channel that processed the payment.

    methodstring

    Payment gateway used for the payment.

    credit_card_numberstring

    Last digits of the card used to pay.

    transaction_idstring

    Transaction number of the payment.

    paid_totalstring

    Amount paid through this payment method.

    extra_infostring
    real_paid_totalstring

    Amount actually paid through this payment method.

    shipping_address object

    Shipping address of the order.

    addressstring

    Street address of the recipient.

    address1string

    Primary street address.

    areastring

    Area or district of the address.

    citystring

    City of the address.

    companystring

    Company name of the address.

    countrystring

    Country name of the address.

    country_codestring

    ISO country code of the address.

    emailstring

    Email address associated with the address.

    extra_info object
    object
    first_namestring

    First name of the customer or recipient.

    idstring

    ID of the address.

    last_namestring

    Last name of the customer or recipient.

    origin_idstring
    phonestring

    Phone number associated with the address.

    phone_area_codestring

    Area code of the phone number.

    provincestring

    Province or state of the address.

    province_codestring

    Province or state code.

    zipstring

    Postal or ZIP code.

    shipping_linestring

    Shipping plan selected for the order.

    allowed_actions object

    Which actions the customer can perform on this order.

    delete_orderboolean

    Whether the order can be deleted.

    cancel_orderboolean

    Whether the order can be cancelled.

    repay_orderboolean

    Whether the order can be paid again.

    pay_orderboolean

    Whether the order can be paid.

    add_to_cartboolean

    Whether the items of the order can be added to the cart again.

    download_invoiceboolean

    Whether an invoice can be downloaded for the order.

    finish_fulfillmentboolean

    Whether the customer can confirm receipt of the order.

    payment_lines object[]

    List of the order payment records.

  • Array [
  • namestring

    Display name of the payment method.

    channelstring

    Payment channel that processed the payment.

    methodstring

    Payment gateway used for the payment.

    credit_card_numberstring

    Last digits of the card used to pay.

    transaction_idstring

    Transaction number of the payment.

    paid_totalstring

    Amount paid through this payment method.

    extra_infostring
    real_paid_totalstring

    Amount actually paid through this payment method.

  • ]
  • location_line object

    Address of the merchant's warehouse.

    location_idstring

    ID of the warehouse.

    location_namestring

    Name of the warehouse.

    first_namestring

    First name of the customer or recipient.

    last_namestring

    Last name of the customer or recipient.

    phonestring

    Phone number associated with the address.

    emailstring

    Email address associated with the address.

    countrystring

    Country name of the address.

    country_codestring

    ISO country code of the address.

    provincestring

    Province or state of the address.

    province_codestring

    Province or state code.

    areastring

    Area or district of the address.

    citystring

    City of the address.

    addressstring

    Street address of the recipient.

    address1string

    Primary street address.

    companystring

    Company name of the address.

    latitudestring

    Latitude of the address.

    longitudestring

    Longitude of the address.

    zipstring

    Postal or ZIP code.

    phone_area_codestring

    Area code of the phone number.

    extra_infostring
    shipping_line_info object

    Details of the shipping plan selected for the order.

    namestring

    Name of the shipping plan.

    descstring

    Description of the shipping plan.

    delivery_methodnumber

    Delivery method type; 1 is express delivery, 2 is local delivery.

    extra_infostring

Cancel an order

PATCH /{locale}/api/orders/{order_id}/cancel.json

Cancel one order of the signed-in customer.

Example request

fetch(window.SHOPLAZZA.routes.root + '/api/orders/2446407211602194455359/cancel.json', {
method: 'PATCH',
headers: {
'X-CSRF-Token': getCsrfToken()
}
})
.then((response) => response.json())
.then((data) => {
// do something...
});

Request parameters

    order_idstring

    The id of the order.

Response

    object

Confirm receipt of an order

PATCH /{locale}/api/orders/{order_id}/confirm_receipt.json

Confirm that the signed-in customer received the order.

Example request

fetch(window.SHOPLAZZA.routes.root + '/api/orders/2446407211602194455359/confirm_receipt.json', {
method: 'PATCH',
headers: {
'X-CSRF-Token': getCsrfToken()
}
})
.then((response) => response.json())
.then((data) => {
// do something...
});

Request parameters

    order_idstring

    The id of the order.

Response

    object

List the shipments of an order

GET /{locale}/api/orders/{order_id}/fulfillments.json

List the shipments of one order of the signed-in customer, with their tracking numbers, carriers and line items.

Example request

fetch(window.SHOPLAZZA.routes.root + '/api/orders/2446407211602194455359/fulfillments.json')
.then((response) => response.json())
.then((data) => {
// do something...
});

Request parameters

    order_idstring

    The id of the order.

Response

    countstring

    Number of fulfillments returned.

    fulfillments object[]

    List of shipments for the order.

  • Array [
  • idstring

    ID of the fulfillment.

    retrieve_methodstring
    tracking_numberstring

    Tracking number of the shipment.

    tracking_companystring

    Carrier handling the shipment.

    tracking_company_codestring

    Code of the carrier.

    statusstring

    Status of the fulfillment, for example shipped, finished.

    line_items object[]

    Line items included in this fulfillment.

  • Array [
  • idstring

    ID of the line item.

    product_titlestring

    Title of the product.

    product_idstring

    ID of the product.

    product_handlestring

    Handle of the product.

    variant_idstring

    ID of the variant.

    variant_titlestring

    Title of the variant, for example Blue, Size M.

    quantitynumber

    Quantity of the item.

    fulfillment_statusstring

    Fulfillment status, for example waiting, shipped, finished.

    notestring

    Note attached to the line item.

    image object

    Image of the line item's variant.

    altstring

    Alt text of the image.

    heightnumber

    Height of the image, in pixels.

    pathstring

    Path of the image file on the image server.

    srcstring

    URL of the image.

    widthnumber

    Width of the image, in pixels.

    compare_at_pricestring

    Compare-at price of the item.

    pricestring

    Price of a single unit of the line item.

    totalstring

    Total price of the line item.

    skustring

    SKU of the variant, used for inventory tracking.

    weightstring

    Weight of the variant.

    weight_unitstring

    Unit of the weight, for example kg.

    taxableboolean

    Whether tax is charged.

    requires_shippingboolean

    Whether shipping is required.

    options object[]

    Option values of the line item's variant.

  • Array [
  • namestring

    Name of the product option, for example Color.

    valuestring

    Value selected for this product option.

  • ]
  • vendorstring

    Vendor of the product.

    product_urlstring

    Relative URL of the product page.

    propertiesstring

    Custom properties captured on the line item.

    ship_quantitynumber

    Quantity shipped in this fulfillment.

  • ]
  • tracking_company_code_v1string
    tracking_urlstring

    Tracking URL of the shipment.

  • ]

Confirm receipt of a shipment

PATCH /{locale}/api/orders/{order_id}/fulfillments/{fulfillment_id}/finish.json

Confirm that the signed-in customer received one shipment of an order.

Example request

fetch(
window.SHOPLAZZA.routes.root +
'/api/orders/2446407211602194455359/fulfillments/8dc782af-4ee6-4a0a-804a-e96227673b32/finish.json',
{
method: 'PATCH',
headers: {
'X-CSRF-Token': getCsrfToken()
}
}
)
.then((response) => response.json())
.then((data) => {
// do something...
});

Request parameters

    order_idstring

    The id of the order.

    fulfillment_idstring

    The id of the shipment.

Response

    fulfillmentstringnullable

Request order deletion

DELETE /{locale}/api/orders/{order_id}.json

Example request

fetch(window.SHOPLAZZA.routes.root + '/api/orders/2446407211602194455359.json', {
method: 'DELETE',
headers: {
'X-CSRF-Token': getCsrfToken()
}
})
.then((response) => response.json())
.then((data) => {
// do something...
});

Request parameters

    order_idstring

    The id of the order.

Response

    object

Get access to an order page without signing in

POST /{locale}/api/order_verify

Exchange an order number and the email address on the order for the address of the order page. An anonymous visitor can call this, so it backs the order lookup form on a storefront. The body is application/x-www-form-urlencoded.

Example request

const body = new URLSearchParams({
order_number: 'KSR43063',
});

fetch(window.SHOPLAZZA.routes.root + '/api/order_verify', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-CSRF-Token': getCsrfToken()
},
body: body
})
.then((response) => response.json())
.then((data) => {
// do something...
});

Request parameters

    order_numberstring

    The order number, such as KSR43063.

    emailstring

    The email address on the order.

Response

    actionstring

    Result of the request, for example Success or Unauthorized.

    valuestring

    Relative URL the customer is redirected to.

Track a package by tracking number

GET /{locale}/api/tracking/package

Get the carrier tracking status of a shipment by tracking number.

Example request

fetch(window.SHOPLAZZA.routes.root + '/api/tracking/package?tracking_number=AJAXPROBE0001')
.then((response) => response.json())
.then((data) => {
// do something...
});

Request parameters

    tracking_numberstring

    The tracking number of the parcel.

Response

    meta object

    Metadata of the query result.

    codenumber

    HTTP-style status code of the query result.

    typestring

    Result type of the query, for example Success.

    messagestring

    Result message of the query.

    data object

    The response payload.

    items object[]

    List of tracked packages.

  • Array [
  • tracking_numberstring

    Tracking number of the shipment.

    carrier_codestring

    Code of the carrier handling the package.

    lastEventstring
    lastUpdateTimestring
    substatusstring
    origin_info object
    carrier_codestring

    Code of the carrier handling the package.

    ItemReceivedstring
    trackinfostringnullable
  • ]