{ "error": { "code": "UNPROCESSABLE_ENTITY", "message": "static_code and code_count are mutually exclusive" }}
Scope required: promos.write
This endpoint creates a new promotion for the specified merchant. It mirrors
the functionality available in the Thanx dashboard: it creates the promotion’s
underlying program and redeem configuration, and — depending on how codes are
requested — its initial code pool.For the full lifecycle — creating a promotion, generating codes, dispensing
them to customers, and replenishing — see the
Promotions Overview.
Code Pools
How you supply codes at creation determines the pool that is created:
static_code — creates a multi_use pool containing a single shared
code that can be redeemed multiple times (a “universal” code). The pool is
marked complete immediately.
code_count — creates a single_use pool and enqueues asynchronous
generation of that many unique one-time codes. Poll
Get Promotion until
code_generation_status is complete, then fetch the codes with
List Promotion Codes. Additional
single-use codes can later be generated with
Generate Promotion Codes.
Neither — the promotion is created without any codes.
static_code and code_count are mutually exclusive.
Parameters
string
required
Merchant ID
string
required
Promotion name
string
required
Type of discount: amount, percent, or item
number
required
Discount amount. Interpreted according to discount_type (for example, a
percentage for percent or a currency amount for amount).
number
Minimum spend required to redeem
number
Maximum discount that can be applied (where supported by the discount type)
string
Terms and conditions
string
Redemption instructions shown to the customer
string
Where the promotion can be redeemed: all, instore, or online.
Defaults to instore.
datetime
When the promotion becomes active (ISO8601)
datetime
When the promotion ends (ISO8601). Must be after starts_at.
string
A single shared code to create as a multi_use pool. Mutually exclusive
with code_count.
integer
Number of unique one-time codes to generate as a single_use pool
(1–4,000,000). Generation runs asynchronously. Mutually exclusive with
static_code.
string
Initial state: active or draft. Defaults to active. Draft promotions
are managed in the Thanx dashboard — the read endpoints
(List Promotions,
Get Promotion) return only active
promotions.
hash
Optional day-of-week and time-of-day restrictions on when the promotion can
be redeemed. Write-only: these are applied at creation and viewed or edited
in the Thanx dashboard; they are not returned by the read endpoints.
Show redemption_restrictions
boolean
Whether time-based restrictions are enforced
string
Time zone the restriction hours are evaluated in (IANA name, e.g.
America/Los_Angeles)
array
Hours (0–23) the promotion is redeemable on Monday. Repeat for
tuesday through sunday.
array
Restrict redemption to specific location IDs
Response
Returns 201 Created with the newly created promotion. The response uses the
same shape as Get Promotion.
string
Promotion ID
string
Promotion name
string
Promotion state (active or draft)
string
Type of discount the promotion applies: percent, item, or amount
string
Discount amount, as a string. Null if not set.
string
Minimum spend required to redeem, as a string. Null if not set.
string
Maximum discount that can be applied, as a string. Null if not set.
string
Terms and conditions
string
Where the promotion can be redeemed
datetime
Promotion start timestamp (ISO8601). Null if not set.
datetime
Promotion end timestamp (ISO8601). Null if not set.
string
How the pool’s codes are generated: multi_use or single_use. Null if no
pool was created.
integer
Number of times codes in the active pool have been redeemed
integer
Total number of codes in the active pool
string
Status of asynchronous code generation for the active pool: none (no codes
requested), in_progress, complete, or failed
{ "error": { "code": "UNPROCESSABLE_ENTITY", "message": "static_code and code_count are mutually exclusive" }}
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Thanx","public":true,"colors":{"primary":"#129B9B","light":"#13C1BF","dark":"#129B9B"},"logo":{"light":"https://mintcdn.com/thanx/NEzLP0j6kJjm2liR/logo/light.svg?fit=max\u0026auto=format\u0026n=NEzLP0j6kJjm2liR\u0026q=85\u0026s=8b3bd3f1ffbb1567714a92067df956d9","dark":"https://mintcdn.com/thanx/NEzLP0j6kJjm2liR/logo/dark.svg?fit=max\u0026auto=format\u0026n=NEzLP0j6kJjm2liR\u0026q=85\u0026s=9b7fc286cc5789385ace66cf725d131f"},"favicon":"https://mintcdn.com/thanx/slNzKdUXQiByOc6X/favicon.png?fit=max\u0026auto=format\u0026n=slNzKdUXQiByOc6X\u0026q=85\u0026s=bc7fda50982b59fe2dd5384ca7bd2961","api":{},"styling":{"latex":true},"navigation":{"global":{"anchors":[{"anchor":"Help Center","icon":"book-bookmark","href":"https://help.thanx.com/hc/en-us"},{"anchor":"Thanx Product Updates","icon":"bullhorn","href":"https://thanx.launchnotes.io/"},{"anchor":"Status","icon":"wave-pulse","href":"https://status.thanx.com"},{"anchor":"Email Support","icon":"envelope","href":"mailto:developer.support@thanx.com"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"thanx","hasAudioNarration":false,"actualSubdomain":"thanx","customDomains":["docs.thanx.com"],"gitSource":{"type":"github","owner":"thanx","repo":"thanx-docs","deployBranch":"master","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6af11284249fd597dc8afa00","clientVersion":"0.0.4131","searchFilterCounts":[{"language":"default","tag":"Reference","count":96},{"language":"default","tag":"Consumer API","count":87},{"language":"default","tag":"Data Exports","count":40},{"language":"default","tag":"Partner API","count":30},{"language":"default","tag":"Thanx Connex","count":24},{"language":"default","tag":"Destination Setup","count":23},{"language":"default","tag":"Overview","count":22},{"language":"default","tag":"Models","count":11},{"language":"default","tag":"Loyalty API","count":11},{"language":"default","tag":"Users","count":8}]},"assistantConfig":{},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"partner/promotions/create-promotion","slug":"/partner/promotions/create-promotion","pageMetadata":{"title":"Create Promotion","description":"Create a new promotion for a merchant","api":"POST /partner/promotions","href":"/partner/promotions/create-promotion"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Create a new promotion for a merchant\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{Expandable,Heading,Info,ParamField,ResponseField}=_components;if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);return _jsxs(_Fragment,{children:[_jsx(Info,{children:_jsxs(_components.p,{children:[`Scope required: `,_jsx(_components.code,{children:`promos.write`})]})}),`\n`,_jsx(_components.p,{children:`This endpoint creates a new promotion for the specified merchant. It mirrors\nthe functionality available in the Thanx dashboard: it creates the promotion’s\nunderlying program and redeem configuration, and — depending on how codes are\nrequested — its initial code pool.`}),`\n`,_jsxs(_components.p,{children:[`For the full lifecycle — creating a promotion, generating codes, dispensing\nthem to customers, and replenishing — see the\n`,_jsx(_components.a,{href:`/partner/promotions/overview`,children:`Promotions Overview`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`code-pools`,children:`Code Pools`}),`\n`,_jsx(_components.p,{children:`How you supply codes at creation determines the pool that is created:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`static_code`})}),` — creates a `,_jsx(_components.code,{children:`multi_use`}),` pool containing a single shared\ncode that can be redeemed multiple times (a “universal” code). The pool is\nmarked complete immediately.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`code_count`})}),` — creates a `,_jsx(_components.code,{children:`single_use`}),` pool and enqueues asynchronous\ngeneration of that many unique one-time codes. Poll\n`,_jsx(_components.a,{href:`/partner/promotions/get-promotion`,children:`Get Promotion`}),` until\n`,_jsx(_components.code,{children:`code_generation_status`}),` is `,_jsx(_components.code,{children:`complete`}),`, then fetch the codes with\n`,_jsx(_components.a,{href:`/partner/promotions/list-codes`,children:`List Promotion Codes`}),`. Additional\nsingle-use codes can later be generated with\n`,_jsx(_components.a,{href:`/partner/promotions/generate-codes`,children:`Generate Promotion Codes`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Neither`}),` — the promotion is created without any codes.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`static_code`}),` and `,_jsx(_components.code,{children:`code_count`}),` are mutually exclusive.`]}),`\n`,_jsx(Heading,{level:`3`,id:`parameters`,children:`Parameters`}),`\n`,_jsx(ParamField,{body:`merchant_id`,type:`string`,required:true,id:`param-merchant-id`,children:_jsx(_components.p,{children:`Merchant ID`})}),`\n`,_jsx(ParamField,{body:`name`,type:`string`,required:true,id:`param-name`,children:_jsx(_components.p,{children:`Promotion name`})}),`\n`,_jsx(ParamField,{body:`discount_type`,type:`string`,required:true,id:`param-discount-type`,children:_jsxs(_components.p,{children:[`Type of discount: `,_jsx(_components.code,{children:`amount`}),`, `,_jsx(_components.code,{children:`percent`}),`, or `,_jsx(_components.code,{children:`item`})]})}),`\n`,_jsx(ParamField,{body:`discount_value`,type:`number`,required:true,id:`param-discount-value`,children:_jsxs(_components.p,{children:[`Discount amount. Interpreted according to `,_jsx(_components.code,{children:`discount_type`}),` (for example, a\npercentage for `,_jsx(_components.code,{children:`percent`}),` or a currency amount for `,_jsx(_components.code,{children:`amount`}),`).`]})}),`\n`,_jsx(ParamField,{body:`minimum_spend`,type:`number`,id:`param-minimum-spend`,children:_jsx(_components.p,{children:`Minimum spend required to redeem`})}),`\n`,_jsx(ParamField,{body:`maximum_discount`,type:`number`,id:`param-maximum-discount`,children:_jsx(_components.p,{children:`Maximum discount that can be applied (where supported by the discount type)`})}),`\n`,_jsx(ParamField,{body:`fine_print`,type:`string`,id:`param-fine-print`,children:_jsx(_components.p,{children:`Terms and conditions`})}),`\n`,_jsx(ParamField,{body:`instructions`,type:`string`,id:`param-instructions`,children:_jsx(_components.p,{children:`Redemption instructions shown to the customer`})}),`\n`,_jsx(ParamField,{body:`redemption_venue`,type:`string`,id:`param-redemption-venue`,children:_jsxs(_components.p,{children:[`Where the promotion can be redeemed: `,_jsx(_components.code,{children:`all`}),`, `,_jsx(_components.code,{children:`instore`}),`, or `,_jsx(_components.code,{children:`online`}),`.\nDefaults to `,_jsx(_components.code,{children:`instore`}),`.`]})}),`\n`,_jsx(ParamField,{body:`starts_at`,type:`datetime`,id:`param-starts-at`,children:_jsx(_components.p,{children:`When the promotion becomes active (ISO8601)`})}),`\n`,_jsx(ParamField,{body:`ends_at`,type:`datetime`,id:`param-ends-at`,children:_jsxs(_components.p,{children:[`When the promotion ends (ISO8601). Must be after `,_jsx(_components.code,{children:`starts_at`}),`.`]})}),`\n`,_jsx(ParamField,{body:`static_code`,type:`string`,id:`param-static-code`,children:_jsxs(_components.p,{children:[`A single shared code to create as a `,_jsx(_components.code,{children:`multi_use`}),` pool. Mutually exclusive\nwith `,_jsx(_components.code,{children:`code_count`}),`.`]})}),`\n`,_jsx(ParamField,{body:`code_count`,type:`integer`,id:`param-code-count`,children:_jsxs(_components.p,{children:[`Number of unique one-time codes to generate as a `,_jsx(_components.code,{children:`single_use`}),` pool\n(1–4,000,000). Generation runs asynchronously. Mutually exclusive with\n`,_jsx(_components.code,{children:`static_code`}),`.`]})}),`\n`,_jsx(ParamField,{body:`state`,type:`string`,id:`param-state`,children:_jsxs(_components.p,{children:[`Initial state: `,_jsx(_components.code,{children:`active`}),` or `,_jsx(_components.code,{children:`draft`}),`. Defaults to `,_jsx(_components.code,{children:`active`}),`. Draft promotions\nare managed in the Thanx dashboard — the read endpoints\n(`,_jsx(_components.a,{href:`/partner/promotions/list-promotions`,children:`List Promotions`}),`,\n`,_jsx(_components.a,{href:`/partner/promotions/get-promotion`,children:`Get Promotion`}),`) return only `,_jsx(_components.code,{children:`active`}),`\npromotions.`]})}),`\n`,_jsxs(ParamField,{body:`redemption_restrictions`,type:`hash`,id:`param-redemption-restrictions`,children:[_jsx(_components.p,{children:`Optional day-of-week and time-of-day restrictions on when the promotion can\nbe redeemed. Write-only: these are applied at creation and viewed or edited\nin the Thanx dashboard; they are not returned by the read endpoints.`}),_jsxs(Expandable,{title:`redemption_restrictions`,children:[_jsx(ParamField,{body:`enabled`,type:`boolean`,id:`param-enabled`,children:_jsx(_components.p,{children:`Whether time-based restrictions are enforced`})}),_jsx(ParamField,{body:`time_zone`,type:`string`,id:`param-time-zone`,children:_jsxs(_components.p,{children:[`Time zone the restriction hours are evaluated in (IANA name, e.g.\n`,_jsx(_components.code,{children:`America/Los_Angeles`}),`)`]})}),_jsx(ParamField,{body:`monday`,type:`array`,id:`param-monday`,children:_jsxs(_components.p,{children:[`Hours (0–23) the promotion is redeemable on Monday. Repeat for\n`,_jsx(_components.code,{children:`tuesday`}),` through `,_jsx(_components.code,{children:`sunday`}),`.`]})}),_jsx(ParamField,{body:`location_ids`,type:`array`,id:`param-location-ids`,children:_jsx(_components.p,{children:`Restrict redemption to specific location IDs`})})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`response`,children:`Response`}),`\n`,_jsxs(_components.p,{children:[`Returns `,_jsx(_components.code,{children:`201 Created`}),` with the newly created promotion. The response uses the\nsame shape as `,_jsx(_components.a,{href:`/partner/promotions/get-promotion`,children:`Get Promotion`}),`.`]}),`\n`,_jsx(ResponseField,{name:`id`,type:`string`,id:`param-id`,children:_jsx(_components.p,{children:`Promotion ID`})}),`\n`,_jsx(ResponseField,{name:`name`,type:`string`,id:`param-name-1`,children:_jsx(_components.p,{children:`Promotion name`})}),`\n`,_jsx(ResponseField,{name:`state`,type:`string`,id:`param-state-1`,children:_jsxs(_components.p,{children:[`Promotion state (`,_jsx(_components.code,{children:`active`}),` or `,_jsx(_components.code,{children:`draft`}),`)`]})}),`\n`,_jsx(ResponseField,{name:`discount_type`,type:`string`,id:`param-discount-type-1`,children:_jsxs(_components.p,{children:[`Type of discount the promotion applies: `,_jsx(_components.code,{children:`percent`}),`, `,_jsx(_components.code,{children:`item`}),`, or `,_jsx(_components.code,{children:`amount`})]})}),`\n`,_jsx(ResponseField,{name:`discount_value`,type:`string`,id:`param-discount-value-1`,children:_jsx(_components.p,{children:`Discount amount, as a string. Null if not set.`})}),`\n`,_jsx(ResponseField,{name:`minimum_spend`,type:`string`,id:`param-minimum-spend-1`,children:_jsx(_components.p,{children:`Minimum spend required to redeem, as a string. Null if not set.`})}),`\n`,_jsx(ResponseField,{name:`maximum_discount`,type:`string`,id:`param-maximum-discount-1`,children:_jsx(_components.p,{children:`Maximum discount that can be applied, as a string. Null if not set.`})}),`\n`,_jsx(ResponseField,{name:`fine_print`,type:`string`,id:`param-fine-print-1`,children:_jsx(_components.p,{children:`Terms and conditions`})}),`\n`,_jsx(ResponseField,{name:`redemption_venue`,type:`string`,id:`param-redemption-venue-1`,children:_jsx(_components.p,{children:`Where the promotion can be redeemed`})}),`\n`,_jsx(ResponseField,{name:`starts_at`,type:`datetime`,id:`param-starts-at-1`,children:_jsx(_components.p,{children:`Promotion start timestamp (ISO8601). Null if not set.`})}),`\n`,_jsx(ResponseField,{name:`ends_at`,type:`datetime`,id:`param-ends-at-1`,children:_jsx(_components.p,{children:`Promotion end timestamp (ISO8601). Null if not set.`})}),`\n`,_jsx(ResponseField,{name:`generation_type`,type:`string`,id:`param-generation-type`,children:_jsxs(_components.p,{children:[`How the pool’s codes are generated: `,_jsx(_components.code,{children:`multi_use`}),` or `,_jsx(_components.code,{children:`single_use`}),`. Null if no\npool was created.`]})}),`\n`,_jsx(ResponseField,{name:`redemption_count`,type:`integer`,id:`param-redemption-count`,children:_jsx(_components.p,{children:`Number of times codes in the active pool have been redeemed`})}),`\n`,_jsx(ResponseField,{name:`total_codes`,type:`integer`,id:`param-total-codes`,children:_jsx(_components.p,{children:`Total number of codes in the active pool`})}),`\n`,_jsx(ResponseField,{name:`code_generation_status`,type:`string`,id:`param-code-generation-status`,children:_jsxs(_components.p,{children:[`Status of asynchronous code generation for the active pool: `,_jsx(_components.code,{children:`none`}),` (no codes\nrequested), `,_jsx(_components.code,{children:`in_progress`}),`, `,_jsx(_components.code,{children:`complete`}),`, or `,_jsx(_components.code,{children:`failed`})]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Create Promotion","description":"Create a new promotion for a merchant","api":"POST /partner/promotions","href":"/partner/promotions/create-promotion"}}},"mdxSourceWithNoJs":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Expandable,Heading,Info,ParamField,RequestExample,ResponseExample,ResponseField}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!RequestExample)_missingMdxReference(`RequestExample`,true);if(!ResponseExample)_missingMdxReference(`ResponseExample`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);return _jsxs(_Fragment,{children:[_jsx(Info,{children:_jsxs(_components.p,{children:[`Scope required: `,_jsx(_components.code,{children:`promos.write`})]})}),`\n`,_jsx(_components.p,{children:`This endpoint creates a new promotion for the specified merchant. It mirrors\nthe functionality available in the Thanx dashboard: it creates the promotion’s\nunderlying program and redeem configuration, and — depending on how codes are\nrequested — its initial code pool.`}),`\n`,_jsxs(_components.p,{children:[`For the full lifecycle — creating a promotion, generating codes, dispensing\nthem to customers, and replenishing — see the\n`,_jsx(_components.a,{href:`/partner/promotions/overview`,children:`Promotions Overview`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`code-pools`,children:`Code Pools`}),`\n`,_jsx(_components.p,{children:`How you supply codes at creation determines the pool that is created:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`static_code`})}),` — creates a `,_jsx(_components.code,{children:`multi_use`}),` pool containing a single shared\ncode that can be redeemed multiple times (a “universal” code). The pool is\nmarked complete immediately.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`code_count`})}),` — creates a `,_jsx(_components.code,{children:`single_use`}),` pool and enqueues asynchronous\ngeneration of that many unique one-time codes. Poll\n`,_jsx(_components.a,{href:`/partner/promotions/get-promotion`,children:`Get Promotion`}),` until\n`,_jsx(_components.code,{children:`code_generation_status`}),` is `,_jsx(_components.code,{children:`complete`}),`, then fetch the codes with\n`,_jsx(_components.a,{href:`/partner/promotions/list-codes`,children:`List Promotion Codes`}),`. Additional\nsingle-use codes can later be generated with\n`,_jsx(_components.a,{href:`/partner/promotions/generate-codes`,children:`Generate Promotion Codes`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Neither`}),` — the promotion is created without any codes.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`static_code`}),` and `,_jsx(_components.code,{children:`code_count`}),` are mutually exclusive.`]}),`\n`,_jsx(Heading,{level:`3`,id:`parameters`,children:`Parameters`}),`\n`,_jsx(ParamField,{body:`merchant_id`,type:`string`,required:true,id:`param-merchant-id`,children:_jsx(_components.p,{children:`Merchant ID`})}),`\n`,_jsx(ParamField,{body:`name`,type:`string`,required:true,id:`param-name`,children:_jsx(_components.p,{children:`Promotion name`})}),`\n`,_jsx(ParamField,{body:`discount_type`,type:`string`,required:true,id:`param-discount-type`,children:_jsxs(_components.p,{children:[`Type of discount: `,_jsx(_components.code,{children:`amount`}),`, `,_jsx(_components.code,{children:`percent`}),`, or `,_jsx(_components.code,{children:`item`})]})}),`\n`,_jsx(ParamField,{body:`discount_value`,type:`number`,required:true,id:`param-discount-value`,children:_jsxs(_components.p,{children:[`Discount amount. Interpreted according to `,_jsx(_components.code,{children:`discount_type`}),` (for example, a\npercentage for `,_jsx(_components.code,{children:`percent`}),` or a currency amount for `,_jsx(_components.code,{children:`amount`}),`).`]})}),`\n`,_jsx(ParamField,{body:`minimum_spend`,type:`number`,id:`param-minimum-spend`,children:_jsx(_components.p,{children:`Minimum spend required to redeem`})}),`\n`,_jsx(ParamField,{body:`maximum_discount`,type:`number`,id:`param-maximum-discount`,children:_jsx(_components.p,{children:`Maximum discount that can be applied (where supported by the discount type)`})}),`\n`,_jsx(ParamField,{body:`fine_print`,type:`string`,id:`param-fine-print`,children:_jsx(_components.p,{children:`Terms and conditions`})}),`\n`,_jsx(ParamField,{body:`instructions`,type:`string`,id:`param-instructions`,children:_jsx(_components.p,{children:`Redemption instructions shown to the customer`})}),`\n`,_jsx(ParamField,{body:`redemption_venue`,type:`string`,id:`param-redemption-venue`,children:_jsxs(_components.p,{children:[`Where the promotion can be redeemed: `,_jsx(_components.code,{children:`all`}),`, `,_jsx(_components.code,{children:`instore`}),`, or `,_jsx(_components.code,{children:`online`}),`.\nDefaults to `,_jsx(_components.code,{children:`instore`}),`.`]})}),`\n`,_jsx(ParamField,{body:`starts_at`,type:`datetime`,id:`param-starts-at`,children:_jsx(_components.p,{children:`When the promotion becomes active (ISO8601)`})}),`\n`,_jsx(ParamField,{body:`ends_at`,type:`datetime`,id:`param-ends-at`,children:_jsxs(_components.p,{children:[`When the promotion ends (ISO8601). Must be after `,_jsx(_components.code,{children:`starts_at`}),`.`]})}),`\n`,_jsx(ParamField,{body:`static_code`,type:`string`,id:`param-static-code`,children:_jsxs(_components.p,{children:[`A single shared code to create as a `,_jsx(_components.code,{children:`multi_use`}),` pool. Mutually exclusive\nwith `,_jsx(_components.code,{children:`code_count`}),`.`]})}),`\n`,_jsx(ParamField,{body:`code_count`,type:`integer`,id:`param-code-count`,children:_jsxs(_components.p,{children:[`Number of unique one-time codes to generate as a `,_jsx(_components.code,{children:`single_use`}),` pool\n(1–4,000,000). Generation runs asynchronously. Mutually exclusive with\n`,_jsx(_components.code,{children:`static_code`}),`.`]})}),`\n`,_jsx(ParamField,{body:`state`,type:`string`,id:`param-state`,children:_jsxs(_components.p,{children:[`Initial state: `,_jsx(_components.code,{children:`active`}),` or `,_jsx(_components.code,{children:`draft`}),`. Defaults to `,_jsx(_components.code,{children:`active`}),`. Draft promotions\nare managed in the Thanx dashboard — the read endpoints\n(`,_jsx(_components.a,{href:`/partner/promotions/list-promotions`,children:`List Promotions`}),`,\n`,_jsx(_components.a,{href:`/partner/promotions/get-promotion`,children:`Get Promotion`}),`) return only `,_jsx(_components.code,{children:`active`}),`\npromotions.`]})}),`\n`,_jsxs(ParamField,{body:`redemption_restrictions`,type:`hash`,id:`param-redemption-restrictions`,children:[_jsx(_components.p,{children:`Optional day-of-week and time-of-day restrictions on when the promotion can\nbe redeemed. Write-only: these are applied at creation and viewed or edited\nin the Thanx dashboard; they are not returned by the read endpoints.`}),_jsxs(Expandable,{title:`redemption_restrictions`,children:[_jsx(ParamField,{body:`enabled`,type:`boolean`,id:`param-enabled`,children:_jsx(_components.p,{children:`Whether time-based restrictions are enforced`})}),_jsx(ParamField,{body:`time_zone`,type:`string`,id:`param-time-zone`,children:_jsxs(_components.p,{children:[`Time zone the restriction hours are evaluated in (IANA name, e.g.\n`,_jsx(_components.code,{children:`America/Los_Angeles`}),`)`]})}),_jsx(ParamField,{body:`monday`,type:`array`,id:`param-monday`,children:_jsxs(_components.p,{children:[`Hours (0–23) the promotion is redeemable on Monday. Repeat for\n`,_jsx(_components.code,{children:`tuesday`}),` through `,_jsx(_components.code,{children:`sunday`}),`.`]})}),_jsx(ParamField,{body:`location_ids`,type:`array`,id:`param-location-ids`,children:_jsx(_components.p,{children:`Restrict redemption to specific location IDs`})})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`response`,children:`Response`}),`\n`,_jsxs(_components.p,{children:[`Returns `,_jsx(_components.code,{children:`201 Created`}),` with the newly created promotion. The response uses the\nsame shape as `,_jsx(_components.a,{href:`/partner/promotions/get-promotion`,children:`Get Promotion`}),`.`]}),`\n`,_jsx(ResponseField,{name:`id`,type:`string`,id:`param-id`,children:_jsx(_components.p,{children:`Promotion ID`})}),`\n`,_jsx(ResponseField,{name:`name`,type:`string`,id:`param-name-1`,children:_jsx(_components.p,{children:`Promotion name`})}),`\n`,_jsx(ResponseField,{name:`state`,type:`string`,id:`param-state-1`,children:_jsxs(_components.p,{children:[`Promotion state (`,_jsx(_components.code,{children:`active`}),` or `,_jsx(_components.code,{children:`draft`}),`)`]})}),`\n`,_jsx(ResponseField,{name:`discount_type`,type:`string`,id:`param-discount-type-1`,children:_jsxs(_components.p,{children:[`Type of discount the promotion applies: `,_jsx(_components.code,{children:`percent`}),`, `,_jsx(_components.code,{children:`item`}),`, or `,_jsx(_components.code,{children:`amount`})]})}),`\n`,_jsx(ResponseField,{name:`discount_value`,type:`string`,id:`param-discount-value-1`,children:_jsx(_components.p,{children:`Discount amount, as a string. Null if not set.`})}),`\n`,_jsx(ResponseField,{name:`minimum_spend`,type:`string`,id:`param-minimum-spend-1`,children:_jsx(_components.p,{children:`Minimum spend required to redeem, as a string. Null if not set.`})}),`\n`,_jsx(ResponseField,{name:`maximum_discount`,type:`string`,id:`param-maximum-discount-1`,children:_jsx(_components.p,{children:`Maximum discount that can be applied, as a string. Null if not set.`})}),`\n`,_jsx(ResponseField,{name:`fine_print`,type:`string`,id:`param-fine-print-1`,children:_jsx(_components.p,{children:`Terms and conditions`})}),`\n`,_jsx(ResponseField,{name:`redemption_venue`,type:`string`,id:`param-redemption-venue-1`,children:_jsx(_components.p,{children:`Where the promotion can be redeemed`})}),`\n`,_jsx(ResponseField,{name:`starts_at`,type:`datetime`,id:`param-starts-at-1`,children:_jsx(_components.p,{children:`Promotion start timestamp (ISO8601). Null if not set.`})}),`\n`,_jsx(ResponseField,{name:`ends_at`,type:`datetime`,id:`param-ends-at-1`,children:_jsx(_components.p,{children:`Promotion end timestamp (ISO8601). Null if not set.`})}),`\n`,_jsx(ResponseField,{name:`generation_type`,type:`string`,id:`param-generation-type`,children:_jsxs(_components.p,{children:[`How the pool’s codes are generated: `,_jsx(_components.code,{children:`multi_use`}),` or `,_jsx(_components.code,{children:`single_use`}),`. Null if no\npool was created.`]})}),`\n`,_jsx(ResponseField,{name:`redemption_count`,type:`integer`,id:`param-redemption-count`,children:_jsx(_components.p,{children:`Number of times codes in the active pool have been redeemed`})}),`\n`,_jsx(ResponseField,{name:`total_codes`,type:`integer`,id:`param-total-codes`,children:_jsx(_components.p,{children:`Total number of codes in the active pool`})}),`\n`,_jsx(ResponseField,{name:`code_generation_status`,type:`string`,id:`param-code-generation-status`,children:_jsxs(_components.p,{children:[`Status of asynchronous code generation for the active pool: `,_jsx(_components.code,{children:`none`}),` (no codes\nrequested), `,_jsx(_components.code,{children:`in_progress`}),`, `,_jsx(_components.code,{children:`complete`}),`, or `,_jsx(_components.code,{children:`failed`})]})}),`\n`,_jsxs(RequestExample,{children:[_jsx(CodeBlock,{filename:`Create Promotion (single-use codes)`,numberOfLines:`18`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`18`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.thanxsandbox.com/partner/promotions`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'X-ClientId: {client_id}'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Accept-Version: v4.0'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type: application/json'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization: Bearer {access_token}'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"merchant_id\": \"k2lye10h32l5wzo\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"name\": \"Summer 20% Off\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"discount_type\": \"percent\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"discount_value\": 20,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"minimum_spend\": 25,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"fine_print\": \"Limit one per customer\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"redemption_venue\": \"online\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"starts_at\": \"2026-06-01T00:00:00Z\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"ends_at\": \"2026-08-31T23:59:59Z\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"code_count\": 10000`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Create Promotion (universal shared code)`,numberOfLines:`14`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`14`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.thanxsandbox.com/partner/promotions`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'X-ClientId: {client_id}'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Accept-Version: v4.0'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type: application/json'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization: Bearer {access_token}'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"merchant_id\": \"k2lye10h32l5wzo\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"name\": \"Launch Week\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"discount_type\": \"amount\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"discount_value\": 5,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"redemption_venue\": \"all\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"static_code\": \"LAUNCH5\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})})]}),`\n`,_jsxs(ResponseExample,{children:[_jsx(CodeBlock,{filename:`201`,numberOfLines:`19`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`19`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"promotion\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"promo_abc123\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Summer 20% Off\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"state\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"active\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"discount_type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"percent\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"discount_value\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"20.0\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"minimum_spend\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"25.0\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"maximum_discount\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"fine_print\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Limit one per customer\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"redemption_venue\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"online\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"starts_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-06-01T00:00:00Z\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"ends_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-08-31T23:59:59Z\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"generation_type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"single_use\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"redemption_count\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"total_codes\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"code_generation_status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"in_progress\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`422`,numberOfLines:`6`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"UNPROCESSABLE_ENTITY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"static_code and code_count are mutually exclusive\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Create Promotion","description":"Create a new promotion for a merchant","api":"POST /partner/promotions","href":"/partner/promotions/create-promotion"}}}},"mdxExtracts":{"tableOfContents":[{"title":"Code Pools","slug":"code-pools","depth":3,"children":[]},{"title":"Parameters","slug":"parameters","depth":3,"children":[]},{"title":"Response","slug":"response","depth":3,"children":[]}],"codeExamples":{"request":{"type":"RequestExample","children":[{"filename":"Create Promotion (single-use codes)","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"shellscript\">\u003ccode language=\"shellscript\" numberOfLines=\"18\">\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\">curl\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> https://api.thanxsandbox.com/partner/promotions\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -X\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> POST\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'X-ClientId: {client_id}'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'Accept-Version: v4.0'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'Content-Type: application/json'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'Authorization: Bearer {access_token}'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -d\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> '{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"merchant_id\": \"k2lye10h32l5wzo\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"name\": \"Summer 20% Off\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"discount_type\": \"percent\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"discount_value\": 20,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"minimum_spend\": 25,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"fine_print\": \"Limit one per customer\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"redemption_venue\": \"online\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"starts_at\": \"2026-06-01T00:00:00Z\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"ends_at\": \"2026-08-31T23:59:59Z\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"code_count\": 10000\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> }'\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"Create Promotion (universal shared code)","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"shellscript\">\u003ccode language=\"shellscript\" numberOfLines=\"14\">\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\">curl\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> https://api.thanxsandbox.com/partner/promotions\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -X\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> POST\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'X-ClientId: {client_id}'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'Accept-Version: v4.0'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'Content-Type: application/json'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'Authorization: Bearer {access_token}'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -d\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> '{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"merchant_id\": \"k2lye10h32l5wzo\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"name\": \"Launch Week\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"discount_type\": \"amount\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"discount_value\": 5,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"redemption_venue\": \"all\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"static_code\": \"LAUNCH5\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> }'\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]},"response":{"type":"ResponseExample","children":[{"filename":"201","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"19\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"promotion\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"id\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"promo_abc123\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"name\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Summer 20% Off\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"state\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"active\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"discount_type\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"percent\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"discount_value\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"20.0\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"minimum_spend\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"25.0\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"maximum_discount\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">null\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"fine_print\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Limit one per customer\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"redemption_venue\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"online\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"starts_at\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"2026-06-01T00:00:00Z\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"ends_at\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"2026-08-31T23:59:59Z\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"generation_type\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"single_use\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"redemption_count\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">0\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"total_codes\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">0\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"code_generation_status\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"in_progress\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"422","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"6\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"error\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"code\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"UNPROCESSABLE_ENTITY\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"message\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"static_code and code_count are mutually exclusive\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]}},"endpoint":{"title":"Create Promotion","path":"/partner/promotions","method":"post","request":{"security":[],"parameters":{"query":{},"header":{},"cookie":{},"path":{}},"body":{"application/json":{"schemaArray":[{"type":"object","properties":{"merchant_id":[{"type":"string","description":"Merchant ID","required":true}],"name":[{"type":"string","description":"Promotion name","required":true}],"discount_type":[{"type":"string","description":"Type of discount: `amount` , `percent` , or `item`","required":true}],"discount_value":[{"type":"number","description":"Discount amount. Interpreted according to `discount_type` (for example, a percentage for `percent` or a currency amount for `amount` ).","required":true}],"minimum_spend":[{"type":"number","description":"Minimum spend required to redeem"}],"maximum_discount":[{"type":"number","description":"Maximum discount that can be applied (where supported by the discount type)"}],"fine_print":[{"type":"string","description":"Terms and conditions"}],"instructions":[{"type":"string","description":"Redemption instructions shown to the customer"}],"redemption_venue":[{"type":"string","description":"Where the promotion can be redeemed: `all` , `instore` , or `online` . Defaults to `instore` ."}],"starts_at":[{"type":"object","properties":{},"description":"When the promotion becomes active (ISO8601)"}],"ends_at":[{"type":"object","properties":{},"description":"When the promotion ends (ISO8601). Must be after `starts_at` ."}],"static_code":[{"type":"string","description":"A single shared code to create as a `multi_use` pool. Mutually exclusive with `code_count` ."}],"code_count":[{"type":"integer","description":"Number of unique one-time codes to generate as a `single_use` pool (1–4,000,000). Generation runs asynchronously. Mutually exclusive with `static_code` ."}],"state":[{"type":"string","description":"Initial state: `active` or `draft` . Defaults to `active` . Draft promotions are managed in the Thanx dashboard — the read endpoints ( List Promotions , Get Promotion ) return only `active` promotions."}],"redemption_restrictions":[{"type":"string","description":"Optional day-of-week and time-of-day restrictions on when the promotion can be redeemed. Write-only: these are applied at creation and viewed or edited in the Thanx dashboard; they are not returned by the read endpoints."}]}}],"examples":{"example":{"value":{"merchant_id":"\u003cstring>","name":"\u003cstring>","discount_type":"\u003cstring>","discount_value":123,"minimum_spend":123,"maximum_discount":123,"fine_print":"\u003cstring>","instructions":"\u003cstring>","redemption_venue":"\u003cstring>","starts_at":{},"ends_at":{},"static_code":"\u003cstring>","code_count":123,"state":"\u003cstring>","redemption_restrictions":"\u003cstring>"}}}}}},"response":{"200":{"application/json":{"schemaArray":[{"type":"object","properties":{"id":[{"type":"string","description":"Promotion ID"}],"name":[{"type":"string","description":"Promotion name"}],"state":[{"type":"string","description":"Promotion state ( `active` or `draft` )"}],"discount_type":[{"type":"string","description":"Type of discount the promotion applies: `percent` , `item` , or `amount`"}],"discount_value":[{"type":"string","description":"Discount amount, as a string. Null if not set."}],"minimum_spend":[{"type":"string","description":"Minimum spend required to redeem, as a string. Null if not set."}],"maximum_discount":[{"type":"string","description":"Maximum discount that can be applied, as a string. Null if not set."}],"fine_print":[{"type":"string","description":"Terms and conditions"}],"redemption_venue":[{"type":"string","description":"Where the promotion can be redeemed"}],"starts_at":[{"type":"object","properties":{},"description":"Promotion start timestamp (ISO8601). Null if not set."}],"ends_at":[{"type":"object","properties":{},"description":"Promotion end timestamp (ISO8601). Null if not set."}],"generation_type":[{"type":"string","description":"How the pool’s codes are generated: `multi_use` or `single_use` . Null if no pool was created."}],"redemption_count":[{"type":"integer","description":"Number of times codes in the active pool have been redeemed"}],"total_codes":[{"type":"integer","description":"Total number of codes in the active pool"}],"code_generation_status":[{"type":"string","description":"Status of asynchronous code generation for the active pool: `none` (no codes requested), `in_progress` , `complete` , or `failed`"}]}}],"examples":{"example":{"value":{"id":"\u003cstring>","name":"\u003cstring>","state":"\u003cstring>","discount_type":"\u003cstring>","discount_value":"\u003cstring>","minimum_spend":"\u003cstring>","maximum_discount":"\u003cstring>","fine_print":"\u003cstring>","redemption_venue":"\u003cstring>","starts_at":{},"ends_at":{},"generation_type":"\u003cstring>","redemption_count":123,"total_codes":123,"code_generation_status":"\u003cstring>"}}}}}},"deprecated":false}},"jsLinks":[],"subdomain":"thanx","siteName":"Thanx","title":"Create Promotion - Thanx","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-07-09T04:03:50.545Z","originalFileLocation":"partner/promotions/create-promotion.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Create a new promotion for a merchant\">\u003cmeta data-mint-head name=\"application-name\" content=\"Thanx\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/thanx/0JkP31DGq1SVLm6U/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/thanx/0JkP31DGq1SVLm6U/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/thanx/0JkP31DGq1SVLm6U/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/thanx/0JkP31DGq1SVLm6U/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/thanx/0JkP31DGq1SVLm6U/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/thanx/0JkP31DGq1SVLm6U/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/thanx/0JkP31DGq1SVLm6U/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/thanx/0JkP31DGq1SVLm6U/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/thanx/0JkP31DGq1SVLm6U/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Create Promotion - Thanx\">\u003cmeta data-mint-head property=\"og:description\" content=\"Create a new promotion for a merchant\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Thanx\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.thanx.com/partner/promotions/create-promotion\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://thanx.mintlify.site/_mintlify/api/og/v2?division=Promotions\u0026amp;title=Create+Promotion\u0026amp;description=Create+a+new+promotion+for+a+merchant\u0026amp;theme=b4df6fb3c288da3b05f2dd02\u0026amp;signature=ed3a769791f4d02d42d562c86d7fb11c8d99c3f2df87c270b566490fbea47ad1\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Create Promotion - Thanx\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Create a new promotion for a merchant\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://thanx.mintlify.site/_mintlify/api/og/v2?division=Promotions\u0026amp;title=Create+Promotion\u0026amp;description=Create+a+new+promotion+for+a+merchant\u0026amp;theme=b4df6fb3c288da3b05f2dd02\u0026amp;signature=ed3a769791f4d02d42d562c86d7fb11c8d99c3f2df87c270b566490fbea47ad1\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/thanx/0JkP31DGq1SVLm6U/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Thanx\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#129B9B\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.thanx.com/partner/promotions/create-promotion\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/partner/promotions/create-promotion.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.thanx.com/#organization\",\"name\":\"Thanx\",\"url\":\"https://docs.thanx.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/thanx/NEzLP0j6kJjm2liR/logo/light.svg?fit=max\u0026auto=format\u0026n=NEzLP0j6kJjm2liR\u0026q=85\u0026s=8b3bd3f1ffbb1567714a92067df956d9\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.thanx.com#website\",\"name\":\"Thanx\",\"url\":\"https://docs.thanx.com\",\"publisher\":{\"@id\":\"https://docs.thanx.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.thanx.com/partner/promotions/create-promotion#webpage\",\"url\":\"https://docs.thanx.com/partner/promotions/create-promotion\",\"name\":\"Create Promotion\",\"description\":\"Create a new promotion for a merchant\",\"dateModified\":\"2026-07-09T04:03:50.545Z\",\"isPartOf\":{\"@id\":\"https://docs.thanx.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.thanx.com/partner/promotions/create-promotion#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.thanx.com/partner/promotions/create-promotion#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Reference\",\"item\":\"https://docs.thanx.com/partner/metadata/get-scopes\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Promotions\",\"item\":\"https://docs.thanx.com/partner/promotions/overview\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Create Promotion\",\"item\":\"https://docs.thanx.com/partner/promotions/create-promotion\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.thanx.com/partner/promotions/create-promotion#apireference\",\"headline\":\"Create Promotion\",\"name\":\"Create Promotion\",\"description\":\"Create a new promotion for a merchant\",\"url\":\"https://docs.thanx.com/partner/promotions/create-promotion\",\"mainEntityOfPage\":{\"@id\":\"https://docs.thanx.com/partner/promotions/create-promotion#webpage\"},\"dateModified\":\"2026-07-09T04:03:50.545Z\",\"publisher\":{\"@id\":\"https://docs.thanx.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.thanx.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Thanx\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Thanx\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/partner/promotions/create-promotion.md","siteName":"Thanx","nav":{"global":{"anchors":[{"anchor":"Help Center","icon":"book-bookmark","href":"https://help.thanx.com/hc/en-us"},{"anchor":"Thanx Product Updates","icon":"bullhorn","href":"https://thanx.launchnotes.io/"},{"anchor":"Status","icon":"wave-pulse","href":"https://status.thanx.com"},{"anchor":"Email Support","icon":"envelope","href":"mailto:developer.support@thanx.com"}]},"tabs":[{"tab":"Overview","pages":[{"title":"Overview","href":"/overview/intro"}]},{"tab":"Consumer API","pages":[{"title":"Consumer API","href":"/consumer/overview"}]},{"tab":"Partner API","pages":[{"group":"Merchant \u0026 Partner API","pages":[{"title":"Overview","href":"/partner/overview"}]},{"group":"Reference","pages":[{"group":"Metadata","pages":[{"title":"Get Scopes","api":"GET /partner/scopes","href":"/partner/metadata/get-scopes"},{"title":"Get Merchants","api":"GET /partner/merchants","href":"/partner/metadata/get-merchants"},{"title":"Get Locations","api":"GET /partner/locations","href":"/partner/metadata/get-locations"}]},{"group":"Subscribers","pages":[{"title":"Create Subscriber","api":"POST /partner/subscribers","href":"/partner/subscribers/create-subscriber"}]},{"group":"Users","pages":[{"title":"Get Users","api":"GET /partner/users","href":"/partner/users/get-users"},{"title":"Get User","api":"GET /partner/users/:id","href":"/partner/users/get-user"},{"title":"Update User","api":"PATCH /partner/users/:id","href":"/partner/users/update-user"}]},{"group":"Auth","pages":[{"title":"Create Access Token","api":"POST /partner/oauth/token","href":"/partner/auth/create-token"}]},{"group":"Purchases","pages":[{"title":"Create Purchase","api":"POST /purchases","href":"/partner/purchases/create-purchase"}]},{"group":"Tags","pages":[{"title":"Get Tags","api":"GET /partner/tags","href":"/partner/tags/get-tags"},{"title":"Upsert Tags","api":"PUT /partner/tags","href":"/partner/tags/upsert-tags"},{"title":"Delete Tags","api":"DELETE /partner/tags","href":"/partner/tags/delete-tags"}]},{"group":"Communication Settings","pages":[{"title":"Get User's Communication Settings","api":"GET /partner/users/:id/communication_settings","href":"/partner/users/communication-settings/get"},{"title":"Update User's Communication Settings","api":"PATCH /partner/users/:id/communication_settings","href":"/partner/users/communication-settings/update"}]},{"group":"Reward Templates","pages":[{"title":"List Reward Templates","api":"GET /partner/reward_templates","href":"/partner/reward-templates/list-reward-templates"},{"title":"Get Reward Template","api":"GET /partner/reward_templates/:id","href":"/partner/reward-templates/get-reward-template"}]},{"group":"Campaigns","pages":[{"title":"Create Campaign","api":"POST /partner/campaigns","href":"/partner/campaigns/create-campaign"},{"title":"List Campaigns","api":"GET /partner/campaigns","href":"/partner/campaigns/list-campaigns"},{"title":"Get Campaign","api":"GET /partner/campaigns/:id","href":"/partner/campaigns/get-campaign"},{"title":"Issue Rewards","api":"POST /partner/campaigns/issue","href":"/partner/campaigns/issue-rewards"}]},{"group":"Promotions","pages":[{"title":"Promotions Overview","description":"How to create promotions, generate codes, and dispense them to customers","href":"/partner/promotions/overview"},{"title":"Create Promotion","api":"POST /partner/promotions","href":"/partner/promotions/create-promotion"},{"title":"List Promotions","description":"Returns active promotions for a merchant","api":"GET /partner/promotions","href":"/partner/promotions/list-promotions"},{"title":"Get Promotion","api":"GET /partner/promotions/:id","href":"/partner/promotions/get-promotion"},{"title":"List Promotion Codes","api":"GET /partner/promotions/:id/codes","href":"/partner/promotions/list-codes"},{"title":"Generate Promotion Codes","api":"POST /partner/promotions/:id/codes","href":"/partner/promotions/generate-codes"}]},{"group":"Points Experience","pages":[{"title":"Issue Points","api":"POST /partner/points_experience/issue","href":"/partner/points-experience/issue-points"}]},{"group":"Issuance Jobs","pages":[{"title":"Get Issuance Job","api":"GET /partner/issuance_jobs/:id","href":"/partner/issuance-jobs/get-issuance-job"},{"title":"Revoke Issuance Job","api":"POST /partner/issuance_jobs/:id/revoke","href":"/partner/issuance-jobs/revoke-issuance-job"}]}]}]},{"tab":"Loyalty API","pages":[{"title":"Loyalty API","href":"/loyalty/overview"}]},{"tab":"Webhooks","pages":[{"title":"Webhooks","href":"/webhooks/overview"}]},{"tab":"Data Exports","pages":[{"title":"Data Exports","href":"/data/overview"}]},{"tab":"AI","icon":"sparkles","pages":[{"title":"AI","href":"/ai/overview"}]}]},"basePath":"","title":"Create Promotion - Thanx","buildId":"dpl_5joLUXmnJgwqjrHAS4dxZrQTdxgh","deploymentId":"dpl_5joLUXmnJgwqjrHAS4dxZrQTdxgh","dynamics":["c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["OpenApiReferenceProvider-DPDWPCdE.js","utils-DyjUHyLo.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-BWYE1cdS.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-COAzxpEw.js","snippetPresets-DNiD_S52.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-CjwVt80x.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-ByHQMk7z.js","shallow-CaZuw1AO.js","getApiPlaygroundDisplay-DPVPOknm.js","CodeSnippet-B31CH-Mp.js","CodeSnippets-BxTYZWz6.js","Page-DDHbuAIY.js","getPastedJson-DhoAwiNO.js","icon-Dhq8z75J.js","MethodPill-DLXmKOwr.js","DuplicateIcon-jzdVwyRU.js","createIcon-eD0b3klN.js","DynamicMarkdown-BfddVCX7.js","SectionHeading-2pSCIo17.js","axios-vUo_bRtp.js"]}