Loyalty API

Create a loyalty transaction

POST
https://api.sandbox.primer.io/loyalty-transactions

The Loyalty API is currently in beta. Please contact support@primer.io for access.

Create an API key with the loyalty-transactions:write scopes.

Create a loyalty transaction. This is either a points redemption or a points refund.

Request

This endpoint expects an object.
connectionId
string

ID of the Primer connection configuration.

customerId
string

The unique identifier for the customer on the loyalty provider.

orderId
string

Unique identifier for the order.

value
integer

The value of points to redeem.

type
optional enum

The type of the transaction.

Allowed values: REDEMPTIONREFUND

Response

This endpoint return an object.
date
optional datetime

Creation date & time of the transaction (UTC)

id
optional string

Unique Primer identifier for the loyalty transaction.

connectionId
optional string

ID of the Primer connection configuration.

customerId
optional string

The unique identifier for the customer on the loyalty provider.

orderId
optional string

Unique identifier for the order.

connectionTransactionId
optional string

ID of the transaction on the loyalty provider's side.

connectionName
optional string

Name of the loyalty provider.

type
optional enum

The type of the transaction.

Allowed values: REDEMPTIONREFUND
value
optional integer

The value of the transaction.

Errors

POST
/loyalty-transactions
1
2
3
4
5
6
7
8
9
curl -X POST "https://api.sandbox.primer.io/loyalty-transactions" \
     -H "X-API-KEY: <apiKey>" \
     -H "Content-Type: application/json" \
     -d '{
  "connectionId": "string",
  "customerId": "string",
  "orderId": "string",
  "value": 0
}'
Response
1
2
3
4
5
6
7
8
9
10
11
{
  "date": "2023-01-01T00:00:00Z",
  "id": "string",
  "connectionId": "string",
  "customerId": "string",
  "orderId": "string",
  "connectionTransactionId": "string",
  "connectionName": "string",
  "type": "REDEMPTION",
  "value": 0
}