Affiliate
1. Overview
The Coinlocally Affiliate API allows affiliates to retrieve referral information for their referred users.
To use the API, each affiliate must first obtain an API Key and Secret Key. These credentials are used to authenticate all requests by generating a secure HMAC SHA256 signature.
2. Authentication
Required Headers
Every request must include the following headers:
x-api-key
Affiliate’s API key
x-signature
HMAC SHA256 signature of payload + timestamp
x-timestamp
Current timestamp in milliseconds
Signature Generation
signature = HmacSHA256(payload, secretKey).toString(crypto.enc.Hex)Where:
payload =
JSON.stringify(requestBody) + timestampsecretKey = Your affiliate secret key
3. API Endpoint
URL:
Method:
4. Request
Body Parameters
userId
number
✅
The unique ID of the user
email
string
❌
The email of the user (optional)
Example Request Body
OR (with email):
5. Response
Example Response
6. Postman Pre-Request Script
7. Python Implementation Example
✅ Now affiliates can securely connect and retrieve referral information using the provided API Key and Secret Key.
Last updated