get https://your-url-here.com/erc/ecommerce/connections/customers//most-recent-order
Scope
erc-ecommerce-connections-orders:read
Body Response - Schema
200 OK (the customer's most recent order found for the provided customer ID)
Represents the customer's most recent order resource
Parameter | Type | Description | Required |
---|---|---|---|
id | string | The ID of the order. Example: order456 | yes |
customer_id | string | The ID of the customer that created this order. Example: customer123 | no |
status_info | array[object] | The list of possible status information states/steps for the order. "status_info" subdivides into: 1 - "generic_type" (string) - the generic type of the state/step. Allowed values: UNKNOWN,CONFIRMED,ON_ITS_WAY,OUT_FOR_DELIVERY,DELIVERED" Example: IN_TRANSIT. Required. 2 - "detailed_type" (string) - the detailed type of the state/step. Allowed values: UNKNOWN, ATTEMPTED_DELIVERY, READY_FOR_PICKUP, PICKED_UP, CONFIRMED IN_TRANSIT, OUT_FOR_DELIVERY, DELIVERED, FAILURE. Example: IN_TRANSIT 3 - "status_date_time" (string) - The timestamp date when the status info state/step was 'reached'. Example: 2021-10-23T12:16:50.078Z | no |
status_info_current_index | integer | The current state/step index of the order status in the 'status_info' list. Example: 3 | no |
order_number | string | The number of the order (usually the order identifier that the customer knows). Example: #Y34DHR | yes |
purchase_datetime | string | The timestamp date when the order was created. Example: 2021-09-14T12:16:50.078Z | no |
tracking_info | object | The tracking information associated with the order delivery. "tracking_info" subdivides into: 1 - "tracking_number" (string) - the tracking number associated with the order delivery. Example: #USPS 123456789. Required. 2 - "external_url" (string ) - the URL of the external system where we can get more tracking details (ex: the URL of the carrier). Example: https://external.url.com/ | no |
delivery_type | string | The type of delivery associated with the order. Allowed values: UNKNOWN, LOCAL_DELIVERY, LOCAL_PICKUP, SHIPPING Example: SHIPPING | no |
shipping_addresses | array[object] | The address to which the order will be/was shipped. "shipping_address" subdivides into: 1 - "id" (string) - The address identifier. Example: address1234 2 - "first_name" (string) - the first name of the person associated with the address. Example: John 3 - "last_name" (string) - the last name of the person associated with the address. Example: Doe 4 - "phone_number" (string) - the phone number of the person associated with the address. Example: +351910000000 5 - "address" (string) - the first line of the address. Example: Lisbon 6 - "zip_code" (string) - the zip-code of the address. Example: 20000000 7 - "city" (string) - the city of the address. Example: Lisbon 8 - "region_code" (string) - the region (country subdivision) code according to ISO 3166-2 standard. Example: PT-11 9 - "country_code" (string) - the country code of the address, according the ISO 3166-1 alpha-2 codes. Example: PT 10 - "default" (boolean) - define if address is default. Example: true | no |
highlighted_item | object | The highlighted/main item of the order. "highlighted_item" subdivides into: 1 - "id" (string) - the ID of the item. Example: orderItem789. Required. 2 - " name (string) - the name of the item. Example: Order Item 789 3 - " description (string) - the description of the item. Example: description of order Item 789 4 - "brand (string) - the brand of the item. Example: Brand 123 5 - "price (object) - the price of the item. Required. 5.1 - "value" (number ) - the amount of money. Example: 10.5. Required. 5.2 - "currency" (string) - the currency of the money amount. Example: EUR. Required. 6 - "image_url (string ) - the URL of the item image/picture. Example: https://external-integration.url.com/order_item_icon.png 7 - "quantity (integer) - the quantity of the item. > = 1 <= 100 Example: 10 8 - "sku (string) - the sku of the item. Example: Sku 123 | no |
deliverable_quantity | integer | The quantity of order items that are yet to be delivered/processed > = 1 <= 100 > Example: > 10 | no |
deliveries | array[object] | List of deliveries where the item is inserted. "deliveries" subdivides into: 1 - "id" (object) - the ID of the order delivery. Example: orderDelivery123. Required. 2 - "delivery_quantity" (integer) - the quantity of items associated with the delivery. > = 1 <= 100 Example: 10 3 - "latest_status_info" (object) - the latest delivery status information. 3.1 - "type" (string) - the type of the state/step. Allowed values: UNKNOWN, ATTEMPTED_DELIVERY, READY_FOR_PICKUP, PICKED_UP, CONFIRMED IN_TRANSIT, OUT_FOR_DELIVERY, DELIVERED, FAILURE. Example: IN_TRANSIT. Required. 3.2 - "status_date_time" (string) - the timestamp date when the status info state/step was 'reached'. Example: 2021-10-23T12:16:50.078Z 4 - "tracking_info" (object) - the tracking information associated with the order delivery. 4.1 - "tracking_number" (string) - the tracking number associated with the order delivery. Example: #USPS 123456789. Required. 4.2 - "external_url" (string) - the URL of the external system where we can get more tracking details (ex: the URL of the carrier). Example: https://external.url.com/ 5 - "last_update" (string ) - the timestamp date when the order delivery was last updated. Example: 2021-09-14T12:16:50.078Z | no |
custom_fields | object | The custom fields associated with the provider | |
_links | object | "_links" subdivides into: 1 - "self" (object) - required. 1.1 - "href" (string ) - http://api-docs.talkdesk.org/erc/ecommerce/customers/customer123/most-recent-order | no |
400 (bad request), 401 (unauthorized), 403 (forbidden), 404 (not found), 405 (method not supported)
Parameter | Type | Description | Required |
---|---|---|---|
code | string | n/a | yes |
message | string | n/a | yes |
description | string | n/a | no |
fields | array[object] | "fields" subdivides into: "name" (string) "description" (string) | yes (name and description) |
Troubleshooting
If you have any questions regarding the usage of this API, or if you’re having any technical issues, please open a ticket using this form.