Loyalty API

Create a loyalty transaction

POST

The Loyalty API is currently in beta.

Please contact our Support Team via our JIRA Service Desk for access to the Beta. If you don’t have access, please contact your account administrator for assistance.

Not yet integrated with Primer and interested in learning more? Contact us.

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
stringRequired
ID of the Primer connection configuration.
customerId
stringRequired
The unique identifier for the customer on the loyalty provider.
orderId
stringRequired
Unique identifier for the order.
value
integerRequired
The value of points to redeem.
type
enumOptional
The type of the transaction.
Allowed values: REDEMPTIONREFUND

Response

This endpoint returns an object
date
datetimeOptional
Creation date & time of the transaction (UTC)
id
stringOptional
Unique Primer identifier for the loyalty transaction.
connectionId
stringOptional
ID of the Primer connection configuration.
customerId
stringOptional
The unique identifier for the customer on the loyalty provider.
orderId
stringOptional
Unique identifier for the order.
connectionTransactionId
stringOptional
ID of the transaction on the loyalty provider's side.
connectionName
stringOptional
Name of the loyalty provider.
type
enumOptional
The type of the transaction.
Allowed values: REDEMPTIONREFUND
value
integerOptional
The value of the transaction.

Errors

POST
$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": 1,
> "type": "REDEMPTION"
>}'
Response
1{
2 "date": "2023-01-01",
3 "id": "t101",
4 "connectionId": "waon-123",
5 "customerId": "waon-customer-123",
6 "orderId": "order-123",
7 "connectionTransactionId": "waonTx1",
8 "connectionName": "WOAN",
9 "type": "REDEMPTION",
10 "value": 200
11}