Dashboard
APIClone Coupon API - Duplicate a Discount Code | BotSubscription
api.botsubscription.com
GET/v1/endpoint
AuthenticationBearer
Token
Stays in this tab. Required for this endpoint — the value below is what gets sent.
Examples
curl --request GET \
  --url https://api.botsubscription.com/v1/endpoint \
  --header 'Authorization: Bearer sk_live_•••'

Clone Coupon - Duplicate a Discount Code via API

Create a new coupon from an existing one. Every field on the source coupon is copied over; any field you supply in the request body overrides the corresponding value on the new coupon.

Source amounts in exponent notation are converted to plain decimal strings when their value can be preserved exactly. The clone must satisfy the coupon creation rules, including exact percentage bounds and decimal precision. A source coupon that can be read may require overrides to produce a valid clone. Invalid clones return 422 VALIDATION_ERROR instead of rounding their values.

POST/v2/projects/{project_id}/coupons/{coupon_id}/clone

Authorization

Bearer API KeyRequired

API key access: Unrestricted project API key required. Restricted keys cannot call this endpoint.

If the source coupon is archived and the request body does not set status, the new coupon is created archived as well.

Omitted starts_at and ends_at overrides inherit the source bounds. Explicit null clears a bound.

Path Parameters

project_idstringrequired

The unique identifier of the project.

coupon_idstringrequired

The unique identifier of the source coupon to clone.

Request Body

display_namestring

Name for the new coupon. Defaults to the source coupon's name.

codestring

Code for the new coupon. Defaults to the source coupon's code—if it collides with an active coupon, the codes share the same usage limit and redemption counter.

descriptionstring

Overrides the source coupon's description.

percentagestring|number|null

Overrides the percentage with a value strictly greater than 0 and at most 100. Prefer an exact decimal string.

amountstring|number|null

Overrides the source coupon's flat discount amount.

currencystring

Overrides the source coupon's currency.

min_spend_amountstring | number | null

Override the inclusive minimum checkout amount using an unsigned decimal string or nonnegative number. Null removes the minimum bound.

min_spend_currencystring | null

Minimum-spend currency override: 3 to 9 uppercase ASCII letters or digits.

max_spend_amountstring | number | null

Override the inclusive maximum checkout amount using an unsigned decimal string or nonnegative number. Null removes the maximum bound.

max_spend_currencystring | null

Maximum-spend currency override: 3 to 9 uppercase ASCII letters or digits.

usage_limitinteger

Overrides the source coupon's usage limit.

starts_atnumber | string | null

Override the start with 13-digit Unix milliseconds as a number or digit string. Send null for no bound. ISO dates and seconds are not accepted.

ends_atnumber | string | null

Override the end with 13-digit Unix milliseconds as a number or digit string. Send null for no bound. ISO dates and seconds are not accepted.

metadataobject

Overrides the source coupon's metadata.

Numeric coupon values follow the decimal input contract. A nullable value may be cleared only when the resulting coupon still satisfies its type requirements.

Omitted spend overrides inherit the source configuration. The resulting coupon is checked against the creation rules, including required currencies, matching minimum/maximum currencies and an ordered, inclusive spend range.

Note

Response examples use the UTC ISO date format.

Last updated: