Skip to main content
POST
/
api
/
loyalty
/
rules
/
{id}
/
complete
JavaScript
import SnagSolutions from '@snagsolutions/sdk';

const client = new SnagSolutions({
  apiKey: 'My API Key',
});

const response = await client.loyalty.rules.complete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');

console.log(response.message);
{
  "message": "Completion request added to queue"
}

Authorizations

X-API-KEY
string
header
required

Path Parameters

id
string<uuid>
required

Body

application/json

Body

Schema for completing a loyalty rule

verificationCode
string

Optional verification code for completing the loyalty rule

Example:

"VERIF123"

userId
string<uuid>

Unique identifier for the user

Example:

"123e4567-e89b-12d3-a456-426614174000"

walletAddress
string

Wallet address of the user can only be used if userId is not provided

Example:

"0x1234567890abcdef1234567890abcdef12345678"

contentUrl
string

Link to the post/comment made by user

Example:

"https://x.com/Snag_Solutions/status/1735407428093522314"

loyaltyQuestionChoiceId
string

ID of the choice selected by the user

Example:

"123e4567-e89b-12d3-a456-426614174000"

verifyOnly
string
default:false

Flag indicating if only verification is required, this will not create a transaction and reward the user.

Example:

false

rangeValue
number | null

Value to compare with the range

Example:

10

amount
number | null

Override amount for the reward (rounded to nearest whole number). This will override the rule amount and reward the integer passed.

Example:

10

idempotencyKey
string

Unique key to ensure idempotent requests.

Maximum length: 70
Example:

"IDEMPOTENCY123"

Response

200

message
enum<string>
required
Available options:
Completion request added to queue,
Link click being verified, come back later to check the status
I