Orders

GET Return order details that match the query filters. By default, calling this API with no filter returns the 100 most recently created orders. To return up to 200 orders, use the limit parameter. To return a page of results past the first page, use a resource offset. *Note* : The sum of the offset and limit parameters cannot be greater than 10000.

GET /organizations/{organizationId}/orders

Operation ID: getOrders. Security: AmOAuth2 (sfcc.orders, sfcc.orders.rw).

Parameters

  • organizationId (path, OrganizationId, required) An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character realm identifier and a 3-character instance type identifier.

    Example

    f_ecom_zzxy_prd
  • sortBy (query, string) Sort results by creation date or last modified date. The default is creation date.
    Allowed values: creation_date, last_modified_date. Default: creation_date.
  • sortOrder (query, string) Sort results in ascending or descending order. The default is descending.
    Allowed values: asc, desc. Default: desc.
  • status (query, string) Filter results by status. Valid statuses are 'new', 'completed', and 'cancelled'. You can include up to two statuses as a comma-separated string.
  • exportStatus (query, array of object, style: form, explode: false) Filter results by export status. Valid export statuses are 'not_exported', 'exported', 'ready', and 'failed'. You can include up to three export statuses as a comma-separated string.
    Maximum items: 3.

    Example

    not_exported,ready,failed

    Example

    [
      "not_exported",
      "ready",
      "failed"
    ]
  • externalStatus (query, string) Filter results by external status.
  • confirmationStatus (query, string) Filter results by confirmation status. Valid confirmation statuses are 'confirmed' and 'not_confirmed'.

    The order confirmation status.


    Allowed values: confirmed, not_confirmed. Example: confirmed.
  • paymentStatus (query, array of object, style: form, explode: false) Filter results by payment status. Valid payment statuses are 'not_paid', 'part_paid', and 'paid'. You can include up to two payment statuses as a comma-separated string.
    Maximum items: 3.

    Example

    not_paid,part_paid

    Example

    [
      "not_paid",
      "part_paid"
    ]
  • shippingStatus (query, array of object, style: form, explode: false) Filter results by shipping status. Valid shipping statuses are 'not_shipped', 'part_shipped', and 'shipped'. You can include up to two shipping statuses as a comma-separated string.
    Maximum items: 3.

    Example

    not_shipped,part_shipped

    Example

    [
      "not_shipped",
      "part_shipped"
    ]
  • creationDateFrom (query, string (date-time)) If passed, will return records where the creationDate is equal to or greater than the passed date-only.
    Example: 2015-05-19T15:30:18.000Z.
  • creationDateTo (query, string (date-time)) If passed, will return records where the creationDate is less than the passed date-only.
    Example: 2015-05-19T15:30:18.000Z.
  • lastModifiedDateFrom (query, string (date-time)) If passed, will return records where the lastModifiedDate is equal to or greater than the passed date-only.
    Example: 2015-05-19T15:30:18.000Z.
  • lastModifiedDateTo (query, string (date-time)) If passed, will return records where the lastModifiedDate is less than the passed date-only.
    Example: 2015-05-19T15:30:18.000Z.
  • siteId (query, SiteId, required) The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.

    Example: SiteId

    RefArch
  • limit (query, integer (int32)) Number of records to retrieve per request. Must be between 1 (minimum) and 200 (maximum). Defaults to 100.
    Default: 100. Minimum: 1. Maximum: 200.
  • offset (query, integer (int32)) Used to retrieve the results based on a particular resource offset.
    Default: 0. Minimum: 0.

Responses

  • 200 Order details returned successfully.

    Media type: application/json. Schema: OrdersResponse.

    Example: Order

    {
      "data": [
        {
          "adjustedMerchandizeTotalTax": 4.95,
          "adjustedShippingTotalTax": 0.3,
          "billingAddress": {
            "address1": "45 Main Rd.",
            "city": "Burlington",
            "countryCode": "US",
            "firstName": "Max",
            "fullName": "Max Mustermann",
            "lastName": "Mustermann",
            "phone": "6175555555",
            "postalCode": "05408",
            "stateCode": "MA"
          },
          "confirmationStatus": "confirmed",
          "createdBy": "storefront",
          "creationDate": "2015-05-19T15:23:18.000Z",
          "currency": "USD",
          "customerInfo": {
            "customerId": "abMKqMaNYOBMnNdDNzyC5oNTi5",
            "customerName": "Max Mustermann",
            "customerNo": "0002352",
            "email": "no-reply@salesforce.com",
            "guest": true
          },
          "customerLocale": "en_US",
          "exportStatus": "not_exported",
          "invoiceNo": "00000001",
          "lastModified": "2020-11-04T14:13:31.061Z",
          "merchandizeTotalTax": 4.95,
          "orderNo": "00000410",
          "orderTotal": 110.24,
          "paymentInstruments": [
            {
              "paymentCard": {
                "cardType": "Visa",
                "creditCardExpired": true,
                "expirationMonth": 1,
                "expirationYear": 2020,
                "holder": "Max Mustermann",
                "maskedNumber": "***************1111",
                "numberLastDigits": "1111",
                "validFromMonth": 1,
                "validFromYear": 2018
              },
              "paymentInstrumentId": "21052ad719a076cdc83637851e",
              "paymentMethodId": "CREDIT_CARD",
              "paymentTransaction": {
                "amount": 110.24,
                "transactionId": "40f07907428e23c4bbc6fb0446",
                "c_authResult": "AUTHORIZED"
              },
              "c_issuerBank": "JPMORGAN CHASE BANK, N.A."
            }
          ],
          "paymentStatus": "not_paid",
          "placeDate": "2015-05-19T15:23:18.000Z",
          "productItems": [
            {
              "adjustedTax": 4.95,
              "basePrice": 99,
              "bonusProductLineItem": false,
              "gift": false,
              "grossPrice": 103.95,
              "itemId": "99e96c7f8b46b98de2bae5d778",
              "itemText": "Flat Front Pant",
              "netPrice": 99,
              "position": 1,
              "priceAfterItemDiscount": 99,
              "priceAfterOrderDiscount": 99,
              "productId": "701643632930",
              "productName": "Flat Front Pant",
              "quantity": 1,
              "shipmentId": "me",
              "tax": 4.95,
              "taxBasis": 99,
              "taxRate": 0.05
            }
          ],
          "productSubTotal": 99,
          "productTotal": 99,
          "remoteHost": "127.0.0.1",
          "shipments": [
            {
              "adjustedMerchandizeTotalTax": 4.95,
              "adjustedShippingTotalTax": 0.3,
              "gift": false,
              "merchandizeTotalTax": 99,
              "productSubTotal": 99,
              "productTotal": 99,
              "shipmentId": "me",
              "shipmentNo": "00000001",
              "shipmentTotal": 110.24,
              "shippingAddress": {
                "address1": "45 Main Rd.",
                "city": "Burlington",
                "countryCode": "US",
                "firstName": "Max",
                "fullName": "Max Mustermann",
                "lastName": "Mustermann",
                "phone": "6175555555",
                "postalCode": "05408",
                "stateCode": "MA"
              },
              "shippingMethod": {
                "id": "DefaultShippingMethod"
              },
              "shippingStatus": "not_shipped",
              "shippingTotal": 5.99,
              "shippingTotalTax": 0.3,
              "taxTotal": 5.25
            }
          ],
          "shippingItems": [
            {
              "adjustedTax": 0.3,
              "basePrice": 5.99,
              "grossPrice": 6.29,
              "itemId": "23ace383d9355c881f1c00417a",
              "itemText": "Shipping",
              "netPrice": 5.99,
              "priceAfterItemDiscount": 5.99,
              "shipmentId": "me",
              "tax": 0.3,
              "taxBasis": 5.99,
              "taxRate": 0.05,
              "type": "fixed_price"
            }
          ],
          "shippingStatus": "not_shipped",
          "shippingTotal": 5.99,
          "shippingTotalTax": 0.3,
          "siteId": "ShoppingSite",
          "status": "new",
          "taxation": "net",
          "taxTotal": 5.25
        }
      ]
    }
  • 404 The given site ID does not reference an existing site.

    Media type: application/json. Schema: ErrorResponse.

    Example: OrderNotFound

    {
      "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/order-not-found",
      "title": "Order Not Found",
      "detail": "No order with number '123' was found."
    }