{ "code": 400, "message": "The reward was not found in our system"}
{ "code": 400, "message": "A promo code cannot be combined with a reward or points product"}
{ "code": 400, "message": "This promo code is not valid"}
{ "code": 400, "message": "hold_until must be at least 2 days from now"}
{ "code": 400, "message": "This reward expires before hold_until. Choose an earlier hold_until or a different reward"}
{ "code": 401, "message": "There was an error authenticating you."}
Reference
Create & Update Basket
This endpoint is used to notify Thanx of the states that a basket is in, apply rewards to the order, and accrue loyalty progress or points for the order.
Need to surface only the rewards that would apply to the current basket (e.g. an offers carousel before checkout)? Use Qualifying Rewards for a Basket — a read-only dry-run that shares this endpoint’s applicability check without redeeming anything.
A basket can be in one of the following states:
State
Description
checkout
required Refers to any point before the order is placed. Any time the user updates their basket or rewards, Thanx expects to receive a request to check if discount information should be updated.
placed
required Refers to when an order has been submitted to the system and a user can no longer modify their order through the website. If a reward is specified, the reward will be locked and released back to the user after about 2 days unless the order is billed or voided first; to hold it longer, send hold_until. If a points product is specified, the user’s points balance will be deducted in exchange for specified reward and the reward will be locked.
billed
required Refers to when the order has been trasmitted to the POS and the user’s credit card has been charged. Any specified reward will be marked as used. Loyalty progress or points will be accrued upon receipt of this event.
completed
recommended Refers to when the order has been made and transferred to the customer.
voided
recommended Refers to an order that got canceled after entering the placed state and before entering the billed state. Any locked reward is restored to the user and available for future use. For rewards obtained through a points exchange (points products), the reward instance is finalized as refunded and the points are returned to the user’s points balance — the user can re-exchange those points for a new reward.
refunded
recommended Refers to an order being refunded / canceled any time after it enters the billed state. Any locked reward is restored to the user and available for future use. For rewards obtained through a points exchange (points products), the reward instance is finalized as refunded and the points are returned to the user’s points balance — the user can re-exchange those points for a new reward.
Only a single reward, points product, or promo code can be applied per order. Supplying a promo code together with a reward or points product returns a 400.
Basket unique ID. Partner-generated: your system creates this value and reuses it across every state transition for the same basket.
Required for all states other than checkout. A checkout request may omit the ID; every subsequent state (placed, billed, completed, voided, refunded) must send the same ID the basket was created with.
When the order is wanted in (ISO 8601 in UTC). If this timestamp is not
provided, Thanx assumes the order is wanted ASAP.Providing this timestamp allows Thanx to determine if a reward will be valid in the future (for
example, for a weekend only promotion where the user orders in advance).
Thanx Location UID Providing this information allows Thanx to apply reward
location restrictions.A mapping of Thanx location identifiers can be provided by the Thanx developer
support team or fetched from the following endpoints depending on your integration type:
Reward IDs to apply to the basket.These IDs must be obtained from the rewards field at the Get Account API response.If you are integrating with reward codes,
provide the reward code here instead.
Currently only a single reward or points product can be applied to a
basket. The request will 400 if multiple rewards or points products are
specified in the request.
Points Product IDs to apply to the basket.These IDs must be obtained from the points_products field at the Get Account API response.
Currently only a single reward or points product can be applied to a
basket. The request will 400 if multiple rewards or points products are
specified in the request.
Universal Promo Code support is being rolled out and must be enabled for your
account by Thanx before it can be used. Contact your Thanx representative to
request access.
A Universal Promo Code to apply to the basket, as a 1–64 character string.A promo code follows the same lifecycle as a reward:
checkout — the code is validated and the resulting discount is returned as a preview; nothing is redeemed yet.
placed / billed / completed — the discount is applied and the redemption is recorded (once per basket).
voided / refunded — any recorded redemption is released.
A promo code cannot be combined with a reward or points product. Supplying
both returns a 400 — apply one or the other, not both.
A basket id is required when applying a promo code, and must be reused
across every state update for the basket. The id keys the redemption and
makes retries idempotent, so resending the same basket will not redeem twice.
A member is not required to apply a promo code. If the basket is associated
with a member, the order still accrues loyalty as usual; if it is not, the
discount is applied and the redemption is recorded, but the order does not
accrue loyalty (there is no member to credit).
When to hold the applied reward until for this order, as an ISO 8601 timestamp with an explicit offset (Z or +hh:mm), for example 2026-12-24T18:00:00Z. Use it for orders placed well before they are billed, such as catering or scheduled orders. See Holding a reward for scheduled orders.Default: when omitted, a reward on a placed basket is released back to the user’s wallet about 2 days after the basket was placed (the release job runs every 2 hours, so in practice 2 days to roughly 2 days 2 hours), whether or not the order has been billed or voided.Validated on the checkout and placed states, so you learn before placing an order that a hold can’t be honored. Later states ignore the field. The value must be:
in the future, and at least 2 days from now
no more than 365 days from now
before the reward’s expiration (including a points product’s projected reward expiration). A hold_until equal to the expiration is rejected.
Re-sending placed with a later hold_until extends the hold; an earlier one never shortens it. Re-sending a hold_until the reward is already held through is accepted unchanged, even when it is under 2 days away. Omitting it on a re-send leaves the existing hold alone.
Currently either instore or online, defaults to online. This is used to
adjust which configured product IDs are returned in the applicable reward and
points product entities.
By default, a reward on a placed basket is released back to the user about 2 days after the basket was placed. For orders placed well ahead of the day they are billed, send hold_until so the reward stays reserved for the order until then.
checkout: send the event or fulfillment time as hold_until. If the reward would expire before that time, the request returns a 400 so you can ask the user to choose a different reward.
placed: send the same hold_until. The reward is held until that time.
billed: send the order as usual. Billing re-checks reward eligibility against the order_timestamp you send, so use the same fulfillment time throughout.
The hold ends at hold_until, when the reward is released back to the user’s wallet. Billing, voiding, or otherwise releasing the reward before then also clears the hold.
{ "code": 400, "message": "The reward was not found in our system"}
{ "code": 400, "message": "A promo code cannot be combined with a reward or points product"}
{ "code": 400, "message": "This promo code is not valid"}
{ "code": 400, "message": "hold_until must be at least 2 days from now"}
{ "code": 400, "message": "This reward expires before hold_until. Choose an earlier hold_until or a different reward"}
{ "code": 401, "message": "There was an error authenticating you."}
{"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":""},"chroma":{"liveDeploymentHistoryId":"6ae11cec017d49fc88baee5e","collectionId":"5fe6e5e5-5979-44f1-bcb0-e50bec4fab97","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae11cec017d49fc88baee5e"},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae11cec017d49fc88baee5e","clientVersion":"0.0.3990","searchFilterCounts":[{"language":"default","tag":"Reference","count":100},{"language":"default","tag":"Consumer API","count":90},{"language":"default","tag":"Data Exports","count":39},{"language":"default","tag":"Partner API","count":32},{"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":10},{"language":"default","tag":"Users","count":8},{"language":"default","tag":"Loyalty API","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":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","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":"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":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","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":"per-site-search-delta","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":"editor-private-page-search","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":"editor-nav-generations","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":"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":"byok-sep-25","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":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","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":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"loyalty/create-update-basket","slug":"/loyalty/create-update-basket","pageMetadata":{"title":"Create \u0026 Update Basket","api":"POST https://loyalty.thanxsandbox.com/api/baskets","description":"This endpoint is used to notify Thanx of the states that a basket is in, apply rewards to the order, and accrue loyalty progress or points for the order.","href":"/loyalty/create-update-basket"},"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: \"This endpoint is used to notify Thanx of the states that a basket is in, apply rewards to the order, and accrue loyalty progress or points for the order.\"\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`,em:`em`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Expandable,Heading,Mermaid,Note,ParamField,ResponseField,Table,Tip,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Mermaid)_missingMdxReference(`Mermaid`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Tip,{children:_jsxs(_components.p,{children:[`Integrating for the first time? Start with the `,_jsx(_components.a,{href:`/overview/guides/basket-lifecycle`,children:`Basket Lifecycle \u0026 Troubleshooting guide`}),` for behavioral context and common-mistake coverage.`]})}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`Need to surface only the rewards that `,_jsx(_components.em,{children:`would`}),` apply to the current basket (e.g. an offers carousel before checkout)? Use `,_jsx(_components.a,{href:`/loyalty/qualifying-baskets`,children:`Qualifying Rewards for a Basket`}),` — a read-only dry-run that shares this endpoint’s applicability check without redeeming anything.`]})}),`\n`,_jsx(_components.p,{children:`A basket can be in one of the following states:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`State`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`checkout`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`required`}),` Refers to any point before the order is placed. Any time the user updates their basket or rewards, Thanx expects to receive a request to check if discount information should be updated.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`placed`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`required`}),` Refers to when an order has been submitted to the system and a user can no longer modify their order through the website. If a reward is specified, the reward will be locked and released back to the user after about 2 days unless the order is billed or voided first; to hold it longer, send `,_jsx(_components.a,{href:`#param-hold-until`,children:_jsx(_components.code,{children:`hold_until`})}),`. If a points product is specified, the user’s points balance will be deducted in exchange for specified reward and the reward will be locked.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`billed`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`required`}),` Refers to when the order has been trasmitted to the POS and the user’s credit card has been charged. Any specified reward will be marked as used. Loyalty progress or points will be accrued upon receipt of this event.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`completed`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`recommended`}),` Refers to when the order has been made and transferred to the customer.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`voided`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`recommended`}),` Refers to an order that got canceled after entering the placed state and before entering the billed state. Any locked reward is restored to the user and available for future use. For rewards obtained through a points exchange (points products), the reward instance is finalized as refunded and the points are returned to the user’s points balance — the user can re-exchange those points for a new reward.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`refunded`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`recommended`}),` Refers to an order being refunded / canceled any time after it enters the billed state. Any locked reward is restored to the user and available for future use. For rewards obtained through a points exchange (points products), the reward instance is finalized as refunded and the points are returned to the user’s points balance — the user can re-exchange those points for a new reward.`]})]})]})]}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Only a single reward, points product, or promo code can be applied per order. Supplying a promo code together with a reward or points product returns a 400.`})}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`For more on the difference between locked rewards and points-product rewards\nwhen an order is voided or refunded, see\n`,_jsx(_components.a,{href:`/consumer/best-practices/loyalty#rewards-vs-points-products`,children:`Loyalty Best Practices — Rewards vs Points Products`}),`.`]})}),`\n`,_jsx(Mermaid,{chart:` flowchart LR\n Checkout --> Placed\n Placed --> Voided\n Placed --> Billed\n Billed --> Refunded\n Billed --> Completed\n Completed --> Refunded\n\n classDef default fill:transparent,stroke:#13c1bf,stroke-width:1px;`}),`\n`,_jsx(Heading,{level:`2`,id:`http-request`,children:`HTTP Request`}),`\n`,_jsx(Heading,{level:`3`,id:`parameters`,children:`Parameters`}),`\n`,_jsxs(ParamField,{body:`id`,type:`string`,id:`param-id`,children:[_jsx(_components.p,{children:`Basket unique ID. Partner-generated: your system creates this value and reuses it across every state transition for the same basket.`}),_jsx(Note,{children:_jsxs(_components.p,{children:[`Required for all states other than `,_jsx(_components.code,{children:`checkout`}),`. A `,_jsx(_components.code,{children:`checkout`}),` request may omit the ID; every subsequent state (`,_jsx(_components.code,{children:`placed`}),`, `,_jsx(_components.code,{children:`billed`}),`, `,_jsx(_components.code,{children:`completed`}),`, `,_jsx(_components.code,{children:`voided`}),`, `,_jsx(_components.code,{children:`refunded`}),`) must send the same ID the basket was created with.`]})})]}),`\n`,_jsx(ParamField,{body:`state`,type:`enum`,required:true,id:`param-state`,children:_jsxs(_components.p,{children:[`Basket state (`,_jsx(_components.code,{children:`checkout`}),`, `,_jsx(_components.code,{children:`placed`}),`, `,_jsx(_components.code,{children:`billed`}),`, `,_jsx(_components.code,{children:`completed`}),`, `,_jsx(_components.code,{children:`voided`}),`,\n`,_jsx(_components.code,{children:`refunded`}),`)`]})}),`\n`,_jsxs(ParamField,{body:`order_timestamp`,type:`string`,required:true,id:`param-order-timestamp`,children:[_jsxs(_components.p,{children:[`When the order is wanted in `,_jsx(_components.strong,{children:`(ISO 8601 in UTC)`}),`. If this timestamp is not\nprovided, Thanx assumes the order is wanted ASAP.`]}),_jsx(_components.p,{children:`Providing this timestamp allows Thanx to determine if a reward will be valid in the future (for\nexample, for a weekend only promotion where the user orders in advance).`})]}),`\n`,_jsxs(ParamField,{body:`location_uid`,type:`string`,required:true,id:`param-location-uid`,children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Thanx Location UID`}),` Providing this information allows Thanx to apply reward\nlocation restrictions.`]}),_jsx(_components.p,{children:`A mapping of Thanx location identifiers can be provided by the Thanx developer\nsupport team or fetched from the following endpoints depending on your integration type:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Consumer API `,_jsx(_components.a,{href:`/consumer/locations/get-locations`,children:`Get Locations`}),` endpoint.`]}),`\n`,_jsxs(_components.li,{children:[`Partner API `,_jsx(_components.a,{href:`/partner/metadata/get-locations`,children:`Get Locations`}),` endpoint.`]}),`\n`]})]}),`\n`,_jsxs(ParamField,{body:`rewards`,type:`array(string)`,id:`param-rewards`,children:[_jsx(_components.p,{children:`Reward IDs to apply to the basket.`}),_jsx(_components.p,{children:_jsxs(_components.strong,{children:[`These IDs must be obtained from the rewards field at the `,_jsx(_components.a,{href:`/loyalty/get-account`,children:`Get Account API`}),` response.`]})}),_jsx(_components.p,{children:`If you are integrating with reward codes,\nprovide the reward code here instead.`}),_jsx(Note,{children:_jsx(_components.p,{children:`Currently only a single reward or points product can be applied to a\nbasket. The request will 400 if multiple rewards or points products are\nspecified in the request.`})})]}),`\n`,_jsxs(ParamField,{body:`points_products`,type:`array(string)`,id:`param-points-products`,children:[_jsx(_components.p,{children:`Points Product IDs to apply to the basket.`}),_jsx(_components.p,{children:_jsxs(_components.strong,{children:[`These IDs must be obtained from the points_products field at the `,_jsx(_components.a,{href:`/loyalty/get-account`,children:`Get Account API`}),` response.`]})}),_jsx(Note,{children:_jsx(_components.p,{children:`Currently only a single reward or points product can be applied to a\nbasket. The request will 400 if multiple rewards or points products are\nspecified in the request.`})})]}),`\n`,_jsxs(ParamField,{body:`promo_code`,type:`string`,id:`param-promo-code`,children:[_jsx(Warning,{children:_jsx(_components.p,{children:`Universal Promo Code support is being rolled out and must be enabled for your\naccount by Thanx before it can be used. Contact your Thanx representative to\nrequest access.`})}),_jsx(_components.p,{children:`A Universal Promo Code to apply to the basket, as a 1–64 character string.`}),_jsx(_components.p,{children:`A promo code follows the same lifecycle as a reward:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`checkout`}),` — the code is validated and the resulting `,_jsx(_components.code,{children:`discount`}),` is returned as a preview; nothing is redeemed yet.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`placed`}),` / `,_jsx(_components.code,{children:`billed`}),` / `,_jsx(_components.code,{children:`completed`}),` — the discount is applied and the redemption is recorded (once per basket).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`voided`}),` / `,_jsx(_components.code,{children:`refunded`}),` — any recorded redemption is released.`]}),`\n`]}),_jsx(Note,{children:_jsx(_components.p,{children:`A promo code cannot be combined with a reward or points product. Supplying\nboth returns a 400 — apply one or the other, not both.`})}),_jsx(Note,{children:_jsxs(_components.p,{children:[`A basket `,_jsx(_components.code,{children:`id`}),` is required when applying a promo code, and must be reused\nacross every state update for the basket. The `,_jsx(_components.code,{children:`id`}),` keys the redemption and\nmakes retries idempotent, so resending the same basket will not redeem twice.`]})}),_jsx(Note,{children:_jsx(_components.p,{children:`A member is not required to apply a promo code. If the basket is associated\nwith a member, the order still accrues loyalty as usual; if it is not, the\ndiscount is applied and the redemption is recorded, but the order does not\naccrue loyalty (there is no member to credit).`})})]}),`\n`,_jsxs(ParamField,{body:`hold_until`,type:`string`,id:`param-hold-until`,children:[_jsxs(_components.p,{children:[`When to hold the applied reward until for this order, as an `,_jsx(_components.strong,{children:`ISO 8601 timestamp with an explicit offset`}),` (`,_jsx(_components.code,{children:`Z`}),` or `,_jsx(_components.code,{children:`+hh:mm`}),`), for example `,_jsx(_components.code,{children:`2026-12-24T18:00:00Z`}),`. Use it for orders placed well before they are billed, such as catering or scheduled orders. See `,_jsx(_components.a,{href:`#holding-a-reward-for-scheduled-orders`,children:`Holding a reward for scheduled orders`}),`.`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Default:`}),` when omitted, a reward on a `,_jsx(_components.code,{children:`placed`}),` basket is released back to the user’s wallet about `,_jsx(_components.strong,{children:`2 days`}),` after the basket was placed (the release job runs every 2 hours, so in practice 2 days to roughly 2 days 2 hours), whether or not the order has been billed or voided.`]}),_jsxs(_components.p,{children:[`Validated on the `,_jsx(_components.code,{children:`checkout`}),` and `,_jsx(_components.code,{children:`placed`}),` states, so you learn before placing an order that a hold can’t be honored. Later states ignore the field. The value must be:`]}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`in the future, and `,_jsx(_components.strong,{children:`at least 2 days`}),` from now`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`no more than 365 days`}),` from now`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`before`}),` the reward’s expiration (including a points product’s projected reward expiration). A `,_jsx(_components.code,{children:`hold_until`}),` equal to the expiration is rejected.`]}),`\n`]}),_jsx(Note,{children:_jsxs(_components.p,{children:[`Re-sending `,_jsx(_components.code,{children:`placed`}),` with a later `,_jsx(_components.code,{children:`hold_until`}),` extends the hold; an earlier one never shortens it. Re-sending a `,_jsx(_components.code,{children:`hold_until`}),` the reward is already held through is accepted unchanged, even when it is under 2 days away. Omitting it on a re-send leaves the existing hold alone.`]})})]}),`\n`,_jsxs(ParamField,{body:`payments`,type:`array(hash)`,id:`param-payments`,children:[_jsx(_components.p,{children:`Array of payment methods`}),_jsxs(Expandable,{title:`payment`,children:[_jsx(ParamField,{body:`last4`,type:`string`,id:`param-last4`,children:_jsx(_components.p,{children:`Last 4 digits of the payment method`})}),_jsx(ParamField,{body:`issuer`,type:`string`,required:true,id:`param-issuer`,children:_jsx(_components.p,{children:`Issuer of the payment method`})}),_jsxs(ParamField,{body:`amount`,type:`decimal`,required:true,id:`param-amount`,children:[_jsx(Note,{children:_jsx(_components.p,{children:`Required to generate the purchase and points to the user.`})}),_jsx(_components.p,{children:`Amount used with the payment method`})]}),_jsx(ParamField,{body:`authorized_at`,type:`string`,required:true,id:`param-authorized-at`,children:_jsxs(_components.p,{children:[`The timestamp of when the authorization was submitted to the issuer, in `,_jsx(_components.strong,{children:`ISO8601 format. The timestamp must be expressed in UTC.`})]})})]}),_jsx(Note,{children:_jsx(_components.p,{children:`Currently only a single object is supported. If multiple entries are provided, only the first will be validated and the rest will be ignored.`})})]}),`\n`,_jsxs(ParamField,{body:`items`,type:`array(hash)`,required:true,id:`param-items`,children:[_jsx(_components.p,{children:`Array of items`}),_jsxs(Expandable,{title:`item`,children:[_jsx(ParamField,{body:`id`,type:`string`,id:`param-id-1`,children:_jsx(_components.p,{children:`Item ID in your system / POS`})}),_jsx(ParamField,{body:`name`,type:`string`,id:`param-name`,children:_jsx(_components.p,{children:`Item name`})}),_jsx(ParamField,{body:`price`,type:`decimal`,id:`param-price`,children:_jsx(_components.p,{children:`Item amount`})}),_jsx(ParamField,{body:`categories`,type:`array(string)`,id:`param-categories`,children:_jsx(_components.p,{children:`categories that describe this item`})}),_jsxs(ParamField,{body:`modifiers`,type:`array(hash)`,id:`param-modifiers`,children:[_jsx(_components.p,{children:`Array of modifiers for this item`}),_jsxs(Expandable,{title:`modifier`,children:[_jsx(ParamField,{body:`id`,type:`string`,id:`param-id-2`,children:_jsx(_components.p,{children:`Modifier ID in your system / POS`})}),_jsx(ParamField,{body:`name`,type:`string`,id:`param-name-1`,children:_jsx(_components.p,{children:`Modifier name`})}),_jsx(ParamField,{body:`price`,type:`decimal`,id:`param-price-1`,children:_jsx(_components.p,{children:`Modifier price adjustment`})}),_jsx(ParamField,{body:`item_base_price`,type:`decimal`,id:`param-item-base-price`,children:_jsx(_components.p,{children:`Base price of the item before modifiers`})})]})]})]})]}),`\n`,_jsx(ParamField,{body:`subtotal`,type:`decimal`,required:true,id:`param-subtotal`,children:_jsx(_components.p,{children:`The subtotal of the basket in USD (before taxes \u0026 tips)`})}),`\n`,_jsx(ParamField,{query:`redemption_venue`,type:`string`,optional:true,id:`param-redemption-venue`,children:_jsxs(_components.p,{children:[`Currently either `,_jsx(_components.code,{children:`instore`}),` or `,_jsx(_components.code,{children:`online`}),`, defaults to `,_jsx(_components.code,{children:`online`}),`. This is used to\nadjust which configured product IDs are returned in the applicable reward and\npoints product entities.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`response`,children:`Response`}),`\n`,_jsx(ResponseField,{name:`id`,type:`string`,id:`param-id-3`,children:_jsx(_components.p,{children:`Response ID`})}),`\n`,_jsx(ResponseField,{name:`state`,type:`enum`,id:`param-state-1`,children:_jsxs(_components.p,{children:[`Basket state (`,_jsx(_components.code,{children:`checkout`}),`, `,_jsx(_components.code,{children:`placed`}),`, `,_jsx(_components.code,{children:`billed`}),`, `,_jsx(_components.code,{children:`completed`}),`, `,_jsx(_components.code,{children:`voided`}),`,\n`,_jsx(_components.code,{children:`refunded`}),`)`]})}),`\n`,_jsx(ResponseField,{name:`discount`,type:`string`,id:`param-discount`,children:_jsx(_components.p,{children:`Discount to apply`})}),`\n`,_jsx(Heading,{level:`2`,id:`holding-a-reward-for-scheduled-orders`,children:`Holding a Reward for Scheduled Orders`}),`\n`,_jsxs(_components.p,{children:[`By default, a reward on a `,_jsx(_components.code,{children:`placed`}),` basket is released back to the user about 2 days after the basket was placed. For orders placed well ahead of the day they are billed, send `,_jsx(_components.code,{children:`hold_until`}),` so the reward stays reserved for the order until then.`]}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`checkout`}),`: send the event or fulfillment time as `,_jsx(_components.code,{children:`hold_until`}),`. If the reward would expire before that time, the request returns a `,_jsx(_components.code,{children:`400`}),` so you can ask the user to choose a different reward.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`placed`}),`: send the same `,_jsx(_components.code,{children:`hold_until`}),`. The reward is held until that time.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`billed`}),`: send the order as usual. Billing re-checks reward eligibility against the `,_jsx(_components.code,{children:`order_timestamp`}),` you send, so use the same fulfillment time throughout.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`The hold ends at `,_jsx(_components.code,{children:`hold_until`}),`, when the reward is released back to the user’s wallet. Billing, voiding, or otherwise releasing the reward before then also clears the hold.`]}),`\n`,_jsx(CodeBlock,{filename:`Placed with hold_until`,numberOfLines:`24`,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:`24`,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://loyalty.thanxsandbox.com/api/baskets`}),_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:' \"Authorization: Bearer ${'}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`token`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}\"`}),_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:` \"Accept: application/vnd.thanx-v1+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:' \"Merchant-Key: ${'}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`merchant_key`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}\"`}),_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:` \"id\": \"order-abc-123\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"state\": \"placed\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"order_timestamp\": \"2026-12-24T18:00:00Z\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"hold_until\": \"2026-12-24T18:00:00Z\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"location_uid\": \"LG-567fhwer\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"rewards\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"fheTRR\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_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:` \"items\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_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:` \"id\": \"ng-23492\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"name\": \"Cheese Pizza\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"price\": 20.00`})}),`\n`,_jsx(_components.span,{className:`line`,children:_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:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"subtotal\": 20.00`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`If a reward expires before it can be billed, `,_jsx(_components.code,{children:`billed`}),` returns `,_jsx(_components.code,{children:`400 This reward will expire before the order is fulfilled`}),`.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`hold_until-errors`,children:`hold_until Errors`}),`\n`,_jsxs(_components.p,{children:[`Each failure returns HTTP `,_jsx(_components.code,{children:`400`}),` with `,_jsx(_components.code,{children:`{\"code\": 400, \"message\": ...}`}),`.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Condition`}),_jsx(_components.th,{children:`Message`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Not an ISO 8601 timestamp with an offset`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`hold_until is invalid`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Matches the format but is not a real time (for example, month 13)`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`hold_until is not a valid time`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`In the past`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`hold_until must be in the future`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Less than 2 days from now`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`hold_until must be at least 2 days from now`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`More than 365 days from now`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`hold_until must be no more than 365 days from now`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`At or after the reward’s expiration`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`This reward expires before hold_until. Choose an earlier hold_until or a different reward`})})]})]})]})]})}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 \u0026 Update Basket","api":"POST https://loyalty.thanxsandbox.com/api/baskets","description":"This endpoint is used to notify Thanx of the states that a basket is in, apply rewards to the order, and accrue loyalty progress or points for the order.","href":"/loyalty/create-update-basket"}}},"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`,em:`em`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Expandable,Heading,Mermaid,Note,ParamField,RequestExample,ResponseExample,ResponseField,Table,Tip,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Mermaid)_missingMdxReference(`Mermaid`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!RequestExample)_missingMdxReference(`RequestExample`,true);if(!ResponseExample)_missingMdxReference(`ResponseExample`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Tip,{children:_jsxs(_components.p,{children:[`Integrating for the first time? Start with the `,_jsx(_components.a,{href:`/overview/guides/basket-lifecycle`,children:`Basket Lifecycle \u0026 Troubleshooting guide`}),` for behavioral context and common-mistake coverage.`]})}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`Need to surface only the rewards that `,_jsx(_components.em,{children:`would`}),` apply to the current basket (e.g. an offers carousel before checkout)? Use `,_jsx(_components.a,{href:`/loyalty/qualifying-baskets`,children:`Qualifying Rewards for a Basket`}),` — a read-only dry-run that shares this endpoint’s applicability check without redeeming anything.`]})}),`\n`,_jsx(_components.p,{children:`A basket can be in one of the following states:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`State`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`checkout`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`required`}),` Refers to any point before the order is placed. Any time the user updates their basket or rewards, Thanx expects to receive a request to check if discount information should be updated.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`placed`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`required`}),` Refers to when an order has been submitted to the system and a user can no longer modify their order through the website. If a reward is specified, the reward will be locked and released back to the user after about 2 days unless the order is billed or voided first; to hold it longer, send `,_jsx(_components.a,{href:`#param-hold-until`,children:_jsx(_components.code,{children:`hold_until`})}),`. If a points product is specified, the user’s points balance will be deducted in exchange for specified reward and the reward will be locked.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`billed`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`required`}),` Refers to when the order has been trasmitted to the POS and the user’s credit card has been charged. Any specified reward will be marked as used. Loyalty progress or points will be accrued upon receipt of this event.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`completed`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`recommended`}),` Refers to when the order has been made and transferred to the customer.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`voided`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`recommended`}),` Refers to an order that got canceled after entering the placed state and before entering the billed state. Any locked reward is restored to the user and available for future use. For rewards obtained through a points exchange (points products), the reward instance is finalized as refunded and the points are returned to the user’s points balance — the user can re-exchange those points for a new reward.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`refunded`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`recommended`}),` Refers to an order being refunded / canceled any time after it enters the billed state. Any locked reward is restored to the user and available for future use. For rewards obtained through a points exchange (points products), the reward instance is finalized as refunded and the points are returned to the user’s points balance — the user can re-exchange those points for a new reward.`]})]})]})]}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Only a single reward, points product, or promo code can be applied per order. Supplying a promo code together with a reward or points product returns a 400.`})}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`For more on the difference between locked rewards and points-product rewards\nwhen an order is voided or refunded, see\n`,_jsx(_components.a,{href:`/consumer/best-practices/loyalty#rewards-vs-points-products`,children:`Loyalty Best Practices — Rewards vs Points Products`}),`.`]})}),`\n`,_jsx(Mermaid,{chart:` flowchart LR\n Checkout --> Placed\n Placed --> Voided\n Placed --> Billed\n Billed --> Refunded\n Billed --> Completed\n Completed --> Refunded\n\n classDef default fill:transparent,stroke:#13c1bf,stroke-width:1px;`}),`\n`,_jsx(Heading,{level:`2`,id:`http-request`,children:`HTTP Request`}),`\n`,_jsx(Heading,{level:`3`,id:`parameters`,children:`Parameters`}),`\n`,_jsxs(ParamField,{body:`id`,type:`string`,id:`param-id`,children:[_jsx(_components.p,{children:`Basket unique ID. Partner-generated: your system creates this value and reuses it across every state transition for the same basket.`}),_jsx(Note,{children:_jsxs(_components.p,{children:[`Required for all states other than `,_jsx(_components.code,{children:`checkout`}),`. A `,_jsx(_components.code,{children:`checkout`}),` request may omit the ID; every subsequent state (`,_jsx(_components.code,{children:`placed`}),`, `,_jsx(_components.code,{children:`billed`}),`, `,_jsx(_components.code,{children:`completed`}),`, `,_jsx(_components.code,{children:`voided`}),`, `,_jsx(_components.code,{children:`refunded`}),`) must send the same ID the basket was created with.`]})})]}),`\n`,_jsx(ParamField,{body:`state`,type:`enum`,required:true,id:`param-state`,children:_jsxs(_components.p,{children:[`Basket state (`,_jsx(_components.code,{children:`checkout`}),`, `,_jsx(_components.code,{children:`placed`}),`, `,_jsx(_components.code,{children:`billed`}),`, `,_jsx(_components.code,{children:`completed`}),`, `,_jsx(_components.code,{children:`voided`}),`,\n`,_jsx(_components.code,{children:`refunded`}),`)`]})}),`\n`,_jsxs(ParamField,{body:`order_timestamp`,type:`string`,required:true,id:`param-order-timestamp`,children:[_jsxs(_components.p,{children:[`When the order is wanted in `,_jsx(_components.strong,{children:`(ISO 8601 in UTC)`}),`. If this timestamp is not\nprovided, Thanx assumes the order is wanted ASAP.`]}),_jsx(_components.p,{children:`Providing this timestamp allows Thanx to determine if a reward will be valid in the future (for\nexample, for a weekend only promotion where the user orders in advance).`})]}),`\n`,_jsxs(ParamField,{body:`location_uid`,type:`string`,required:true,id:`param-location-uid`,children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Thanx Location UID`}),` Providing this information allows Thanx to apply reward\nlocation restrictions.`]}),_jsx(_components.p,{children:`A mapping of Thanx location identifiers can be provided by the Thanx developer\nsupport team or fetched from the following endpoints depending on your integration type:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Consumer API `,_jsx(_components.a,{href:`/consumer/locations/get-locations`,children:`Get Locations`}),` endpoint.`]}),`\n`,_jsxs(_components.li,{children:[`Partner API `,_jsx(_components.a,{href:`/partner/metadata/get-locations`,children:`Get Locations`}),` endpoint.`]}),`\n`]})]}),`\n`,_jsxs(ParamField,{body:`rewards`,type:`array(string)`,id:`param-rewards`,children:[_jsx(_components.p,{children:`Reward IDs to apply to the basket.`}),_jsx(_components.p,{children:_jsxs(_components.strong,{children:[`These IDs must be obtained from the rewards field at the `,_jsx(_components.a,{href:`/loyalty/get-account`,children:`Get Account API`}),` response.`]})}),_jsx(_components.p,{children:`If you are integrating with reward codes,\nprovide the reward code here instead.`}),_jsx(Note,{children:_jsx(_components.p,{children:`Currently only a single reward or points product can be applied to a\nbasket. The request will 400 if multiple rewards or points products are\nspecified in the request.`})})]}),`\n`,_jsxs(ParamField,{body:`points_products`,type:`array(string)`,id:`param-points-products`,children:[_jsx(_components.p,{children:`Points Product IDs to apply to the basket.`}),_jsx(_components.p,{children:_jsxs(_components.strong,{children:[`These IDs must be obtained from the points_products field at the `,_jsx(_components.a,{href:`/loyalty/get-account`,children:`Get Account API`}),` response.`]})}),_jsx(Note,{children:_jsx(_components.p,{children:`Currently only a single reward or points product can be applied to a\nbasket. The request will 400 if multiple rewards or points products are\nspecified in the request.`})})]}),`\n`,_jsxs(ParamField,{body:`promo_code`,type:`string`,id:`param-promo-code`,children:[_jsx(Warning,{children:_jsx(_components.p,{children:`Universal Promo Code support is being rolled out and must be enabled for your\naccount by Thanx before it can be used. Contact your Thanx representative to\nrequest access.`})}),_jsx(_components.p,{children:`A Universal Promo Code to apply to the basket, as a 1–64 character string.`}),_jsx(_components.p,{children:`A promo code follows the same lifecycle as a reward:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`checkout`}),` — the code is validated and the resulting `,_jsx(_components.code,{children:`discount`}),` is returned as a preview; nothing is redeemed yet.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`placed`}),` / `,_jsx(_components.code,{children:`billed`}),` / `,_jsx(_components.code,{children:`completed`}),` — the discount is applied and the redemption is recorded (once per basket).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`voided`}),` / `,_jsx(_components.code,{children:`refunded`}),` — any recorded redemption is released.`]}),`\n`]}),_jsx(Note,{children:_jsx(_components.p,{children:`A promo code cannot be combined with a reward or points product. Supplying\nboth returns a 400 — apply one or the other, not both.`})}),_jsx(Note,{children:_jsxs(_components.p,{children:[`A basket `,_jsx(_components.code,{children:`id`}),` is required when applying a promo code, and must be reused\nacross every state update for the basket. The `,_jsx(_components.code,{children:`id`}),` keys the redemption and\nmakes retries idempotent, so resending the same basket will not redeem twice.`]})}),_jsx(Note,{children:_jsx(_components.p,{children:`A member is not required to apply a promo code. If the basket is associated\nwith a member, the order still accrues loyalty as usual; if it is not, the\ndiscount is applied and the redemption is recorded, but the order does not\naccrue loyalty (there is no member to credit).`})})]}),`\n`,_jsxs(ParamField,{body:`hold_until`,type:`string`,id:`param-hold-until`,children:[_jsxs(_components.p,{children:[`When to hold the applied reward until for this order, as an `,_jsx(_components.strong,{children:`ISO 8601 timestamp with an explicit offset`}),` (`,_jsx(_components.code,{children:`Z`}),` or `,_jsx(_components.code,{children:`+hh:mm`}),`), for example `,_jsx(_components.code,{children:`2026-12-24T18:00:00Z`}),`. Use it for orders placed well before they are billed, such as catering or scheduled orders. See `,_jsx(_components.a,{href:`#holding-a-reward-for-scheduled-orders`,children:`Holding a reward for scheduled orders`}),`.`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Default:`}),` when omitted, a reward on a `,_jsx(_components.code,{children:`placed`}),` basket is released back to the user’s wallet about `,_jsx(_components.strong,{children:`2 days`}),` after the basket was placed (the release job runs every 2 hours, so in practice 2 days to roughly 2 days 2 hours), whether or not the order has been billed or voided.`]}),_jsxs(_components.p,{children:[`Validated on the `,_jsx(_components.code,{children:`checkout`}),` and `,_jsx(_components.code,{children:`placed`}),` states, so you learn before placing an order that a hold can’t be honored. Later states ignore the field. The value must be:`]}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`in the future, and `,_jsx(_components.strong,{children:`at least 2 days`}),` from now`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`no more than 365 days`}),` from now`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`before`}),` the reward’s expiration (including a points product’s projected reward expiration). A `,_jsx(_components.code,{children:`hold_until`}),` equal to the expiration is rejected.`]}),`\n`]}),_jsx(Note,{children:_jsxs(_components.p,{children:[`Re-sending `,_jsx(_components.code,{children:`placed`}),` with a later `,_jsx(_components.code,{children:`hold_until`}),` extends the hold; an earlier one never shortens it. Re-sending a `,_jsx(_components.code,{children:`hold_until`}),` the reward is already held through is accepted unchanged, even when it is under 2 days away. Omitting it on a re-send leaves the existing hold alone.`]})})]}),`\n`,_jsxs(ParamField,{body:`payments`,type:`array(hash)`,id:`param-payments`,children:[_jsx(_components.p,{children:`Array of payment methods`}),_jsxs(Expandable,{title:`payment`,children:[_jsx(ParamField,{body:`last4`,type:`string`,id:`param-last4`,children:_jsx(_components.p,{children:`Last 4 digits of the payment method`})}),_jsx(ParamField,{body:`issuer`,type:`string`,required:true,id:`param-issuer`,children:_jsx(_components.p,{children:`Issuer of the payment method`})}),_jsxs(ParamField,{body:`amount`,type:`decimal`,required:true,id:`param-amount`,children:[_jsx(Note,{children:_jsx(_components.p,{children:`Required to generate the purchase and points to the user.`})}),_jsx(_components.p,{children:`Amount used with the payment method`})]}),_jsx(ParamField,{body:`authorized_at`,type:`string`,required:true,id:`param-authorized-at`,children:_jsxs(_components.p,{children:[`The timestamp of when the authorization was submitted to the issuer, in `,_jsx(_components.strong,{children:`ISO8601 format. The timestamp must be expressed in UTC.`})]})})]}),_jsx(Note,{children:_jsx(_components.p,{children:`Currently only a single object is supported. If multiple entries are provided, only the first will be validated and the rest will be ignored.`})})]}),`\n`,_jsxs(ParamField,{body:`items`,type:`array(hash)`,required:true,id:`param-items`,children:[_jsx(_components.p,{children:`Array of items`}),_jsxs(Expandable,{title:`item`,children:[_jsx(ParamField,{body:`id`,type:`string`,id:`param-id-1`,children:_jsx(_components.p,{children:`Item ID in your system / POS`})}),_jsx(ParamField,{body:`name`,type:`string`,id:`param-name`,children:_jsx(_components.p,{children:`Item name`})}),_jsx(ParamField,{body:`price`,type:`decimal`,id:`param-price`,children:_jsx(_components.p,{children:`Item amount`})}),_jsx(ParamField,{body:`categories`,type:`array(string)`,id:`param-categories`,children:_jsx(_components.p,{children:`categories that describe this item`})}),_jsxs(ParamField,{body:`modifiers`,type:`array(hash)`,id:`param-modifiers`,children:[_jsx(_components.p,{children:`Array of modifiers for this item`}),_jsxs(Expandable,{title:`modifier`,children:[_jsx(ParamField,{body:`id`,type:`string`,id:`param-id-2`,children:_jsx(_components.p,{children:`Modifier ID in your system / POS`})}),_jsx(ParamField,{body:`name`,type:`string`,id:`param-name-1`,children:_jsx(_components.p,{children:`Modifier name`})}),_jsx(ParamField,{body:`price`,type:`decimal`,id:`param-price-1`,children:_jsx(_components.p,{children:`Modifier price adjustment`})}),_jsx(ParamField,{body:`item_base_price`,type:`decimal`,id:`param-item-base-price`,children:_jsx(_components.p,{children:`Base price of the item before modifiers`})})]})]})]})]}),`\n`,_jsx(ParamField,{body:`subtotal`,type:`decimal`,required:true,id:`param-subtotal`,children:_jsx(_components.p,{children:`The subtotal of the basket in USD (before taxes \u0026 tips)`})}),`\n`,_jsx(ParamField,{query:`redemption_venue`,type:`string`,optional:true,id:`param-redemption-venue`,children:_jsxs(_components.p,{children:[`Currently either `,_jsx(_components.code,{children:`instore`}),` or `,_jsx(_components.code,{children:`online`}),`, defaults to `,_jsx(_components.code,{children:`online`}),`. This is used to\nadjust which configured product IDs are returned in the applicable reward and\npoints product entities.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`response`,children:`Response`}),`\n`,_jsx(ResponseField,{name:`id`,type:`string`,id:`param-id-3`,children:_jsx(_components.p,{children:`Response ID`})}),`\n`,_jsx(ResponseField,{name:`state`,type:`enum`,id:`param-state-1`,children:_jsxs(_components.p,{children:[`Basket state (`,_jsx(_components.code,{children:`checkout`}),`, `,_jsx(_components.code,{children:`placed`}),`, `,_jsx(_components.code,{children:`billed`}),`, `,_jsx(_components.code,{children:`completed`}),`, `,_jsx(_components.code,{children:`voided`}),`,\n`,_jsx(_components.code,{children:`refunded`}),`)`]})}),`\n`,_jsx(ResponseField,{name:`discount`,type:`string`,id:`param-discount`,children:_jsx(_components.p,{children:`Discount to apply`})}),`\n`,_jsx(Heading,{level:`2`,id:`holding-a-reward-for-scheduled-orders`,children:`Holding a Reward for Scheduled Orders`}),`\n`,_jsxs(_components.p,{children:[`By default, a reward on a `,_jsx(_components.code,{children:`placed`}),` basket is released back to the user about 2 days after the basket was placed. For orders placed well ahead of the day they are billed, send `,_jsx(_components.code,{children:`hold_until`}),` so the reward stays reserved for the order until then.`]}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`checkout`}),`: send the event or fulfillment time as `,_jsx(_components.code,{children:`hold_until`}),`. If the reward would expire before that time, the request returns a `,_jsx(_components.code,{children:`400`}),` so you can ask the user to choose a different reward.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`placed`}),`: send the same `,_jsx(_components.code,{children:`hold_until`}),`. The reward is held until that time.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`billed`}),`: send the order as usual. Billing re-checks reward eligibility against the `,_jsx(_components.code,{children:`order_timestamp`}),` you send, so use the same fulfillment time throughout.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`The hold ends at `,_jsx(_components.code,{children:`hold_until`}),`, when the reward is released back to the user’s wallet. Billing, voiding, or otherwise releasing the reward before then also clears the hold.`]}),`\n`,_jsx(CodeBlock,{filename:`Placed with hold_until`,numberOfLines:`24`,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:`24`,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://loyalty.thanxsandbox.com/api/baskets`}),_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:' \"Authorization: Bearer ${'}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`token`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}\"`}),_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:` \"Accept: application/vnd.thanx-v1+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:' \"Merchant-Key: ${'}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`merchant_key`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}\"`}),_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:` \"id\": \"order-abc-123\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"state\": \"placed\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"order_timestamp\": \"2026-12-24T18:00:00Z\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"hold_until\": \"2026-12-24T18:00:00Z\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"location_uid\": \"LG-567fhwer\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"rewards\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"fheTRR\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_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:` \"items\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_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:` \"id\": \"ng-23492\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"name\": \"Cheese Pizza\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"price\": 20.00`})}),`\n`,_jsx(_components.span,{className:`line`,children:_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:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"subtotal\": 20.00`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`If a reward expires before it can be billed, `,_jsx(_components.code,{children:`billed`}),` returns `,_jsx(_components.code,{children:`400 This reward will expire before the order is fulfilled`}),`.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`hold_until-errors`,children:`hold_until Errors`}),`\n`,_jsxs(_components.p,{children:[`Each failure returns HTTP `,_jsx(_components.code,{children:`400`}),` with `,_jsx(_components.code,{children:`{\"code\": 400, \"message\": ...}`}),`.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Condition`}),_jsx(_components.th,{children:`Message`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Not an ISO 8601 timestamp with an offset`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`hold_until is invalid`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Matches the format but is not a real time (for example, month 13)`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`hold_until is not a valid time`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`In the past`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`hold_until must be in the future`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Less than 2 days from now`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`hold_until must be at least 2 days from now`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`More than 365 days from now`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`hold_until must be no more than 365 days from now`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`At or after the reward’s expiration`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`This reward expires before hold_until. Choose an earlier hold_until or a different reward`})})]})]})]}),`\n`,_jsxs(RequestExample,{children:[_jsx(CodeBlock,{filename:`Reward`,numberOfLines:`43`,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:`43`,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://loyalty.thanxsandbox.com/api/baskets`}),_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:' \"Authorization: Bearer ${'}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`token`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}\"`}),_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:` \"Accept: application/vnd.thanx-v1+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:' \"Merchant-Key: ${'}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`merchant_key`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}\"`}),_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:` \"id\": \"gwer-werwr-2134-rty\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"state\": \"billed\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"order_timestamp\": \"2019-05-08T18:02:05Z\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"location_uid\": \"LG-567fhwer\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"rewards\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"fheTRR\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_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:` \"payments\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_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:` \"issuer\": \"visa\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"last4\": \"1234\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"amount\": 10.45,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"authorized_at\": \"2019-05-07T18:02:05Z\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_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:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"items\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_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:` \"id\": \"ng-23492\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"name\": \"Cheese Pizza\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"price\": 9.95,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"categories\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"pizza\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"vegetarian\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_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:` \"modifiers\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_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:` \"id\": \"mod-123\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"name\": \"Extra Cheese\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"price\": 1.50,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"item_base_price\": 8.45`})}),`\n`,_jsx(_components.span,{className:`line`,children:_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:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_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:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"subtotal\": 23.45`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Promo code`,numberOfLines:`32`,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:`32`,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://loyalty.thanxsandbox.com/api/baskets`}),_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:' \"Authorization: Bearer ${'}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`token`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}\"`}),_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:` \"Accept: application/vnd.thanx-v1+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:' \"Merchant-Key: ${'}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`merchant_key`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}\"`}),_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:` \"id\": \"order-abc-123\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"state\": \"billed\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"order_timestamp\": \"2026-06-08T18:02:05Z\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"location_uid\": \"LG-567fhwer\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"promo_code\": \"SUMMER10\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"payments\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_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:` \"issuer\": \"visa\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"last4\": \"1234\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"amount\": 20.00,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"authorized_at\": \"2026-06-07T18:02:05Z\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_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:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"items\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_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:` \"id\": \"ng-23492\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"name\": \"Cheese Pizza\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"price\": 20.00,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"categories\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"pizza\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_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:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_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:` \"subtotal\": 20.00`})}),`\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:`5`,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:`5`,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:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"fhwerwe-23663-ryryre\"`}),_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:`\"checkout\"`}),_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\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"10.25\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`400 Invalid reward`,numberOfLines:`4`,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:`4`,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:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 400,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"The reward was not found in our system\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`400 Reward conflict`,numberOfLines:`4`,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:`4`,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:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 400,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"A promo code cannot be combined with a reward or points product\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`400 Invalid promo`,numberOfLines:`4`,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:`4`,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:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 400,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"This promo code is not valid\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`400 Invalid hold_until`,numberOfLines:`4`,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:`4`,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:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 400,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"hold_until must be at least 2 days from now\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`400 Reward expires before hold_until`,numberOfLines:`4`,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:`4`,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:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 400,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"This reward expires before hold_until. Choose an earlier hold_until or a different reward\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`401`,numberOfLines:`4`,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:`4`,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:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 401,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"There was an error authenticating you.\"`})]}),`\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 \u0026 Update Basket","api":"POST https://loyalty.thanxsandbox.com/api/baskets","description":"This endpoint is used to notify Thanx of the states that a basket is in, apply rewards to the order, and accrue loyalty progress or points for the order.","href":"/loyalty/create-update-basket"}}}},"mdxExtracts":{"tableOfContents":[{"title":"HTTP Request","slug":"http-request","depth":2,"children":[{"title":"Parameters","slug":"parameters","depth":3,"children":[]},{"title":"Response","slug":"response","depth":3,"children":[]}]},{"title":"Holding a Reward for Scheduled Orders","slug":"holding-a-reward-for-scheduled-orders","depth":2,"children":[{"title":"hold_until Errors","slug":"hold_until-errors","depth":3,"children":[]}]}],"codeExamples":{"request":{"type":"RequestExample","children":[{"filename":"Reward","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=\"43\">\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\">curl\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> https://loyalty.thanxsandbox.com/api/baskets\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\"> \"Authorization: Bearer ${\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">token\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">}\"\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\"> \"Accept: application/vnd.thanx-v1+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\"> \"Merchant-Key: ${\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">merchant_key\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">}\"\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\"> \"id\": \"gwer-werwr-2134-rty\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"state\": \"billed\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"order_timestamp\": \"2019-05-08T18:02:05Z\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"location_uid\": \"LG-567fhwer\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"rewards\": [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"fheTRR\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> ],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"payments\": [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"issuer\": \"visa\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"last4\": \"1234\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"amount\": 10.45,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"authorized_at\": \"2019-05-07T18:02:05Z\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> ],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"items\": [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"id\": \"ng-23492\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"name\": \"Cheese Pizza\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"price\": 9.95,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"categories\": [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"pizza\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"vegetarian\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> ],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"modifiers\": [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"id\": \"mod-123\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"name\": \"Extra Cheese\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"price\": 1.50,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"item_base_price\": 8.45\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> ]\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> ],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"subtotal\": 23.45\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":"Promo 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=\"32\">\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\">curl\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> https://loyalty.thanxsandbox.com/api/baskets\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\"> \"Authorization: Bearer ${\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">token\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">}\"\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\"> \"Accept: application/vnd.thanx-v1+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\"> \"Merchant-Key: ${\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">merchant_key\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">}\"\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\"> \"id\": \"order-abc-123\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"state\": \"billed\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"order_timestamp\": \"2026-06-08T18:02:05Z\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"location_uid\": \"LG-567fhwer\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"promo_code\": \"SUMMER10\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"payments\": [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"issuer\": \"visa\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"last4\": \"1234\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"amount\": 20.00,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"authorized_at\": \"2026-06-07T18:02:05Z\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> ],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"items\": [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"id\": \"ng-23492\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"name\": \"Cheese Pizza\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"price\": 20.00,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"categories\": [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"pizza\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> ]\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> ],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"subtotal\": 20.00\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=\"5\">\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\"> \"id\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"fhwerwe-23663-ryryre\"\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\">\"checkout\"\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\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"10.25\"\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":"400 Invalid reward","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=\"4\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\"> \"code\"\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#DCDCAA\">:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 400,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\"> \"message\"\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#DCDCAA\">:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"The reward was not found in our system\"\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":"400 Reward conflict","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=\"4\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\"> \"code\"\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#DCDCAA\">:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 400,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\"> \"message\"\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#DCDCAA\">:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"A promo code cannot be combined with a reward or points product\"\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":"400 Invalid promo","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=\"4\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\"> \"code\"\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#DCDCAA\">:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 400,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\"> \"message\"\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#DCDCAA\">:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"This promo code is not valid\"\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":"400 Invalid hold_until","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=\"4\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\"> \"code\"\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#DCDCAA\">:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 400,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\"> \"message\"\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#DCDCAA\">:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"hold_until must be at least 2 days from now\"\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":"400 Reward expires before hold_until","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=\"4\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\"> \"code\"\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#DCDCAA\">:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 400,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\"> \"message\"\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#DCDCAA\">:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"This reward expires before hold_until. Choose an earlier hold_until or a different reward\"\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":"401","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=\"4\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\"> \"code\"\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#DCDCAA\">:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 401,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\"> \"message\"\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#DCDCAA\">:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"There was an error authenticating you.\"\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 \u0026 Update Basket","path":"/api/baskets","servers":[{"url":"https://loyalty.thanxsandbox.com"}],"method":"post","request":{"security":[],"parameters":{"query":{"redemption_venue":{"schema":[{"type":"string","description":"Currently either `instore` or `online` , defaults to `online` . This is used to adjust which configured product IDs are returned in the applicable reward and points product entities."}]}},"header":{},"cookie":{},"path":{}},"body":{"application/json":{"schemaArray":[{"type":"object","properties":{"id":[{"type":"string","description":"Basket unique ID. Partner-generated: your system creates this value and reuses it across every state transition for the same basket."}],"state":[{"type":"object","properties":{},"description":"Basket state ( `checkout` , `placed` , `billed` , `completed` , `voided` , `refunded` )","required":true}],"order_timestamp":[{"type":"string","description":"When the order is wanted in (ISO 8601 in UTC) . If this timestamp is not provided, Thanx assumes the order is wanted ASAP. Providing this timestamp allows Thanx to determine if a reward will be valid in the future (for example, for a weekend only promotion where the user orders in advance).","required":true}],"location_uid":[{"type":"string","description":"Thanx Location UID Providing this information allows Thanx to apply reward location restrictions. A mapping of Thanx location identifiers can be provided by the Thanx developer support team or fetched from the following endpoints depending on your integration type: Consumer API Get Locations endpoint. Partner API Get Locations endpoint.","required":true}],"rewards":[{"type":"object","properties":{},"description":"Reward IDs to apply to the basket. These IDs must be obtained from the rewards field at the Get Account API response. If you are integrating with reward codes, provide the reward code here instead."}],"points_products":[{"type":"object","properties":{},"description":"Points Product IDs to apply to the basket. These IDs must be obtained from the points_products field at the Get Account API response."}],"promo_code":[{"type":"string","description":"A Universal Promo Code to apply to the basket, as a 1–64 character string. A promo code follows the same lifecycle as a reward: `checkout` — the code is validated and the resulting `discount` is returned as a preview; nothing is redeemed yet. `placed` / `billed` / `completed` — the discount is applied and the redemption is recorded (once per basket). `voided` / `refunded` — any recorded redemption is released."}],"hold_until":[{"type":"string","description":"When to hold the applied reward until for this order, as an ISO 8601 timestamp with an explicit offset ( `Z` or `+hh:mm` ), for example `2026-12-24T18:00:00Z` . Use it for orders placed well before they are billed, such as catering or scheduled orders. See Holding a reward for scheduled orders . Default: when omitted, a reward on a `placed` basket is released back to the user’s wallet about 2 days after the basket was placed (the release job runs every 2 hours, so in practice 2 days to roughly 2 days 2 hours), whether or not the order has been billed or voided. Validated on the `checkout` and `placed` states, so you learn before placing an order that a hold can’t be honored. Later states ignore the field. The value must be: in the future, and at least 2 days from now no more than 365 days from now before the reward’s expiration (including a points product’s projected reward expiration). A `hold_until` equal to the expiration is rejected."}],"payments":[{"type":"object","properties":{"last4":[{"type":"string","description":"Last 4 digits of the payment method"}],"issuer":[{"type":"string","description":"Issuer of the payment method","required":true}],"amount":[{"type":"number","description":"Amount used with the payment method","required":true}],"authorized_at":[{"type":"string","description":"The timestamp of when the authorization was submitted to the issuer, in ISO8601 format. The timestamp must be expressed in UTC.","required":true}]},"description":"Array of payment methods"}],"items":[{"type":"object","properties":{"id":[{"type":"string","description":"Item ID in your system / POS"}],"name":[{"type":"string","description":"Item name"}],"price":[{"type":"number","description":"Item amount"}],"categories":[{"type":"object","properties":{},"description":"categories that describe this item"}],"modifiers":[{"type":"object","properties":{"id":[{"type":"string","description":"Modifier ID in your system / POS"}],"name":[{"type":"string","description":"Modifier name"}],"price":[{"type":"number","description":"Modifier price adjustment"}],"item_base_price":[{"type":"number","description":"Base price of the item before modifiers"}]},"description":"Array of modifiers for this item"}]},"description":"Array of items","required":true}],"subtotal":[{"type":"number","description":"The subtotal of the basket in USD (before taxes \u0026 tips)","required":true}]}}],"examples":{"example":{"value":{"id":"\u003cstring>","state":{},"order_timestamp":"\u003cstring>","location_uid":"\u003cstring>","rewards":{},"points_products":{},"promo_code":"\u003cstring>","hold_until":"\u003cstring>","payments":{"last4":"\u003cstring>","issuer":"\u003cstring>","amount":123,"authorized_at":"\u003cstring>"},"items":{"id":"\u003cstring>","name":"\u003cstring>","price":123,"categories":{},"modifiers":{"id":"\u003cstring>","name":"\u003cstring>","price":123,"item_base_price":123}},"subtotal":123}}}}}},"response":{"200":{"application/json":{"schemaArray":[{"type":"object","properties":{"id":[{"type":"string","description":"Response ID"}],"state":[{"type":"object","properties":{},"description":"Basket state ( `checkout` , `placed` , `billed` , `completed` , `voided` , `refunded` )"}],"discount":[{"type":"string","description":"Discount to apply"}]}}],"examples":{"example":{"value":{"id":"\u003cstring>","state":{},"discount":"\u003cstring>"}}}}}},"deprecated":false}},"jsLinks":[],"subdomain":"thanx","siteName":"Thanx","title":"Create \u0026 Update Basket - Thanx","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-21T06:16:26.100Z","originalFileLocation":"loyalty/create-update-basket.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=\"This endpoint is used to notify Thanx of the states that a basket is in, apply rewards to the order, and accrue loyalty progress or points for the order.\">\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 \u0026amp; Update Basket - Thanx\">\u003cmeta data-mint-head property=\"og:description\" content=\"This endpoint is used to notify Thanx of the states that a basket is in, apply rewards to the order, and accrue loyalty progress or points for the order.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Thanx\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.thanx.com/loyalty/create-update-basket\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://thanx.mintlify.app/_mintlify/api/og/v2?division=Reference\u0026amp;title=Create+%26+Update+Basket\u0026amp;description=This+endpoint+is+used+to+notify+Thanx+of+the+states+that+a+basket+is+in%2C+apply+rewards+to+the+order%2C+and+accrue+loyalty+progress+or+points+for+the+order.\u0026amp;theme=547b57199640445129b8df81\u0026amp;signature=3f6d41e5eafe9e10d8f24e6a7722a09b0413d468e96b409e9a8b30c21db99de7\">\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 \u0026amp; Update Basket - Thanx\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"This endpoint is used to notify Thanx of the states that a basket is in, apply rewards to the order, and accrue loyalty progress or points for the order.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://thanx.mintlify.app/_mintlify/api/og/v2?division=Reference\u0026amp;title=Create+%26+Update+Basket\u0026amp;description=This+endpoint+is+used+to+notify+Thanx+of+the+states+that+a+basket+is+in%2C+apply+rewards+to+the+order%2C+and+accrue+loyalty+progress+or+points+for+the+order.\u0026amp;theme=547b57199640445129b8df81\u0026amp;signature=3f6d41e5eafe9e10d8f24e6a7722a09b0413d468e96b409e9a8b30c21db99de7\">\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/loyalty/create-update-basket\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/loyalty/create-update-basket.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/loyalty/create-update-basket#webpage\",\"url\":\"https://docs.thanx.com/loyalty/create-update-basket\",\"name\":\"Create \u0026 Update Basket\",\"description\":\"This endpoint is used to notify Thanx of the states that a basket is in, apply rewards to the order, and accrue loyalty progress or points for the order.\",\"dateModified\":\"2026-10-21T06:16:26.100Z\",\"isPartOf\":{\"@id\":\"https://docs.thanx.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.thanx.com/loyalty/create-update-basket#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.thanx.com/loyalty/create-update-basket#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Reference\",\"item\":\"https://docs.thanx.com/loyalty/headers\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create \u0026 Update Basket\",\"item\":\"https://docs.thanx.com/loyalty/create-update-basket\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.thanx.com/loyalty/create-update-basket#apireference\",\"headline\":\"Create \u0026 Update Basket\",\"name\":\"Create \u0026 Update Basket\",\"description\":\"This endpoint is used to notify Thanx of the states that a basket is in, apply rewards to the order, and accrue loyalty progress or points for the order.\",\"url\":\"https://docs.thanx.com/loyalty/create-update-basket\",\"mainEntityOfPage\":{\"@id\":\"https://docs.thanx.com/loyalty/create-update-basket#webpage\"},\"dateModified\":\"2026-10-21T06:16:26.100Z\",\"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\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","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":[{"title":"Partner API","href":"/partner/overview"}]},{"tab":"Loyalty API","pages":[{"group":"Loyalty API","pages":[{"title":"Overview","href":"/loyalty/overview"},{"title":"AWS PrivateLink","href":"/loyalty/private-link"}]},{"group":"Reference","pages":[{"title":"Headers","href":"/loyalty/headers"},{"title":"Get Account","api":"GET https://loyalty.thanxsandbox.com/api/account","description":"This endpoint allows the retrieval of a user account information, including the user's rewards.","href":"/loyalty/get-account"},{"title":"Create \u0026 Update Basket","api":"POST https://loyalty.thanxsandbox.com/api/baskets","href":"/loyalty/create-update-basket"},{"title":"Qualifying Rewards for a Basket","api":"POST https://loyalty.thanxsandbox.com/api/baskets/qualifying","description":"Returns the subset of the user's rewards and points products that would actually produce a discount against a given basket. Read-only dry-run companion to Create \u0026 Update Basket — no state is mutated, no reward is redeemed, and no points are debited.","href":"/loyalty/qualifying-baskets"}]}]},{"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"}]}]},"title":"Create \u0026 Update Basket - Thanx","buildId":"dpl_2oYXwqkEXirXBPk8wV1FtM5USFWi","deploymentId":"dpl_2oYXwqkEXirXBPk8wV1FtM5USFWi","dynamics":["c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["OpenApiReferenceProvider-WRhTSUDL.js","utils-ChMov4Kr.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-_REmC2bI.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-Bp6nVRCu.js","snippetPresets-DZadmXoU.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-CY2WdoTl.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-DwYG-Q4l.js","shallow-BXQIGwv4.js","getApiPlaygroundDisplay-CK5nK5B9.js","CodeSnippet-TH4a2aGW.js","CodeSnippets-DwsQiOFS.js","Page-R3M_BF4L.js","getPastedJson-DD7kUzi_.js","icon-holE3QoJ.js","MethodPill-DUW0T8us.js","DuplicateIcon-CI_p4be-.js","createIcon-BdbRvavb.js","DynamicMarkdown-DN96a4Ur.js","SectionHeading-SCu36A9d.js","axios-vUo_bRtp.js"]}