Create Promo Code
Creates a promo code for an account. First-party sessions may attach an affiliate.
Headers
A unique key that makes this request safe to retry. See Idempotent requests.
Request body
Example request
{
"account_id": "biz_xxxxxxxxxxxxxx",
"amount_off": 25,
"base_currency": "usd",
"code": "AFFILIATE25",
"expires_at": "2026-01-01T12:00:00.000Z",
"new_users_only": true,
"one_per_customer": true,
"plan_ids": [
"plan_xxxxxxxxxxxxxx"
],
"product_id": "prod_xxxxxxxxxxxxxx",
"promo_duration_months": 3,
"promo_type": "percentage",
"stock": 200
}Response
promo code created
Example response
{
"account": {
"id": "biz_xxxxxxxxxxxxxx",
"title": "Shine Time Auto Detailing"
},
"amount_off": 0.25,
"code": "affiliate25",
"created_at": "2026-01-01T12:00:00.000Z",
"currency": "usd",
"duration": "repeating",
"expires_at": "2026-01-01T12:00:00.000Z",
"id": "promo_xxxxxxxxxxxxxx",
"metadata": {},
"new_users_only": true,
"one_per_customer": true,
"product": {
"id": "prod_xxxxxxxxxxxxxx",
"title": "Ceramic Coating Package"
},
"promo_duration_months": 3,
"promo_type": "percentage",
"status": "active",
"stock": 200,
"updated_at": "2026-01-01T12:00:00.000Z"
}Changes
Changed in 3 of the 74 revisions of this API.15618
- ○
added the non-success response with the status
response-non-success-status-added
- ○
- ○
added the optional property
/to the response with the statusresponse-optional-property-added
This revision also has 9 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ○
- ▲
added the new required request property
new-required-request-property
- ▲
the request property
became not nullablerequest-property-became-not-nullable
- ▲
the request property
became not nullablerequest-property-became-not-nullable
- ▲
the request property
became not nullablerequest-property-became-not-nullable
- ▲
the request property
became not nullablerequest-property-became-not-nullable
- ▲
the request property
became not nullablerequest-property-became-not-nullable
- ▲
the
request property format changed fromdate-timeto no formatrequest-property-type-changed
- ▲
added
subschema #2to theresponse propertyoneOflist for the response statusresponse-property-one-of-added
- ▲
the
response's property format changed fromdate-timeto no format for statusresponse-property-type-changed
- ▲
the
response's property type changed from no type tostringfor statusresponse-property-type-changed
- ▲
the
response's property format changed fromdate-timeto no format for statusresponse-property-type-changed
- ▲
the
response's property type changed fromobjectnullto no type for statusresponse-property-type-changed
- ▲
removed the required property
from the response with the statusresponse-required-property-removed
- ▲
removed the required property
/from the response with the statusresponse-required-property-removed
- ▲
removed the required property
/from the response with the statusresponse-required-property-removed
- ●
removed the request property
request-property-removed
- ●
removed the optional property
/from the response with the statusresponse-optional-property-removed
- ●
removed the optional property
/from the response with the statusresponse-optional-property-removed
- ●
added the new
foreverenum value to theresponse property for the response statusresponse-property-enum-value-added
- ●
added the new
onceenum value to theresponse property for the response statusresponse-property-enum-value-added
- ●
added the new
repeatingenum value to theresponse property for the response statusresponse-property-enum-value-added
- ○
the security scope
access_pass:basic:readwas removed from the endpoint's security schemebearerAuthapi-security-scope-removed
- ○
api tag
Promo Codesaddedapi-tag-added
- ○
api tag
Promo codesremovedapi-tag-removed
- ○
added the new optional
headerrequest parameterApi-Version-Dateto all path's operationsnew-optional-request-default-parameter-to-existing-path
- ○
added the new optional
headerrequest parameterIdempotency-Keynew-optional-request-parameter
- ○
request body became optional
request-body-became-optional
- ○
removed the non-success response with the status
response-non-success-status-removed
- ○
removed the non-success response with the status
response-non-success-status-removed
- ○
removed the non-success response with the status
response-non-success-status-removed
- ○
removed the non-success response with the status
response-non-success-status-removed
- ○
removed the non-success response with the status
response-non-success-status-removed
- ○
removed the non-success response with the status
response-non-success-status-removed
- ○
removed
subschema #2from theresponse propertyoneOflist for the response statusresponse-property-one-of-removed
- ○
added the required property
to the response with the statusresponse-required-property-added
- ○
added the required property
to the response with the statusresponse-required-property-added
- ○
added the required property
to the response with the statusresponse-required-property-added
This revision also has 16 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ▲
Of the 74 revisions, 1 has no diff computed.