Overview
This guide explains how to integrate partner-initiated campaign creation and reward issuance using the Thanx Partner API. This integration allows partners to programmatically create campaigns, configure reward variants, and issue rewards to users — all from within their own platform. Common use cases include feedback-driven service recovery, automated marketing triggers, loyalty activation based on external events, and CRM-driven reward distribution. The integration is entirely server-to-server. Partners trigger reward issuance on behalf of merchants by identifying users via email or phone number. By building to these endpoints, partners can deliver a unified workflow where merchants no longer need to switch between systems to act on insights and issue rewards. This reduces friction, speeds up execution, and creates a tighter feedback loop between partner platforms and Thanx loyalty.Credentials You Will Need
For this kind of integration, you will be provided the following credentials:- Client ID
- Access Token
rewards.issue scope. Use the Get Scopes endpoint to verify which scopes your credentials have access to.
Endpoints We Will Be Using
The following endpoints are the minimum required for this integration:- List Reward Templates — Discover available reward templates for a merchant
- Create Campaign — Create a campaign with reward variants
- Issue Rewards — Issue rewards to users by email or phone
- Get Issuance Job — Poll for issuance job completion status
Postman API Collection
Here you will find the Partner API Postman Collection to import directly within your API testing tool. This collection includes sample values for credentials. Replace them with those provided by your Thanx representative to ensure successful API calls. Partner API Postman CollectionAPI Interaction Workflow
Integration Flow
1 — Discovery
Before creating campaigns or issuing rewards, the partner must discover which merchants are accessible and what reward templates each merchant has published. Call the Get Merchants endpoint to retrieve the list of merchants that have opted into the integration. For each merchant, call the List Reward Templates endpoint to retrieve available reward templates. These templates define the types of rewards that can be issued (e.g., “Free Coffee”, “$5 Off Next Visit”). Merchant and reward template data should be cached and refreshed periodically rather than fetched on every operation. Endpoints used in this step:- Get Merchants Lists all merchants accessible to the integration partner.
- List Reward Templates Returns published reward templates for a given merchant.
- Get Reward Template (Optional) Returns details of a specific reward template.
2 — Campaign Creation
A campaign defines the time window, terms, and reward variants for issuing rewards to users. Each campaign must have between 1 and 4 variants. Treatment variants specify areward_template_id that defines the reward to be issued. Control variants (named “Control”) do not require a reward_template_id and are used for A/B testing — measuring the impact of rewards versus no reward.
The partner provides the following when creating a campaign:
merchant_id— The merchant the campaign belongs toname— Campaign name (e.g., “Service Recovery - Negative Feedback”)objective— Campaign objective (e.g., “Re-engage guests after poor experience”)fine_print— Terms and conditionsstart_at/end_at— Campaign active window (ISO8601)redeemable_from/redeemable_to— When issued rewards can be redeemed (ISO8601)variants— Array of 1–4 variants, each with anameand optionalreward_template_id
- Create Campaign Creates a new partner-initiated campaign with reward variants for a merchant.
- List Campaigns (Optional) Lists all active partner-initiated campaigns for a merchant.
- Get Campaign (Optional) Retrieves details of a specific campaign.
3 — Reward Issuance
This is the core action. When the partner’s platform determines that a user should receive a reward (e.g., a guest left negative feedback, a VIP guest made a purchase), it calls the Issue Rewards endpoint. Rewards are issued by identifying users via email or phone number. Phone numbers must be in E.164 format (e.g.,+12025551234). Up to 10,000 identifiers can be submitted per issuance job.
The endpoint initiates an asynchronous job and returns immediately with a 202 Accepted response containing the issuance job ID. Rewards are processed in the background.
Use the X-Idempotency-Key header to prevent duplicate issuance jobs if the same request is retried.
Endpoints used in this step:
- Issue Rewards Initiates an asynchronous reward issuance job for a given campaign variant.
4 — Monitoring & Completion
After initiating an issuance job, the partner should poll the Get Issuance Job endpoint to track progress. Job states progress as follows:pending → processing → completed or failed.
When the job reaches the completed state, a summary field is included with:
success_count— Number of rewards successfully issuedfailure_count— Number of failed issuancesfailures— Array of failure details includingidentifier_index,identifier_type, anderrormessage
- Get Issuance Job Returns the current status of a reward issuance job.
5 — Revocation (If Needed)
If rewards were issued in error (e.g., fraudulent feedback, incorrect campaign), the partner can revoke all rewards from a given issuance job. Only issuance jobs in acompleted or failed state can be revoked. Jobs that are pending or processing will return a 422 error. Jobs that are already revoking or revoked will also return a 422 error.
Revocation is processed asynchronously. The endpoint returns 202 Accepted and the job transitions to a revoking state while rewards are being revoked in the background.
Endpoints used in this step:
- Revoke Issuance Job Revokes all rewards issued by a given issuance job.
Webhooks (Optional)
Instead of polling with the Get Issuance Job endpoint, partners can subscribe to webhooks for real-time notifications.| Webhook | When It Fires |
|---|---|
| reward.issued | Each time an individual reward is successfully issued to a user during an issuance job. If a batch contains 100 identifiers, up to 100 individual reward.issued webhooks may be sent. |
| reward.batch_completed | Once when an entire issuance job finishes processing. Includes a summary of the batch with total counts and any failures. Fires regardless of whether all rewards succeeded or some failed. |
- Endpoint must be a valid HTTPS URL
- Must respond to POST requests within 15 seconds
- Webhooks are not configured to retry by default — any missed data can be collected via bulk data transfer mechanisms
Rate Limits
Integration partners should not exceed a rate of 5 requests per second and 2,000 requests per 15 minutes. These are hard limits and the API will return429 Too Many Requests once exceeded.
Rate-limited requests can and should be retried. One such strategy is through an exponential backoff approach.
Should your specific integration use-case require higher API throughput, please reach out to developer.support@thanx.com to request an increase.
Certification
Once your integration has been built and developed against the sandbox environment, please reach out to developer.support@thanx.com to go through a lightweight but mandatory certification process. For basic integration use-cases, certification is quick and normally takes no more than a few days depending on the scope of integration. This process is mainly designed to ensure the integration is working as intended without risking any negative impact on live customers (merchant or consumer). Each net new integration use-case should be re-certified as new use-cases will very likely require different scoping. Launching new merchants on certified integration use-cases does not require re-certification. The certification process will start with a video call with members of our developer support team. On the call, your team will demo the integration and all the supported use-cases. After the demo of all supported use-cases, our team will validate the following:Interactions
- Discovery: retrieving merchants and reward templates
- Campaign creation with appropriate variants
- Reward issuance to users by email and/or phone
- Issuance job monitoring (polling or webhook-based)
- Error handling for failed issuances
- Revocation workflow (if applicable)
API
- Requests must include all required headers (
Authorization,X-ClientId,Accept-Version,Content-Type,User-Agent) - Requests must not be unnecessarily duplicated
- Idempotency keys should be used for reward issuance requests
- Error messages should be handled gracefully
- Requests should only be issued at a reasonable frequency (e.g., don’t rapidly poll the API for changes)
Product Capabilities
The following product capabilities must be supported in your campaign and reward issuance integration:Campaign Configuration
Partners must be able to create campaigns with appropriate time windows, terms, and reward variants. Campaigns must reference valid reward templates retrieved from the List Reward Templates endpoint.Reward Issuance
Partners must be able to issue rewards to users by email or phone number via the Issue Rewards endpoint. Partners should handle the asynchronous nature of issuance jobs by either polling the Get Issuance Job endpoint or subscribing to webhooks.Error & Failure Handling
Partners must gracefully handle issuance failures. When an issuance job completes with failures, the partner should surface relevant error information (e.g., invalid email, user not found) and should not silently drop failed issuances.Additional Endpoints to Enhance the Experience
| Endpoint | Purpose |
|---|---|
| Get Merchants | Retrieve the list of merchants accessible to the integration. Use this to populate merchant selection in your platform. |
| Get Locations | Retrieve locations for accessible merchants. Useful if your platform operates at the location level rather than the merchant level. |
| Get Scopes | Verify which API scopes your credentials have access to. Useful for onboarding diagnostics. |
| Get Reward Template | Retrieve details of a specific reward template. Useful for displaying reward information to merchants in your platform. |
| List Campaigns | List all active partner-initiated campaigns for a merchant. Useful for campaign management dashboards. |
| Get Campaign | Retrieve details of a specific campaign. Useful for displaying campaign status and configuration. |
| Revoke Issuance Job | Revoke all rewards from a given issuance job. Useful for error correction and fraud prevention. |