The following shows the standards we expect for an API endpoint that our loyalty rules interact with (e.g. to get off-chain data from your system that somehow impacts rule evaluation and/or rewards).

Configuration

For our system to be able to call your endpoint(s) during rule execution we ask for the following:

Authentication

Please build your APIs with API key access. Allow us to pass in the API key as a header

# we will send the following header on all requests
x-api-key: YOUR_API_KEY

Endpoint Design

GET <URL can be specified, e.g. https://api.domain.com/route>

Request parameters:
{
  walletAddress: string | string[],  // case-insensitive
  startingAfter?: string // optional, only if pagination is required.
}

// no pagination
Response body:
Status code: 2**

{
  "data": [{
    "id": string // optional, only if pagination is required
    walletAddress: string
    data: object // important: this contains the data properties relevant for rule evaluation/rewards distribution
  }],
  hasNextPage: boolean // if pagination is required
}