Get Party sales

Description

This service retrieves a list of all sales (purchases) for the currently logged-in party. The results can be filtered and paginated using optional parameters.


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/sale/purchases

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.

limit

Query

Optional. An integer to limit the number of sales returned (for pagination).

offset

Query

Optional. An integer to specify the starting point of the sales to return (for pagination).

from

Query

Optional. A date in yyyy-mm-dd format to filter sales from this date forward.

to

Query

Optional. A date in yyyy-mm-dd format to filter sales up to this date.

transactionId

Query

Optional. A string to filter for a specific transaction ID.

id

Query

Optional. An integer that represents sale ID in database

Full URL Example

https://<server-url>/api/v4/sale/purchases?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 items. Each object represents an individual item from a past sale.

Field
Type
Description

id

Number

The unique ID of the sale item record.

partyId

Number

The ID of the party who made the purchase.

quantity

Number

The quantity of the item purchased.

amount

Number

The amount of the sale for this item.

skuId

Number

The ID of the purchased SKU.

skuName

String

The name of the purchased SKU.

saleDate

Timestamp

The date of the sale.

transactionId

String

The transaction identifier for the sale.

JSON

{
  "items": [
    {
      "partyId": 2,
      "id": 1,
      "quantity": 2.0,
      "amount": 500.0,
      "skuId": 1.0,
      "skuName": "sku-test-1",
      "skuCode": "999",
      "saleDate": 1670354140000,
      "transactionId": "555",
      "description1": "description 1"
    },
    {
      "partyId": 2,
      "id": 2,
      "quantity": 2.0,
      "amount": 500.0,
      "skuId": 1.0,
      "skuName": "sku-test-1",
      "skuCode": "999",
      "saleDate": 1670354140000,
      "description1": "description 1"
    }
  ]
}

❌ Unsuccessful Response: 400 Bad Request

Returned if the request is malformed or includes invalid filter parameters.

JSON

{
  "errors": {
    "case": "Invalid PartyID"
  }
}

Last updated

Was this helpful?