Retrieve an order
How to fetch a specific order via API
To fetch a single order, send a GET request to the /api/orders/:id endpoint, where id is the ID of the resource that you want to retrieve.
Request
GET https://yourdomain.commercelayer.io/api/orders/:id
Example
The following request fetches the order identified by the ID "XAyRWNUzyN":
curl -g -X GET \
  'https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN' \
  -H 'Accept: application/vnd.api+json' \
  -H 'Authorization: Bearer your-access-token'On success, the API responds with a 200 OK status code, returning a single resource object:
{
  "data": {
    "id": "XAyRWNUzyN",
    "type": "orders",
    "links": {
      "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN"
    },
    "attributes": {
      "number": "1234",
      "affiliate_code": "xxxx-yyyy-zzzz",
      "autorefresh": true,
      "place_async": true,
      "status": "draft",
      "payment_status": "unpaid",
      "fulfillment_status": "unfulfilled",
      "guest": true,
      "editable": true,
      "customer_email": "[email protected]",
      "customer_type": "returning",
      "language_code": "it",
      "currency_code": "EUR",
      "tax_included": true,
      "tax_rate": 0.22,
      "freight_taxable": true,
      "payment_method_taxable": true,
      "adjustment_taxable": true,
      "gift_card_taxable": false,
      "requires_billing_info": false,
      "country_code": "IT",
      "shipping_country_code_lock": "IT",
      "coupon_code": "SUMMERDISCOUNT",
      "gift_card_code": "cc92c23e-967e-48b2-a323-59add603301f",
      "subtotal_amount_cents": 5000,
      "subtotal_amount_float": 50.0,
      "formatted_subtotal_amount": "€50,00",
      "shipping_amount_cents": 1200,
      "shipping_amount_float": 12.0,
      "formatted_shipping_amount": "€12,00",
      "payment_method_amount_cents": 0,
      "payment_method_amount_float": 0.0,
      "formatted_payment_method_amount": "€0,00",
      "discount_amount_cents": -500,
      "discount_amount_float": -5.0,
      "formatted_discount_amount": "-€5,00",
      "adjustment_amount_cents": 1500,
      "adjustment_amount_float": 15.0,
      "formatted_adjustment_amount": "€15,00",
      "gift_card_amount_cents": 1500,
      "gift_card_amount_float": 15.0,
      "formatted_gift_card_amount": "€15,00",
      "total_tax_amount_cents": 1028,
      "total_tax_amount_float": 10.28,
      "formatted_total_tax_amount": "€10,28",
      "subtotal_tax_amount_cents": 902,
      "subtotal_tax_amount_float": 9.02,
      "formatted_subtotal_tax_amount": "€9,02",
      "shipping_tax_amount_cents": 216,
      "shipping_tax_amount_float": 2.16,
      "formatted_shipping_tax_amount": "€2,16",
      "payment_method_tax_amount_cents": 0,
      "payment_method_tax_amount_float": 0.0,
      "formatted_payment_method_tax_amount": "€0,00",
      "adjustment_tax_amount_cents": 900,
      "adjustment_tax_amount_float": 9.0,
      "formatted_adjustment_tax_amount": "€9,00",
      "total_amount_cents": 5700,
      "total_amount_float": 57.0,
      "formatted_total_amount": "€57,00",
      "total_taxable_amount_cents": 4672,
      "total_taxable_amount_float": 46.72,
      "formatted_total_taxable_amount": "€46,72",
      "subtotal_taxable_amount_cents": 4098,
      "subtotal_taxable_amount_float": 40.98,
      "formatted_subtotal_taxable_amount": "€40,98",
      "shipping_taxable_amount_cents": 984,
      "shipping_taxable_amount_float": 9.84,
      "formatted_shipping_taxable_amount": "€9,84",
      "payment_method_taxable_amount_cents": 0,
      "payment_method_taxable_amount_float": 0.0,
      "formatted_payment_method_taxable_amount": "€0,00",
      "adjustment_taxable_amount_cents": 120,
      "adjustment_taxable_amount_float": 1.2,
      "formatted_adjustment_taxable_amount": "€1,20",
      "total_amount_with_taxes_cents": 5700,
      "total_amount_with_taxes_float": 57.0,
      "formatted_total_amount_with_taxes": "€57,00",
      "fees_amount_cents": 0,
      "fees_amount_float": 0.0,
      "formatted_fees_amount": "€0,00",
      "duty_amount_cents": 0,
      "duty_amount_float": 0.0,
      "formatted_duty_amount": "€0,00",
      "place_total_amount_cents": 0,
      "place_total_amount_float": 0.0,
      "formatted_place_total_amount": "€0,00",
      "skus_count": 2,
      "line_item_options_count": 1,
      "shipments_count": 1,
      "tax_calculations_count": 1,
      "validations_count": 1,
      "payment_source_details": {
        "foo": "bar"
      },
      "token": "1c0994cc4e996e8c6ee56a2198f66f3c",
      "cart_url": "https://yourdomain.com/cart",
      "return_url": "https://yourdomain.com/",
      "terms_url": "https://yourdomain.com/terms",
      "privacy_url": "https://yourdomain.com/privacy",
      "checkout_url": "https://yourdomain.commercelayer.io/checkout/1c0994cc4e996e8c6ee56a2198f66f3c",
      "placed_at": "2018-01-01T12:00:00.000Z",
      "approved_at": "2018-01-01T12:00:00.000Z",
      "cancelled_at": "2018-01-01T12:00:00.000Z",
      "payment_updated_at": "2018-01-01T12:00:00.000Z",
      "fulfillment_updated_at": "2018-01-01T12:00:00.000Z",
      "refreshed_at": "2018-01-01T12:00:00.000Z",
      "archived_at": "2018-01-01T12:00:00.000Z",
      "subscription_created_at": "2018-01-01T12:00:00.000Z",
      "expires_at": "2018-01-02T12:00:00.000Z",
      "expiration_info": {
        "summary_message": "Your tickets are reserved for the remaining time.",
        "expired_message": "Your session has expired. Please start your checkout again.",
        "redirect_url": "https://yourshop.com/"
      },
      "created_at": "2018-01-01T12:00:00.000Z",
      "updated_at": "2018-01-01T12:00:00.000Z",
      "reference": "ANY-EXTERNAL-REFEFERNCE",
      "reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
      "metadata": {
        "foo": "bar"
      }
    },
    "relationships": {
      "market": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/market",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/market"
        }
      },
      "customer": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/customer",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/customer"
        }
      },
      "shipping_address": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/shipping_address",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/shipping_address"
        }
      },
      "billing_address": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/billing_address",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/billing_address"
        }
      },
      "store": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/store",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/store"
        }
      },
      "default_shipping_method": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/default_shipping_method",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/default_shipping_method"
        }
      },
      "default_payment_method": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/default_payment_method",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/default_payment_method"
        }
      },
      "available_payment_methods": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/available_payment_methods",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/available_payment_methods"
        }
      },
      "available_customer_payment_sources": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/available_customer_payment_sources",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/available_customer_payment_sources"
        }
      },
      "available_free_skus": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/available_free_skus",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/available_free_skus"
        }
      },
      "available_free_bundles": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/available_free_bundles",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/available_free_bundles"
        }
      },
      "payment_method": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/payment_method",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/payment_method"
        }
      },
      "payment_source": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/payment_source",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/payment_source"
        }
      },
      "discount_engine_item": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/discount_engine_item",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/discount_engine_item"
        }
      },
      "line_items": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/line_items",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/line_items"
        }
      },
      "line_item_options": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/line_item_options",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/line_item_options"
        }
      },
      "stock_reservations": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/stock_reservations",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/stock_reservations"
        }
      },
      "stock_line_items": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/stock_line_items",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/stock_line_items"
        }
      },
      "stock_transfers": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/stock_transfers",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/stock_transfers"
        }
      },
      "shipments": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/shipments",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/shipments"
        }
      },
      "payment_options": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/payment_options",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/payment_options"
        }
      },
      "transactions": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/transactions",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/transactions"
        }
      },
      "authorizations": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/authorizations",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/authorizations"
        }
      },
      "captures": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/captures",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/captures"
        }
      },
      "voids": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/voids",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/voids"
        }
      },
      "refunds": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/refunds",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/refunds"
        }
      },
      "returns": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/returns",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/returns"
        }
      },
      "order_subscription": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/order_subscription",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/order_subscription"
        }
      },
      "order_subscriptions": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/order_subscriptions",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/order_subscriptions"
        }
      },
      "order_factories": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/order_factories",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/order_factories"
        }
      },
      "order_copies": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/order_copies",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/order_copies"
        }
      },
      "recurring_order_copies": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/recurring_order_copies",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/recurring_order_copies"
        }
      },
      "attachments": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/attachments",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/attachments"
        }
      },
      "notifications": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/notifications",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/notifications"
        }
      },
      "links": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/links",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/links"
        }
      },
      "resource_errors": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/resource_errors",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/resource_errors"
        }
      },
      "events": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/events",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/events"
        }
      },
      "tags": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/tags",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/tags"
        }
      },
      "versions": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/versions",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/versions"
        }
      },
      "event_stores": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/relationships/event_stores",
          "related": "https://yourdomain.commercelayer.io/api/orders/XAyRWNUzyN/event_stores"
        }
      }
    },
    "meta": {
      "mode": "test",
      "organization_id": "xRRkjDFafe",
      "trace_id": "69abaa3545913c78132e5578bd26208d44aa9043647d78698fd0021f3958cd74"
    }
  }
}Last updated

