Promo Code
GET/api/v1/promo-codes/batches
Authorization
bearer_token In: header
Query Parameters
Full-text search query applied to batch name and description.
1-indexed page number.
int640 <= valuePage size.
int640 <= valueSort field.
Sort order (asc or desc).
Value in
- "asc"
- "desc"
Additional filter expressions in the form field:operator:value.
Response Body
application/json
curl -X GET "https://example.com/api/v1/promo-codes/batches"{ "batches": [ { "batch_id": "string", "caps": { "global_redemptions": 0, "per_code": 0, "per_referrer": 0, "per_user": 0 }, "claim_type": "single_use", "claim_window": { "ends_at": "2019-08-24T14:15:22Z", "starts_at": "2019-08-24T14:15:22Z" }, "created_at": "2019-08-24T14:15:22Z", "created_by": "string", "description": "string", "geo_fence": { "countries": [ "string" ], "mode": "allow" }, "name": "string", "quarantine_reason": "string", "requested_count": 0, "reward_payload": null, "status": "draft", "stored_value": { "enabled": true, "initial_value": 0, "partial_redemption": true }, "total_redemptions": 0, "updated_at": "2019-08-24T14:15:22Z" } ], "pagination": { "has_more": true, "page": 0, "page_size": 0, "total": 0 }}POST/api/v1/promo-codes/batches
Authorization
bearer_token In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/api/v1/promo-codes/batches" \ -H "Content-Type: application/json" \ -d '{ "count": 0, "name": "string", "reward_payload": null }'{ "batch_id": "string", "progress_url": "string", "requested_count": 0, "status": "draft"}GET/api/v1/promo-codes/batches/{batch_id}
Authorization
bearer_token In: header
Path Parameters
Response Body
application/json
curl -X GET "https://example.com/api/v1/promo-codes/batches/string"{ "batch_id": "string", "caps": { "global_redemptions": 0, "per_code": 0, "per_referrer": 0, "per_user": 0 }, "claim_type": "single_use", "claim_window": { "ends_at": "2019-08-24T14:15:22Z", "starts_at": "2019-08-24T14:15:22Z" }, "created_at": "2019-08-24T14:15:22Z", "created_by": "string", "description": "string", "geo_fence": { "countries": [ "string" ], "mode": "allow" }, "name": "string", "quarantine_reason": "string", "requested_count": 0, "reward_payload": null, "status": "draft", "stored_value": { "enabled": true, "initial_value": 0, "partial_redemption": true }, "total_redemptions": 0, "updated_at": "2019-08-24T14:15:22Z"}POST/api/v1/promo-codes/batches/{batch_id}/archive
Authorization
bearer_token In: header
Path Parameters
Response Body
application/json
curl -X POST "https://example.com/api/v1/promo-codes/batches/string/archive"{ "batch_id": "string", "caps": { "global_redemptions": 0, "per_code": 0, "per_referrer": 0, "per_user": 0 }, "claim_type": "single_use", "claim_window": { "ends_at": "2019-08-24T14:15:22Z", "starts_at": "2019-08-24T14:15:22Z" }, "created_at": "2019-08-24T14:15:22Z", "created_by": "string", "description": "string", "geo_fence": { "countries": [ "string" ], "mode": "allow" }, "name": "string", "quarantine_reason": "string", "requested_count": 0, "reward_payload": null, "status": "draft", "stored_value": { "enabled": true, "initial_value": 0, "partial_redemption": true }, "total_redemptions": 0, "updated_at": "2019-08-24T14:15:22Z"}PATCH/api/v1/promo-codes/batches/{batch_id}/caps
Authorization
bearer_token In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X PATCH "https://example.com/api/v1/promo-codes/batches/string/caps" \ -H "Content-Type: application/json" \ -d '{}'{ "batch_id": "string", "caps": { "global_redemptions": 0, "per_code": 0, "per_referrer": 0, "per_user": 0 }, "claim_type": "single_use", "claim_window": { "ends_at": "2019-08-24T14:15:22Z", "starts_at": "2019-08-24T14:15:22Z" }, "created_at": "2019-08-24T14:15:22Z", "created_by": "string", "description": "string", "geo_fence": { "countries": [ "string" ], "mode": "allow" }, "name": "string", "quarantine_reason": "string", "requested_count": 0, "reward_payload": null, "status": "draft", "stored_value": { "enabled": true, "initial_value": 0, "partial_redemption": true }, "total_redemptions": 0, "updated_at": "2019-08-24T14:15:22Z"}POST/api/v1/promo-codes/batches/{batch_id}/export
Authorization
bearer_token In: header
Path Parameters
Response Body
application/json
curl -X POST "https://example.com/api/v1/promo-codes/batches/string/export"{ "batch_id": "string", "codes": [ { "code_hash": "string", "status": "string" } ], "expires_at": "2019-08-24T14:15:22Z"}POST/api/v1/promo-codes/batches/{batch_id}/quarantine
Authorization
bearer_token In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/api/v1/promo-codes/batches/string/quarantine" \ -H "Content-Type: application/json" \ -d '{ "reason": "string" }'{ "batch_id": "string", "reason": "string", "status": "draft"}GET/api/v1/promo-codes/batches/{batch_id}/redemptions
Authorization
bearer_token In: header
Path Parameters
Query Parameters
1-indexed page number.
int640 <= valuePage size.
int640 <= valueFilter by redemption status.
Filter by claimant id.
Filter by referrer id.
Filter by country code.
Response Body
application/json
curl -X GET "https://example.com/api/v1/promo-codes/batches/string/redemptions"{ "pagination": { "has_more": true, "page": 0, "page_size": 0, "total": 0 }, "redemptions": [ { "amount_redeemed": 0, "batch_id": "string", "campaign_id": "string", "claim_type": "single_use", "claimant_id": "string", "code_hash": "string", "country": "string", "redeemed_at": "2019-08-24T14:15:22Z", "redemption_id": "string", "referrer_id": "string", "status": "rejected" } ]}POST/api/v1/promo-codes/batches/{batch_id}/resume
Authorization
bearer_token In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/api/v1/promo-codes/batches/string/resume" \ -H "Content-Type: application/json" \ -d '{}'{ "batch_id": "string", "caps": { "global_redemptions": 0, "per_code": 0, "per_referrer": 0, "per_user": 0 }, "claim_type": "single_use", "claim_window": { "ends_at": "2019-08-24T14:15:22Z", "starts_at": "2019-08-24T14:15:22Z" }, "created_at": "2019-08-24T14:15:22Z", "created_by": "string", "description": "string", "geo_fence": { "countries": [ "string" ], "mode": "allow" }, "name": "string", "quarantine_reason": "string", "requested_count": 0, "reward_payload": null, "status": "draft", "stored_value": { "enabled": true, "initial_value": 0, "partial_redemption": true }, "total_redemptions": 0, "updated_at": "2019-08-24T14:15:22Z"}POST/api/v1/promo-codes/lock
Authorization
bearer_token In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/api/v1/promo-codes/lock" \ -H "Content-Type: application/json" \ -d '{ "code": "string", "ttl_seconds": 0 }'{ "commit_token": "string", "expires_at": "2019-08-24T14:15:22Z", "lock_id": "string", "status": "rejected"}POST/api/v1/promo-codes/locks/{lock_id}/commit
Authorization
bearer_token In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/api/v1/promo-codes/locks/string/commit" \ -H "Content-Type: application/json" \ -d '{ "commit_token": "string" }'{ "lock_id": "string", "redemption_id": "string", "reward_payload": null, "status": "rejected"}POST/api/v1/promo-codes/locks/{lock_id}/release
Authorization
bearer_token In: header
Path Parameters
Response Body
application/json
curl -X POST "https://example.com/api/v1/promo-codes/locks/string/release"{ "lock_id": "string", "status": "rejected"}POST/api/v1/promo-codes/redeem
Authorization
bearer_token In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/api/v1/promo-codes/redeem" \ -H "Content-Type: application/json" \ -d '{ "code": "string" }'{ "redemption_id": "string", "remaining_value": 0, "reward_payload": null, "status": "rejected"}POST/api/v1/promo-codes/stored-value/redeem
Authorization
bearer_token In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/api/v1/promo-codes/stored-value/redeem" \ -H "Content-Type: application/json" \ -d '{ "amount": 0, "code": "string" }'{ "redemption_id": "string", "remaining_value": 0, "reward_payload": null, "status": "rejected"}