[{"data":1,"prerenderedAt":1400},["ShallowReactive",2],{"navigation_docs":3,"-guides-discounts":494,"-guides-discounts-surround":1395},[4,8,70,123,479],{"title":5,"path":6,"stem":7},"Introduction","\u002Fintroduction","0.introduction",{"title":9,"path":10,"stem":11,"children":12,"page":69},"Guides","\u002Fguides","1.guides",[13,17,21,25,29,33,37,41,45,49,53,57,61,65],{"title":14,"path":15,"stem":16},"Quickstart","\u002Fguides\u002Fquickstart","1.guides\u002F1.quickstart",{"title":18,"path":19,"stem":20},"Payouts & Settlement","\u002Fguides\u002Fpayouts","1.guides\u002F10.payouts",{"title":22,"path":23,"stem":24},"Customer Emails","\u002Fguides\u002Fcustomer-emails","1.guides\u002F11.customer-emails",{"title":26,"path":27,"stem":28},"Migrate from Lemon Squeezy","\u002Fguides\u002Fmigrate-from-lemon-squeezy","1.guides\u002F12.migrate-from-lemon-squeezy",{"title":30,"path":31,"stem":32},"Discounts","\u002Fguides\u002Fdiscounts","1.guides\u002F13.discounts",{"title":34,"path":35,"stem":36},"Build your own integration","\u002Fguides\u002Fbuild-your-own-integration","1.guides\u002F2.build-your-own-integration",{"title":38,"path":39,"stem":40},"Selling Workflow","\u002Fguides\u002Fselling-workflow","1.guides\u002F2.selling-workflow",{"title":42,"path":43,"stem":44},"Vatly SDKs","\u002Fguides\u002Fsdks","1.guides\u002F3.sdks",{"title":46,"path":47,"stem":48},"Authentication","\u002Fguides\u002Fauthentication","1.guides\u002F4.authentication",{"title":50,"path":51,"stem":52},"Pagination","\u002Fguides\u002Fpagination","1.guides\u002F5.pagination",{"title":54,"path":55,"stem":56},"Errors","\u002Fguides\u002Ferrors","1.guides\u002F6.errors",{"title":58,"path":59,"stem":60},"Webhooks","\u002Fguides\u002Fwebhooks","1.guides\u002F7.webhooks",{"title":62,"path":63,"stem":64},"Idempotency","\u002Fguides\u002Fidempotency","1.guides\u002F8.idempotency",{"title":66,"path":67,"stem":68},"Testing","\u002Fguides\u002Ftesting","1.guides\u002F9.testing",false,{"title":71,"path":72,"stem":73,"children":74,"page":69},"Api Reference","\u002Fapi-reference","2.api-reference",[75,79,83,87,91,95,99,103,107,111,115,119],{"title":76,"path":77,"stem":78},"Customers","\u002Fapi-reference\u002Fcustomers","2.api-reference\u002F1.customers",{"title":80,"path":81,"stem":82},"Webhook Endpoints","\u002Fapi-reference\u002Fwebhook-endpoints","2.api-reference\u002F10.webhook-endpoints",{"title":84,"path":85,"stem":86},"Test helpers","\u002Fapi-reference\u002Ftest-helpers","2.api-reference\u002F11.test-helpers",{"title":88,"path":89,"stem":90},"Checkouts","\u002Fapi-reference\u002Fcheckouts","2.api-reference\u002F2.checkouts",{"title":92,"path":93,"stem":94},"One-off Products","\u002Fapi-reference\u002Fone-off-products","2.api-reference\u002F3.one-off-products",{"title":96,"path":97,"stem":98},"Subscriptions","\u002Fapi-reference\u002Fsubscriptions","2.api-reference\u002F4.subscriptions",{"title":100,"path":101,"stem":102},"Subscription Plans","\u002Fapi-reference\u002Fsubscription-plans","2.api-reference\u002F5.subscription-plans",{"title":104,"path":105,"stem":106},"Orders","\u002Fapi-reference\u002Forders","2.api-reference\u002F6.orders",{"title":108,"path":109,"stem":110},"Order Refunds","\u002Fapi-reference\u002Frefunds","2.api-reference\u002F7.refunds",{"title":112,"path":113,"stem":114},"Refunds","\u002Fapi-reference\u002Fglobal-refunds","2.api-reference\u002F8.global-refunds",{"title":116,"path":117,"stem":118},"Chargebacks","\u002Fapi-reference\u002Fchargebacks","2.api-reference\u002F9.chargebacks",{"title":120,"path":121,"stem":122},"Webhook Events","\u002Fapi-reference\u002Fwebhook-events","2.api-reference\u002F99.webhook-events",{"title":124,"path":125,"stem":126,"children":127},"Packages","\u002Fpackages","3.packages",[128,131,173,185,193,239,273,312,347,395,437],{"title":129,"path":125,"stem":130},"SDKs & Packages","3.packages\u002Findex",{"title":132,"path":133,"stem":134,"children":135,"page":69},"PHP SDK","\u002Fpackages\u002Fphp","3.packages\u002F1.php",[136,140,143,146,149,153,156,160,163,166,169],{"title":137,"path":138,"stem":139},"Getting started","\u002Fpackages\u002Fphp\u002Freadme","3.packages\u002F1.php\u002F00.readme",{"title":76,"path":141,"stem":142},"\u002Fpackages\u002Fphp\u002Fcustomers","3.packages\u002F1.php\u002F02.customers",{"title":88,"path":144,"stem":145},"\u002Fpackages\u002Fphp\u002Fcheckouts","3.packages\u002F1.php\u002F03.checkouts",{"title":96,"path":147,"stem":148},"\u002Fpackages\u002Fphp\u002Fsubscriptions","3.packages\u002F1.php\u002F04.subscriptions",{"title":150,"path":151,"stem":152},"Subscription plans","\u002Fpackages\u002Fphp\u002Fsubscriptionplans","3.packages\u002F1.php\u002F05.subscriptionplans",{"title":104,"path":154,"stem":155},"\u002Fpackages\u002Fphp\u002Forders","3.packages\u002F1.php\u002F06.orders",{"title":157,"path":158,"stem":159},"One-off products","\u002Fpackages\u002Fphp\u002Foneoffproducts","3.packages\u002F1.php\u002F07.oneoffproducts",{"title":112,"path":161,"stem":162},"\u002Fpackages\u002Fphp\u002Frefunds","3.packages\u002F1.php\u002F08.refunds",{"title":116,"path":164,"stem":165},"\u002Fpackages\u002Fphp\u002Fchargebacks","3.packages\u002F1.php\u002F09.chargebacks",{"title":58,"path":167,"stem":168},"\u002Fpackages\u002Fphp\u002Fwebhooks","3.packages\u002F1.php\u002F10.webhooks",{"title":170,"path":171,"stem":172},"Webhook URLs","\u002Fpackages\u002Fphp\u002Fwebhookendpoints","3.packages\u002F1.php\u002F11.webhookendpoints",{"title":174,"path":175,"stem":176,"children":177,"page":69},"FluentCart","\u002Fpackages\u002Ffluentcart","3.packages\u002F10.fluentcart",[178,181],{"title":137,"path":179,"stem":180},"\u002Fpackages\u002Ffluentcart\u002Freadme","3.packages\u002F10.fluentcart\u002F00.readme",{"title":182,"path":183,"stem":184},"Invoicing internals","\u002Fpackages\u002Ffluentcart\u002Fmerchant-of-record","3.packages\u002F10.fluentcart\u002F01.merchant-of-record",{"title":186,"path":187,"stem":188,"children":189,"page":69},"PMPro","\u002Fpackages\u002Fpmpro","3.packages\u002F11.pmpro",[190],{"title":137,"path":191,"stem":192},"\u002Fpackages\u002Fpmpro\u002Freadme","3.packages\u002F11.pmpro\u002F00.readme",{"title":194,"path":195,"stem":196,"children":197,"page":69},"PHP Fluent","\u002Fpackages\u002Ffluent-php","3.packages\u002F2.fluent-php",[198,201,205,209,212,215,218,221,225,228,232,236],{"title":137,"path":199,"stem":200},"\u002Fpackages\u002Ffluent-php\u002Freadme","3.packages\u002F2.fluent-php\u002F00.readme",{"title":202,"path":203,"stem":204},"Configuration","\u002Fpackages\u002Ffluent-php\u002Fconfiguration","3.packages\u002F2.fluent-php\u002F01.configuration",{"title":206,"path":207,"stem":208},"Core concepts","\u002Fpackages\u002Ffluent-php\u002Fcoreconcepts","3.packages\u002F2.fluent-php\u002F02.coreconcepts",{"title":76,"path":210,"stem":211},"\u002Fpackages\u002Ffluent-php\u002Fcustomers","3.packages\u002F2.fluent-php\u002F03.customers",{"title":88,"path":213,"stem":214},"\u002Fpackages\u002Ffluent-php\u002Fcheckouts","3.packages\u002F2.fluent-php\u002F04.checkouts",{"title":96,"path":216,"stem":217},"\u002Fpackages\u002Ffluent-php\u002Fsubscriptions","3.packages\u002F2.fluent-php\u002F05.subscriptions",{"title":104,"path":219,"stem":220},"\u002Fpackages\u002Ffluent-php\u002Forders","3.packages\u002F2.fluent-php\u002F06.orders",{"title":222,"path":223,"stem":224},"Customer portal","\u002Fpackages\u002Ffluent-php\u002Fcustomerportal","3.packages\u002F2.fluent-php\u002F07.customerportal",{"title":58,"path":226,"stem":227},"\u002Fpackages\u002Ffluent-php\u002Fwebhooks","3.packages\u002F2.fluent-php\u002F08.webhooks",{"title":229,"path":230,"stem":231},"Webhook event flow","\u002Fpackages\u002Ffluent-php\u002Fwebhook-flow","3.packages\u002F2.fluent-php\u002F09.webhook-flow",{"title":233,"path":234,"stem":235},"Existing tables","\u002Fpackages\u002Ffluent-php\u002Fhost-owns-its-tables","3.packages\u002F2.fluent-php\u002F10.host-owns-its-tables",{"title":66,"path":237,"stem":238},"\u002Fpackages\u002Ffluent-php\u002Ftesting","3.packages\u002F2.fluent-php\u002F11.testing",{"title":240,"path":241,"stem":242,"children":243,"page":69},"Laravel","\u002Fpackages\u002Flaravel","3.packages\u002F3.laravel",[244,247,250,253,256,259,262,265,269],{"title":137,"path":245,"stem":246},"\u002Fpackages\u002Flaravel\u002Freadme","3.packages\u002F3.laravel\u002F00.readme",{"title":202,"path":248,"stem":249},"\u002Fpackages\u002Flaravel\u002Fconfiguration","3.packages\u002F3.laravel\u002F01.configuration",{"title":76,"path":251,"stem":252},"\u002Fpackages\u002Flaravel\u002Fcustomers","3.packages\u002F3.laravel\u002F02.customers",{"title":88,"path":254,"stem":255},"\u002Fpackages\u002Flaravel\u002Fcheckouts","3.packages\u002F3.laravel\u002F03.checkouts",{"title":96,"path":257,"stem":258},"\u002Fpackages\u002Flaravel\u002Fsubscriptions","3.packages\u002F3.laravel\u002F04.subscriptions",{"title":104,"path":260,"stem":261},"\u002Fpackages\u002Flaravel\u002Forders","3.packages\u002F3.laravel\u002F05.orders",{"title":58,"path":263,"stem":264},"\u002Fpackages\u002Flaravel\u002Fwebhooks","3.packages\u002F3.laravel\u002F06.webhooks",{"title":266,"path":267,"stem":268},"Comparison","\u002Fpackages\u002Flaravel\u002Fcomparison","3.packages\u002F3.laravel\u002F07.comparison",{"title":270,"path":271,"stem":272},"Migrating from Cashier","\u002Fpackages\u002Flaravel\u002Fmigrating-to-vatly","3.packages\u002F3.laravel\u002F08.migrating-to-vatly",{"title":274,"path":275,"stem":276,"children":277,"page":69},"JavaScript SDK","\u002Fpackages\u002Fjavascript","3.packages\u002F4.javascript",[278,281,284,287,290,293,296,299,302,305,308],{"title":137,"path":279,"stem":280},"\u002Fpackages\u002Fjavascript\u002Freadme","3.packages\u002F4.javascript\u002F00.readme",{"title":76,"path":282,"stem":283},"\u002Fpackages\u002Fjavascript\u002Fcustomers","3.packages\u002F4.javascript\u002F02.customers",{"title":88,"path":285,"stem":286},"\u002Fpackages\u002Fjavascript\u002Fcheckouts","3.packages\u002F4.javascript\u002F03.checkouts",{"title":96,"path":288,"stem":289},"\u002Fpackages\u002Fjavascript\u002Fsubscriptions","3.packages\u002F4.javascript\u002F04.subscriptions",{"title":150,"path":291,"stem":292},"\u002Fpackages\u002Fjavascript\u002Fsubscriptionplans","3.packages\u002F4.javascript\u002F05.subscriptionplans",{"title":104,"path":294,"stem":295},"\u002Fpackages\u002Fjavascript\u002Forders","3.packages\u002F4.javascript\u002F06.orders",{"title":157,"path":297,"stem":298},"\u002Fpackages\u002Fjavascript\u002Foneoffproducts","3.packages\u002F4.javascript\u002F07.oneoffproducts",{"title":112,"path":300,"stem":301},"\u002Fpackages\u002Fjavascript\u002Frefunds","3.packages\u002F4.javascript\u002F08.refunds",{"title":116,"path":303,"stem":304},"\u002Fpackages\u002Fjavascript\u002Fchargebacks","3.packages\u002F4.javascript\u002F09.chargebacks",{"title":58,"path":306,"stem":307},"\u002Fpackages\u002Fjavascript\u002Fwebhooks","3.packages\u002F4.javascript\u002F10.webhooks",{"title":309,"path":310,"stem":311},"API reference","\u002Fpackages\u002Fjavascript\u002Fapi","3.packages\u002F4.javascript\u002F12.api",{"title":313,"path":314,"stem":315,"children":316,"page":69},"JavaScript Fluent","\u002Fpackages\u002Ffluent-js","3.packages\u002F5.fluent-js",[317,320,323,326,329,332,335,338,341,344],{"title":137,"path":318,"stem":319},"\u002Fpackages\u002Ffluent-js\u002Freadme","3.packages\u002F5.fluent-js\u002F00.readme",{"title":202,"path":321,"stem":322},"\u002Fpackages\u002Ffluent-js\u002Fconfiguration","3.packages\u002F5.fluent-js\u002F01.configuration",{"title":206,"path":324,"stem":325},"\u002Fpackages\u002Ffluent-js\u002Fcoreconcepts","3.packages\u002F5.fluent-js\u002F02.coreconcepts",{"title":76,"path":327,"stem":328},"\u002Fpackages\u002Ffluent-js\u002Fcustomers","3.packages\u002F5.fluent-js\u002F03.customers",{"title":88,"path":330,"stem":331},"\u002Fpackages\u002Ffluent-js\u002Fcheckouts","3.packages\u002F5.fluent-js\u002F04.checkouts",{"title":96,"path":333,"stem":334},"\u002Fpackages\u002Ffluent-js\u002Fsubscriptions","3.packages\u002F5.fluent-js\u002F05.subscriptions",{"title":104,"path":336,"stem":337},"\u002Fpackages\u002Ffluent-js\u002Forders","3.packages\u002F5.fluent-js\u002F06.orders",{"title":222,"path":339,"stem":340},"\u002Fpackages\u002Ffluent-js\u002Fcustomerportal","3.packages\u002F5.fluent-js\u002F07.customerportal",{"title":58,"path":342,"stem":343},"\u002Fpackages\u002Ffluent-js\u002Fwebhooks","3.packages\u002F5.fluent-js\u002F08.webhooks",{"title":66,"path":345,"stem":346},"\u002Fpackages\u002Ffluent-js\u002Ftesting","3.packages\u002F5.fluent-js\u002F11.testing",{"title":348,"path":349,"stem":350,"children":351,"page":69},"Python SDK","\u002Fpackages\u002Fpython","3.packages\u002F6.python",[352,355,358,361,364,367,370,373,376,379,382,385,388,391],{"title":137,"path":353,"stem":354},"\u002Fpackages\u002Fpython\u002Freadme","3.packages\u002F6.python\u002F00.readme",{"title":202,"path":356,"stem":357},"\u002Fpackages\u002Fpython\u002Fconfiguration","3.packages\u002F6.python\u002F01.configuration",{"title":76,"path":359,"stem":360},"\u002Fpackages\u002Fpython\u002Fcustomers","3.packages\u002F6.python\u002F02.customers",{"title":88,"path":362,"stem":363},"\u002Fpackages\u002Fpython\u002Fcheckouts","3.packages\u002F6.python\u002F03.checkouts",{"title":96,"path":365,"stem":366},"\u002Fpackages\u002Fpython\u002Fsubscriptions","3.packages\u002F6.python\u002F04.subscriptions",{"title":150,"path":368,"stem":369},"\u002Fpackages\u002Fpython\u002Fsubscriptionplans","3.packages\u002F6.python\u002F05.subscriptionplans",{"title":104,"path":371,"stem":372},"\u002Fpackages\u002Fpython\u002Forders","3.packages\u002F6.python\u002F06.orders",{"title":157,"path":374,"stem":375},"\u002Fpackages\u002Fpython\u002Foneoffproducts","3.packages\u002F6.python\u002F07.oneoffproducts",{"title":112,"path":377,"stem":378},"\u002Fpackages\u002Fpython\u002Frefunds","3.packages\u002F6.python\u002F08.refunds",{"title":116,"path":380,"stem":381},"\u002Fpackages\u002Fpython\u002Fchargebacks","3.packages\u002F6.python\u002F09.chargebacks",{"title":58,"path":383,"stem":384},"\u002Fpackages\u002Fpython\u002Fwebhooks","3.packages\u002F6.python\u002F10.webhooks",{"title":170,"path":386,"stem":387},"\u002Fpackages\u002Fpython\u002Fwebhookendpoints","3.packages\u002F6.python\u002F11.webhookendpoints",{"title":309,"path":389,"stem":390},"\u002Fpackages\u002Fpython\u002Fapi","3.packages\u002F6.python\u002F12.api",{"title":392,"path":393,"stem":394},"Development","\u002Fpackages\u002Fpython\u002Fdevelopment","3.packages\u002F6.python\u002F13.development",{"title":396,"path":397,"stem":398,"children":399,"page":69},"Python Fluent","\u002Fpackages\u002Ffluent-python","3.packages\u002F7.fluent-python",[400,403,406,409,412,415,418,421,424,427,430,434],{"title":137,"path":401,"stem":402},"\u002Fpackages\u002Ffluent-python\u002Freadme","3.packages\u002F7.fluent-python\u002F00.readme",{"title":202,"path":404,"stem":405},"\u002Fpackages\u002Ffluent-python\u002Fconfiguration","3.packages\u002F7.fluent-python\u002F01.configuration",{"title":206,"path":407,"stem":408},"\u002Fpackages\u002Ffluent-python\u002Fcoreconcepts","3.packages\u002F7.fluent-python\u002F02.coreconcepts",{"title":76,"path":410,"stem":411},"\u002Fpackages\u002Ffluent-python\u002Fcustomers","3.packages\u002F7.fluent-python\u002F03.customers",{"title":88,"path":413,"stem":414},"\u002Fpackages\u002Ffluent-python\u002Fcheckouts","3.packages\u002F7.fluent-python\u002F04.checkouts",{"title":96,"path":416,"stem":417},"\u002Fpackages\u002Ffluent-python\u002Fsubscriptions","3.packages\u002F7.fluent-python\u002F05.subscriptions",{"title":104,"path":419,"stem":420},"\u002Fpackages\u002Ffluent-python\u002Forders","3.packages\u002F7.fluent-python\u002F06.orders",{"title":222,"path":422,"stem":423},"\u002Fpackages\u002Ffluent-python\u002Fcustomerportal","3.packages\u002F7.fluent-python\u002F07.customerportal",{"title":58,"path":425,"stem":426},"\u002Fpackages\u002Ffluent-python\u002Fwebhooks","3.packages\u002F7.fluent-python\u002F08.webhooks",{"title":66,"path":428,"stem":429},"\u002Fpackages\u002Ffluent-python\u002Ftesting","3.packages\u002F7.fluent-python\u002F11.testing",{"title":431,"path":432,"stem":433},"Porting","\u002Fpackages\u002Ffluent-python\u002Fporting","3.packages\u002F7.fluent-python\u002F12.porting",{"title":392,"path":435,"stem":436},"\u002Fpackages\u002Ffluent-python\u002Fdevelopment","3.packages\u002F7.fluent-python\u002F13.development",{"title":438,"path":439,"stem":440,"children":441,"page":69},"Django","\u002Fpackages\u002Fdjango","3.packages\u002F8.django",[442,445,449,452,456,460,463,466,469,473,476],{"title":137,"path":443,"stem":444},"\u002Fpackages\u002Fdjango\u002Freadme","3.packages\u002F8.django\u002F00.readme",{"title":446,"path":447,"stem":448},"Installation","\u002Fpackages\u002Fdjango\u002Finstallation","3.packages\u002F8.django\u002F01.installation",{"title":202,"path":450,"stem":451},"\u002Fpackages\u002Fdjango\u002Fconfiguration","3.packages\u002F8.django\u002F02.configuration",{"title":453,"path":454,"stem":455},"Billable models","\u002Fpackages\u002Fdjango\u002Fbillablemodels","3.packages\u002F8.django\u002F03.billablemodels",{"title":457,"path":458,"stem":459},"Checkout","\u002Fpackages\u002Fdjango\u002Fcheckout","3.packages\u002F8.django\u002F04.checkout",{"title":96,"path":461,"stem":462},"\u002Fpackages\u002Fdjango\u002Fbilling","3.packages\u002F8.django\u002F05.billing",{"title":222,"path":464,"stem":465},"\u002Fpackages\u002Fdjango\u002Fcustomerportal","3.packages\u002F8.django\u002F06.customerportal",{"title":58,"path":467,"stem":468},"\u002Fpackages\u002Fdjango\u002Fwebhooks","3.packages\u002F8.django\u002F07.webhooks",{"title":470,"path":471,"stem":472},"Admin","\u002Fpackages\u002Fdjango\u002Fadmin","3.packages\u002F8.django\u002F08.admin",{"title":66,"path":474,"stem":475},"\u002Fpackages\u002Fdjango\u002Ftesting","3.packages\u002F8.django\u002F09.testing",{"title":392,"path":477,"stem":478},"\u002Fpackages\u002Fdjango\u002Fdevelopment","3.packages\u002F8.django\u002F10.development",{"title":480,"path":481,"stem":482,"children":483},"Integrations","\u002Fintegrations","4.integrations",[484,486,490],{"title":480,"path":481,"stem":485},"4.integrations\u002Findex",{"title":487,"path":488,"stem":489},"Lovable payments with Vatly","\u002Fintegrations\u002Flovable","4.integrations\u002F1.lovable",{"title":491,"path":492,"stem":493},"Bolt payments with Vatly","\u002Fintegrations\u002Fbolt","4.integrations\u002F2.bolt",{"id":495,"title":30,"body":496,"description":1388,"extension":1389,"links":1390,"meta":1391,"navigation":1392,"path":31,"seo":1393,"stem":32,"__hash__":1394},"docs\u002F1.guides\u002F13.discounts.md",{"type":497,"value":498,"toc":1379},"minimark",[499,503,511,516,542,584,1049,1056,1059,1062,1080,1094,1097,1100,1104,1110,1116,1147,1150,1154,1157,1171,1174,1177,1181,1216,1271,1274,1278,1295,1332,1335,1339,1375],[500,501,502],"p",{},"A discount takes a percentage or a fixed amount off a checkout. You add it when you create the checkout through the API, and Vatly applies it to the payment, the taxes, the order, the invoice and the receipt. Nothing needs to be enabled first.",[500,504,505,506,510],{},"A discount reduces the ",[507,508,509],"strong",{},"first payment"," of each product in the checkout. Subscription renewals after that are charged the full price.",[512,513,515],"h2",{"id":514},"apply-a-discount-to-a-checkout","Apply a discount to a checkout",[500,517,518,519,523,524,529,530,533,534,537,538,541],{},"Send ",[520,521,522],"code",{},"discounts"," with one entry when you ",[525,526,528],"a",{"href":527},"\u002Fapi-reference\u002Fcheckouts#create-a-checkout","create a checkout",". An entry has either a ",[520,531,532],{},"percentage"," or a fixed ",[520,535,536],{},"amount",", never both, and an optional ",[520,539,540],{},"description",":",[543,544,545,561,577],"ul",{},[546,547,548,552,553,556,557,560],"li",{},[507,549,550],{},[520,551,532],{},": above 0 and below 100, with at most three decimals, such as ",[520,554,555],{},"20"," or ",[520,558,559],{},"12.5",".",[546,562,563,567,568,571,572,576],{},[507,564,565],{},[520,566,536],{},": a fixed amount in EUR, such as ",[520,569,570],{},"{\"value\": \"10.00\", \"currency\": \"EUR\"}",". See ",[525,573,575],{"href":574},"#the-tax-basis","The tax basis"," for whether it includes taxes.",[546,578,579,583],{},[507,580,581],{},[520,582,540],{},": up to 255 characters. Your customer sees it on the checkout, the receipt and the invoice, as \"Discount Black Friday\". Without one, the line reads \"Discount\".",[585,586,588,715,899],"code-group",{"sync":587},"api",[589,590,596],"pre",{"className":591,"code":592,"filename":593,"language":594,"meta":595,"style":595},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","curl https:\u002F\u002Fapi.vatly.com\u002Fv1\u002Fcheckouts \\\n  -H \"Authorization: Bearer live_your_api_key_here\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"products\": [\n      {\"id\": \"one_off_product_Vr8kQdFhSrG4Y3DnfsdqH\"}\n    ],\n    \"discounts\": [\n      {\"description\": \"Black Friday\", \"percentage\": 20}\n    ],\n    \"redirectUrlSuccess\": \"https:\u002F\u002Fexample.com\u002Fsuccess\",\n    \"redirectUrlCanceled\": \"https:\u002F\u002Fexample.com\u002Fcanceled\"\n  }'\n","cURL","bash","",[520,597,598,615,633,647,659,665,671,677,683,689,694,700,706],{"__ignoreMap":595},[599,600,603,607,611],"span",{"class":601,"line":602},"line",1,[599,604,606],{"class":605},"sBMFI","curl",[599,608,610],{"class":609},"sfazB"," https:\u002F\u002Fapi.vatly.com\u002Fv1\u002Fcheckouts",[599,612,614],{"class":613},"sTEyZ"," \\\n",[599,616,618,621,625,628,631],{"class":601,"line":617},2,[599,619,620],{"class":609},"  -H",[599,622,624],{"class":623},"sMK4o"," \"",[599,626,627],{"class":609},"Authorization: Bearer live_your_api_key_here",[599,629,630],{"class":623},"\"",[599,632,614],{"class":613},[599,634,636,638,640,643,645],{"class":601,"line":635},3,[599,637,620],{"class":609},[599,639,624],{"class":623},[599,641,642],{"class":609},"Content-Type: application\u002Fjson",[599,644,630],{"class":623},[599,646,614],{"class":613},[599,648,650,653,656],{"class":601,"line":649},4,[599,651,652],{"class":609},"  -d",[599,654,655],{"class":623}," '",[599,657,658],{"class":609},"{\n",[599,660,662],{"class":601,"line":661},5,[599,663,664],{"class":609},"    \"products\": [\n",[599,666,668],{"class":601,"line":667},6,[599,669,670],{"class":609},"      {\"id\": \"one_off_product_Vr8kQdFhSrG4Y3DnfsdqH\"}\n",[599,672,674],{"class":601,"line":673},7,[599,675,676],{"class":609},"    ],\n",[599,678,680],{"class":601,"line":679},8,[599,681,682],{"class":609},"    \"discounts\": [\n",[599,684,686],{"class":601,"line":685},9,[599,687,688],{"class":609},"      {\"description\": \"Black Friday\", \"percentage\": 20}\n",[599,690,692],{"class":601,"line":691},10,[599,693,676],{"class":609},[599,695,697],{"class":601,"line":696},11,[599,698,699],{"class":609},"    \"redirectUrlSuccess\": \"https:\u002F\u002Fexample.com\u002Fsuccess\",\n",[599,701,703],{"class":601,"line":702},12,[599,704,705],{"class":609},"    \"redirectUrlCanceled\": \"https:\u002F\u002Fexample.com\u002Fcanceled\"\n",[599,707,709,712],{"class":601,"line":708},13,[599,710,711],{"class":609},"  }",[599,713,714],{"class":623},"'\n",[589,716,721],{"className":717,"code":718,"filename":719,"language":720,"meta":595,"style":595},"language-php shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","$checkout = $vatly->checkouts->create([\n  'products' => [\n    ['id' => 'one_off_product_Vr8kQdFhSrG4Y3DnfsdqH'],\n  ],\n  'discounts' => [\n    ['description' => 'Black Friday', 'percentage' => 20],\n  ],\n  'redirectUrlSuccess' => 'https:\u002F\u002Fexample.com\u002Fsuccess',\n  'redirectUrlCanceled' => 'https:\u002F\u002Fexample.com\u002Fcanceled',\n]);\n","PHP","php",[520,722,723,755,772,796,801,813,849,853,874,894],{"__ignoreMap":595},[599,724,725,728,731,734,737,740,743,746,748,752],{"class":601,"line":602},[599,726,727],{"class":623},"$",[599,729,730],{"class":613},"checkout ",[599,732,733],{"class":623},"=",[599,735,736],{"class":623}," $",[599,738,739],{"class":613},"vatly",[599,741,742],{"class":623},"->",[599,744,745],{"class":613},"checkouts",[599,747,742],{"class":623},[599,749,751],{"class":750},"s2Zo4","create",[599,753,754],{"class":623},"([\n",[599,756,757,760,763,766,769],{"class":601,"line":617},[599,758,759],{"class":623},"  '",[599,761,762],{"class":609},"products",[599,764,765],{"class":623},"'",[599,767,768],{"class":623}," =>",[599,770,771],{"class":623}," [\n",[599,773,774,777,779,782,784,786,788,791,793],{"class":601,"line":635},[599,775,776],{"class":623},"    [",[599,778,765],{"class":623},[599,780,781],{"class":609},"id",[599,783,765],{"class":623},[599,785,768],{"class":623},[599,787,655],{"class":623},[599,789,790],{"class":609},"one_off_product_Vr8kQdFhSrG4Y3DnfsdqH",[599,792,765],{"class":623},[599,794,795],{"class":623},"],\n",[599,797,798],{"class":601,"line":649},[599,799,800],{"class":623},"  ],\n",[599,802,803,805,807,809,811],{"class":601,"line":661},[599,804,759],{"class":623},[599,806,522],{"class":609},[599,808,765],{"class":623},[599,810,768],{"class":623},[599,812,771],{"class":623},[599,814,815,817,819,821,823,825,827,830,832,835,837,839,841,843,847],{"class":601,"line":667},[599,816,776],{"class":623},[599,818,765],{"class":623},[599,820,540],{"class":609},[599,822,765],{"class":623},[599,824,768],{"class":623},[599,826,655],{"class":623},[599,828,829],{"class":609},"Black Friday",[599,831,765],{"class":623},[599,833,834],{"class":623},",",[599,836,655],{"class":623},[599,838,532],{"class":609},[599,840,765],{"class":623},[599,842,768],{"class":623},[599,844,846],{"class":845},"sbssI"," 20",[599,848,795],{"class":623},[599,850,851],{"class":601,"line":673},[599,852,800],{"class":623},[599,854,855,857,860,862,864,866,869,871],{"class":601,"line":679},[599,856,759],{"class":623},[599,858,859],{"class":609},"redirectUrlSuccess",[599,861,765],{"class":623},[599,863,768],{"class":623},[599,865,655],{"class":623},[599,867,868],{"class":609},"https:\u002F\u002Fexample.com\u002Fsuccess",[599,870,765],{"class":623},[599,872,873],{"class":623},",\n",[599,875,876,878,881,883,885,887,890,892],{"class":601,"line":685},[599,877,759],{"class":623},[599,879,880],{"class":609},"redirectUrlCanceled",[599,882,765],{"class":623},[599,884,768],{"class":623},[599,886,655],{"class":623},[599,888,889],{"class":609},"https:\u002F\u002Fexample.com\u002Fcanceled",[599,891,765],{"class":623},[599,893,873],{"class":623},[599,895,896],{"class":601,"line":691},[599,897,898],{"class":623},"]);\n",[589,900,905],{"className":901,"code":902,"filename":903,"language":904,"meta":595,"style":595},"language-js shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","const checkout = await vatly.checkouts.create({\n  products: [{ id: \"one_off_product_Vr8kQdFhSrG4Y3DnfsdqH\" }],\n  discounts: [{ description: \"Black Friday\", percentage: 20 }],\n  redirectUrlSuccess: \"https:\u002F\u002Fexample.com\u002Fsuccess\",\n  redirectUrlCanceled: \"https:\u002F\u002Fexample.com\u002Fcanceled\",\n});\n","JavaScript","js",[520,906,907,938,971,1008,1023,1038],{"__ignoreMap":595},[599,908,909,913,916,918,922,925,927,929,931,933,936],{"class":601,"line":602},[599,910,912],{"class":911},"spNyl","const",[599,914,915],{"class":613}," checkout ",[599,917,733],{"class":623},[599,919,921],{"class":920},"s7zQu"," await",[599,923,924],{"class":613}," vatly",[599,926,560],{"class":623},[599,928,745],{"class":613},[599,930,560],{"class":623},[599,932,751],{"class":750},[599,934,935],{"class":613},"(",[599,937,658],{"class":623},[599,939,940,944,946,949,952,955,957,959,961,963,966,969],{"class":601,"line":617},[599,941,943],{"class":942},"swJcz","  products",[599,945,541],{"class":623},[599,947,948],{"class":613}," [",[599,950,951],{"class":623},"{",[599,953,954],{"class":942}," id",[599,956,541],{"class":623},[599,958,624],{"class":623},[599,960,790],{"class":609},[599,962,630],{"class":623},[599,964,965],{"class":623}," }",[599,967,968],{"class":613},"]",[599,970,873],{"class":623},[599,972,973,976,978,980,982,985,987,989,991,993,995,998,1000,1002,1004,1006],{"class":601,"line":635},[599,974,975],{"class":942},"  discounts",[599,977,541],{"class":623},[599,979,948],{"class":613},[599,981,951],{"class":623},[599,983,984],{"class":942}," description",[599,986,541],{"class":623},[599,988,624],{"class":623},[599,990,829],{"class":609},[599,992,630],{"class":623},[599,994,834],{"class":623},[599,996,997],{"class":942}," percentage",[599,999,541],{"class":623},[599,1001,846],{"class":845},[599,1003,965],{"class":623},[599,1005,968],{"class":613},[599,1007,873],{"class":623},[599,1009,1010,1013,1015,1017,1019,1021],{"class":601,"line":649},[599,1011,1012],{"class":942},"  redirectUrlSuccess",[599,1014,541],{"class":623},[599,1016,624],{"class":623},[599,1018,868],{"class":609},[599,1020,630],{"class":623},[599,1022,873],{"class":623},[599,1024,1025,1028,1030,1032,1034,1036],{"class":601,"line":661},[599,1026,1027],{"class":942},"  redirectUrlCanceled",[599,1029,541],{"class":623},[599,1031,624],{"class":623},[599,1033,889],{"class":609},[599,1035,630],{"class":623},[599,1037,873],{"class":623},[599,1039,1040,1043,1046],{"class":601,"line":667},[599,1041,1042],{"class":623},"}",[599,1044,1045],{"class":613},")",[599,1047,1048],{"class":623},";\n",[500,1050,1051,1052,1055],{},"For a fixed amount, send ",[520,1053,1054],{},"{\"description\": \"Welcome\", \"amount\": {\"value\": \"10.00\", \"currency\": \"EUR\"}}"," as the entry instead.",[500,1057,1058],{},"A checkout takes one discount for now. It applies to the whole checkout: Vatly spreads it over the products in proportion to their prices, so with €100 and €50 in the cart, €15 off takes €10 and €5. When your customer pays in another currency, a fixed amount is converted at checkout.",[512,1060,575],{"id":1061},"the-tax-basis",[500,1063,1064,1065,1067,1068,1071,1072,1075,1076,1079],{},"A fixed ",[520,1066,536],{}," is on the same basis as your products' prices. All products in a checkout share one ",[520,1069,1070],{},"taxBehavior"," (see ",[525,1073,1074],{"href":93},"one-off products"," and ",[525,1077,1078],{"href":101},"subscription plans","), so there is one basis per checkout:",[543,1081,1082,1088],{},[546,1083,1084,1087],{},[507,1085,1086],{},"Tax-exclusive prices",": the amount excludes taxes. €10.00 off a €100.00 product leaves €90.00, and tax is charged on the €90.00: €108.90 at a 21% rate.",[546,1089,1090,1093],{},[507,1091,1092],{},"Tax-inclusive prices",": the amount includes taxes, like the price. €10.00 off a €121.00 product charges €111.00, and the €111.00 includes €19.26 tax at a 21% rate.",[500,1095,1096],{},"A percentage takes the same share off either way: 10% off €121.00 including taxes charges €108.90.",[500,1098,1099],{},"In both cases tax is charged on what your customer actually pays, so the discount also lowers the tax. Vatly works out the taxes for the buyer's country as usual; you never calculate them yourself.",[512,1101,1103],{"id":1102},"subscriptions-and-trials","Subscriptions and trials",[500,1105,1106,1107,1109],{},"On a subscription plan, the discount reduces the ",[507,1108,509],{},". Every renewal after it is charged the plan's full price.",[500,1111,1112,1113,541],{},"When the plan starts with a trial, the plan itself is not charged today (a small payment-method authorization charge may still apply), so its discount moves to the ",[507,1114,1115],{},"first payment after the trial",[543,1117,1118,1124,1130,1136,1142],{},[546,1119,1120,1123],{},[507,1121,1122],{},"It works the same on tax-exclusive and tax-inclusive plans."," On a tax-inclusive plan, a fixed amount includes taxes at that payment too.",[546,1125,1126,1129],{},[507,1127,1128],{},"A percentage applies to whatever that payment is."," 20% off stays 20% off when the plan changes during the trial.",[546,1131,1132,1135],{},[507,1133,1134],{},"A fixed amount stays the same, up to the payment."," If you move the customer to a cheaper plan during the trial and the discount is more than the new price, that first payment is free.",[546,1137,1138,1141],{},[507,1139,1140],{},"Plan, price and quantity changes during the trial keep the discount",", whether you change the subscription immediately or at the end of the trial. An immediate change that ends the trial charges the first payment right away, and the discount comes off that payment.",[546,1143,1144],{},[507,1145,1146],{},"A subscription canceled during its trial never uses the discount.",[500,1148,1149],{},"The hosted checkout shows it below the total, as \"Discount Black Friday on your first payment\", because none of that part is charged today.",[512,1151,1153],{"id":1152},"mixed-checkouts","Mixed checkouts",[500,1155,1156],{},"A checkout can combine products charged today with a subscription on trial. The discount then reduces the first payment of every product, today's and the trial's:",[543,1158,1159,1165],{},[546,1160,1161,1164],{},[507,1162,1163],{},"A percentage"," comes off every product's first payment. 10% off a €100 product today and a €30 plan on trial takes €10 today and €3 off the plan's first payment after the trial.",[546,1166,1167,1170],{},[507,1168,1169],{},"A fixed amount"," is split over the same first payments, in proportion to their prices, so it lands where a percentage of the same size would. €40 off €100 today plus a €30 plan on trial takes €30.77 today and €9.23 off the plan's first payment.",[500,1172,1173],{},"On tax-inclusive prices the split uses the prices including taxes: €130.00 off a €121.00 product today and a €30.25 plan on trial takes €104.00 today and €26.00 off the plan's first payment.",[500,1175,1176],{},"Want the whole discount on one product instead? Create a checkout with only that product.",[512,1178,1180],{"id":1179},"orders-invoices-and-receipts","Orders, invoices and receipts",[500,1182,1183,1184,1188,1189,1191,1192,1194,1195,1197,1198,1200,1201,1204,1205,556,1207,1210,1211,1213,1214,560],{},"The paid ",[525,1185,1187],{"href":1186},"\u002Fapi-reference\u002Forders#the-order-model","order"," lists the discount under ",[520,1190,522],{},", and each order line lists its share under its own ",[520,1193,522],{},". An entry has an ",[520,1196,781],{}," shared by the order's entry and every line's share, the ",[520,1199,540],{},", the ",[520,1202,1203],{},"discountType"," (",[520,1206,532],{},[520,1208,1209],{},"fixed_amount","), the ",[520,1212,532],{}," when there is one, and the ",[520,1215,536],{},[543,1217,1218,1246,1252,1258],{},[546,1219,1220,1223,1224,1227,1228,1231,1232,1234,1235,1075,1238,1241,1242,1245],{},[507,1221,1222],{},"Amounts exclude taxes",", like a line's ",[520,1225,1226],{},"subtotal",", also on tax-inclusive prices. The €10.00 off a €121.00 product above reads ",[520,1229,1230],{},"8.26"," at a 21% tax rate. A line's ",[520,1233,1226],{},", ",[520,1236,1237],{},"taxes",[520,1239,1240],{},"total"," are already net of its discounts, and ",[520,1243,1244],{},"basePrice"," stays the full unit price.",[546,1247,1248,1251],{},[507,1249,1250],{},"The invoice"," prints each product at its full price, with the discount on its own line below it, with the tax it takes off: \"Product €100.00 + €21.00 tax\", then \"Discount Black Friday −€8.26 − €1.74 tax\", so the customer pays €111.00.",[546,1253,1254,1257],{},[507,1255,1256],{},"The receipt"," email lists the discount with the items.",[546,1259,1260,1263,1264,1270],{},[507,1261,1262],{},"A first payment after a trial"," is billed on a renewal order, which carries the discount in the same way. Several subscription charges for the same customer may share one order, and a free or below-minimum charge may be deferred to a later order. The ",[525,1265,1266,1269],{"href":59},[520,1267,1268],{},"order.*"," webhooks"," carry the discount like any other order's.",[500,1272,1273],{},"Refunds take the discount into account: a full refund returns what the customer paid, not the full price.",[512,1275,1277],{"id":1276},"errors-and-limits","Errors and limits",[500,1279,1280,1281,1284,1285,1071,1288,1291,1292,1294],{},"Vatly rejects a discount it cannot apply with ",[520,1282,1283],{},"422"," and a validation error keyed by its position, such as ",[520,1286,1287],{},"discounts.0.percentage",[525,1289,54],{"href":1290},"\u002Fguides\u002Ferrors#validation-errors","). It returns ",[520,1293,1283],{}," when:",[543,1296,1297,1300,1309,1315,1324,1329],{},[546,1298,1299],{},"you send more than one entry (one discount per checkout for now);",[546,1301,1302,1303,1305,1306,1308],{},"an entry has both a ",[520,1304,532],{}," and an ",[520,1307,536],{},", or neither;",[546,1310,1311,1312,1314],{},"the ",[520,1313,532],{}," is 0 or less, 100 or more, or has more than three decimals;",[546,1316,1311,1317,1319,1320,1323],{},[520,1318,536],{}," is zero or less, or not in ",[520,1321,1322],{},"EUR",";",[546,1325,1311,1326,1328],{},[520,1327,536],{}," is not below the checkout's subtotal on the products' tax basis, counting a subscription on trial at its first payment after the trial;",[546,1330,1331],{},"no product in the checkout has a price.",[500,1333,1334],{},"The discount never makes today's payment free: a percentage stays below 100, and when part of a fixed amount comes off today, at least the smallest currency unit (€0.01) stays payable.",[512,1336,1338],{"id":1337},"learn-more","Learn more",[543,1340,1341,1347,1353,1360,1367],{},[546,1342,1343],{},[525,1344,1346],{"href":1345},"\u002Fapi-reference\u002Fcheckouts#discounts","Checkouts API: Discounts",[546,1348,1349],{},[525,1350,1352],{"href":1351},"\u002Fapi-reference\u002Forders#discount-properties","Orders API: Discount properties",[546,1354,1355,1356,1075,1358],{},"PHP SDK: ",[525,1357,88],{"href":144},[525,1359,104],{"href":154},[546,1361,1362,1363,1075,1365],{},"JavaScript SDK: ",[525,1364,88],{"href":285},[525,1366,104],{"href":294},[546,1368,1369],{},[525,1370,1374],{"href":1371,"rel":1372},"https:\u002F\u002Fdocs.vatly.com\u002Fopenapi.yaml",[1373],"nofollow","OpenAPI spec",[1376,1377,1378],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}",{"title":595,"searchDepth":617,"depth":617,"links":1380},[1381,1382,1383,1384,1385,1386,1387],{"id":514,"depth":617,"text":515},{"id":1061,"depth":617,"text":575},{"id":1102,"depth":617,"text":1103},{"id":1152,"depth":617,"text":1153},{"id":1179,"depth":617,"text":1180},{"id":1276,"depth":617,"text":1277},{"id":1337,"depth":617,"text":1338},"Take a percentage or a fixed amount off a checkout, how tax applies to it, how it works with subscriptions and trials, and where it shows on orders and invoices.","md",null,{},true,{"title":30,"description":1388},"aw9SuTgIWJn_VAQ0b-J0t3NBPDiUiQI3LKqkhTBW5o0",[1396,1398],{"title":26,"path":27,"stem":28,"description":1397,"children":-1},"Lemon Squeezy shuts down on 31 March 2027. Vatly is the European Merchant of Record for AI, software and digital products: EU-based, EU data, built on Mollie. Here's how to move.",{"title":34,"path":35,"stem":36,"description":1399,"children":-1},"Understand what adopting Vatly involves: responsibilities, checkout and fulfillment, choosing an integration path, and preparing your developer or AI agent.",1796035186032]