POST
/
api
/
loyalty
/
transactions
import SnagSolutions from '@snagsolutions/sdk';

const client = new SnagSolutions({
  apiKey: process.env['X_API_KEY'], // This is the default and can be omitted
});

const response = await client.loyalty.transactions.createTransaction({
  description: 'Purchase of item X',
  entries: [{ amount: 5 }],
});

console.log(response.id);
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "description": "<string>",
  "entries": [
    {
      "walletAddress": "<string>",
      "amount": 123,
      "direction": "credit",
      "idempotencyKey": "<string>"
    }
  ],
  "createdAt": "<string>",
  "updatedAt": "<string>"
}

Authorizations

X-API-KEY
string
header
required

Body

application/json

Body

Schema for creating a loyalty transaction

Response

200
application/json

200

The response is of type object.