Retail Experience Cloud Integrations

Get customer most recent order

Changed on

Read the ERC e-commerce connections customer most recent order for the provided customer id.

get/erc/ecommerce/connections/customers/{customer_id}/most-recent-order

Request

  • Base URL
    https://api.talkdeskapp.com
  • URL
    https://api.talkdeskapp.com/erc/ecommerce/connections/customers/{customer_id}/most-recent-order
  • Auth
    OAuth 2
    Authorization code: https://{account_name}.talkdeskid.com/oauth/authorize
    Token URL: https://{account_name}.talkdeskid.com/oauth/token scopes: erc-ecommerce-connections-orders:read

Path parameters

customer_idstring required
Example:customer123

The customer id.

Query parameters

brandstring
Example:Brand 123

The brand of the provider you want to filter by. If the account is multi-brand, this parameter is required.

Response

The customer most recent order found for the provided customer id.

idstring required

The ID of the order

customer_idstring

The ID of the customer that created this order

status_info_current_indexinteger

The current state/step index of the order status in the 'status_info' list

order_numberstring required

The number of the order (usually the order identifier that the customer knows)

purchase_datetimestring date-time

The timestamp date when the order was created

delivery_type'UNKNOWN' | 'LOCAL_DELIVERY' | 'LOCAL_PICKUP' | 'SHIPPING'

Represents the type of delivery for a given order

custom_fieldsobject

The custom fields associated with the provider

brandstring

The brand of the provider

is_refundableboolean

Indicates whether the current order is refundable

is_returnableboolean

Indicates whether the current order is returnable

is_cancellableboolean

Flag indicating if the order can be cancelled

is_change_shipping_address_allowedboolean

Flag indicating if the shipping address of the order can be changed

Example response

{
  "id": "order456",
  "customer_id": "customer123",
  "status_info": [
    {
      "status_date_time": "2021-10-23T12:16:50.078Z"
    }
  ],
  "status_info_current_index": 3,
  "order_number": "#Y34DHR",
  "purchase_datetime": "2021-09-14T12:16:50.078Z",
  "tracking_info": {
    "tracking_number": "#USPS 123456789",
    "external_url": "https://external.url.com/"
  },
  "delivery_type": "SHIPPING",
  "shipping_addresses": [
    {
      "id": "address1234",
      "first_name": "John",
      "last_name": "Doe",
      "phone_number": "+351910000000",
      "address": "Lisbon",
      "zip_code": "20000000",
      "city": "Lisbon",
      "region_code": "PT-11",
      "country_code": "PT",
      "default": true
    }
  ],
  "highlighted_item": {
    "id": "orderItem789",
    "name": "Order Item 789",
    "description": "Description of order Item 789",
    "brand": "Brand 123",
    "price": {
      "value": 10.5,
      "currency": "EUR"
    },
    "image_url": "https://external-integration.url.com/order_item_icon.png",
    "quantity": 10,
    "sku": "Sku 123",
    "deliverable_quantity": 10,
    "refundable_quantity": 3,
    "deliveries": [
      {
        "id": "orderDelivery123",
        "delivery_quantity": 10,
        "carrier": "FedEx",
        "delivery_type": "Store delivery",
        "delivery_date_start": "2025-02-21T12:16:50.078Z",
        "delivery_date_end": "2025-02-28T12:16:50.078Z",
        "shipping_date": "2025-02-21T12:16:50.078Z",
        "service_level": "Standard",
        "description": "This shipment will be delivered by FedEx.",
        "latest_status_info": {
          "status_date_time": "2021-10-23T12:16:50.078Z"
        },
        "tracking_info": {
          "tracking_number": "#USPS 123456789",
          "external_url": "https://external.url.com/"
        },
        "returnable_quantity": 1,
        "last_update": "2021-09-14T12:16:50.078Z"
      }
    ]
  },
  "brand": "Brand 123",
  "is_refundable": true,
  "is_returnable": true,
  "is_cancellable": true,
  "is_change_shipping_address_allowed": true,
  "_links": {
    "self": {
      "href": "http://api-docs.talkdesk.org/erc/ecommerce/connections/customers/customer123/most-recent-order"
    }
  }
}

Changes