Get Orders

Description

This service retrieves a list of all past and current orders for the logged-in user within a specific mileage activity.


Request

Restrictions

This service requires an authenticated user and can only be called after a successful consumer login.

Endpoint

GET https://<server-url>/api/v4/mileage/{activity_code}/orders

Path Parameters

Parameter
Type
Description

activity_code

String

The unique code for the mileage activity (e.g., "MPOINTS").

Parameters

Parameter
Location
Description

touchpoint

Query / Header

The identifier for the touchpoint. Use Thalamus-Touchpoint for the header.

token

Query / Header

The authentication token for the API session. Use Thalamus-Token for the header.

Full URL Example

https://<server-url>/api/v4/mileage/MPOINTS/orders?touchpoint=test&token=...

Request Body

This request does not have a body.


Response

✅ Successful Response: 200 OK

A JSON object is returned containing an array of orders. Each order object provides full details about the transaction, including the items purchased and any discounts applied.

Key Order Fields

Field
Type
Description

orderNumber

Integer

The unique identifier for the order.

creationDate

Timestamp

The date the order was created.

orderState

String

The current status of the order (e.g., "Received").

items

Array

An array of objects, where each object represents a line item in the order.

discountCupons

Array

An array of objects detailing any discount coupons applied to the order.

JSON

{
  "orders": [
    {
      "orderNumber": 10,
      "creationDate": 1489502415000,
      "orderState": "Received",
      "addressCode": "",
      "exchangeCenterId": null,
      "message": "",
      "items": [
        {
          "item": {
            "code": "VirtualItemCode",
            "name": "VirtualItem",
            "itemType": "VIRTUAL_ITEM",
            "price": 0
          },
          "quantity": 1,
          "total": 0
        }
      ],
      "discountCupons": [
        {
          "code": "0hdh6fuvja",
          "name": "RegaloParaTodo",
          "total": 20.0,
          "discountApplied": 20.0
        }
      ]
    },
    {
      "orderNumber": 11,
      "creationDate": 1489502585000,
      "orderState": "Received",
      "addressCode": "address",
      "items": [
        {
          "item": {
            "code": "CatalogFisicoCode",
            "name": "CatalogFisico",
            "itemType": "PHYSICAL_ITEM",
            "price": 0
          },
          "quantity": 1,
          "total": 0
        }
      ],
      "discountCupons": []
    }
  ]
}

❌ Unsuccessful Response: 404 Not Found

Returned if the specified activity_code does not exist.

JSON

{
  "errors": {
    "error.message": "NOT_FOUND"
  }
}

Last updated

Was this helpful?