Promo Code
GET/api/v1/promo-codes/batches
Authorization
bearer_token In: header
Query Parameters
Conditions as filter[][]=. Conditions on different fields all apply. in (any of) and all (every one of, on fields holding several values) take a comma-separated list (\, for a literal comma). exists takes true or false. Datetimes are RFC 3339, now, or a time before now such as -30m, -6h or -7d.
Full-text search over this list's searchable fields.
1 <= length <= 200Comma-separated sort keys, - for descending, at most 1. Keys: name, requested_count, updated_at, created_at. Default: -created_at.
Rows per page, 1 to 100 (default 25).
1 <= value <= 100The page.next_cursor of the previous page. Cannot be combined with page.
A 1-based page number, for jumping. Cannot be combined with cursor.
1 <= valueSet to true to include the number of matching rows in page.total.
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" } ], "page": { "has_more": true, "next_cursor": "string", "page": 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
Conditions as filter[][]=. Conditions on different fields all apply. in (any of) and all (every one of, on fields holding several values) take a comma-separated list (\, for a literal comma). exists takes true or false. Datetimes are RFC 3339, now, or a time before now such as -30m, -6h or -7d.
Comma-separated sort keys, - for descending, at most 1. Keys: redeemed_at. Default: -redeemed_at.
Rows per page, 1 to 100 (default 25).
1 <= value <= 100The page.next_cursor of the previous page. Cannot be combined with page.
A 1-based page number, for jumping. Cannot be combined with cursor.
1 <= valueSet to true to include the number of matching rows in page.total.
Response Body
application/json
curl -X GET "https://example.com/api/v1/promo-codes/batches/string/redemptions"{ "page": { "has_more": true, "next_cursor": "string", "page": 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"}