import SnagSolutions from '@snagsolutions/sdk';
const client = new SnagSolutions({
apiKey: 'My API Key',
});
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>"
}
Create a loyalty transaction to update account balances.
import SnagSolutions from '@snagsolutions/sdk';
const client = new SnagSolutions({
apiKey: 'My API Key',
});
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>"
}
Body
Schema for creating a loyalty transaction
200
The response is of type object
.