[{"data":1,"prerenderedAt":908},["ShallowReactive",2],{"versions":3,"nav-guides":8,"nav-ref-v1":86,"guide-\u002Fguides\u002Fidempotency":618,"guide-around-\u002Fguides\u002Fidempotency":903},[4],{"id":5,"label":5,"file":6,"status":7},"v1","cartirra-v1.json","current",[9,14,19,24,29,34,39,44,49,55,60,65,70,75,80],{"path":10,"title":11,"group":11,"order":12,"description":13},"\u002Fguides\u002Fgetting-started","Getting started",1,"What the Cartirra API does, how requests look, and the three things to set up first.",{"path":15,"title":16,"group":11,"order":17,"description":18},"\u002Fguides\u002Fquickstart","Quickstart",2,"Create a checkout session from your server, let the shopper pay, and read the order. About ten minutes, all in test mode.",{"path":20,"title":21,"group":11,"order":22,"description":23},"\u002Fguides\u002Fembed-checkout","Cartirra Popup and Redirect",2.5,"Open the checkout over your own page with one script tag (Cartirra Popup), or send shoppers to Cartirra's checkout page (Cartirra Redirect). Then confirm the order on your server.",{"path":25,"title":26,"group":11,"order":27,"description":28},"\u002Fguides\u002Fad-tracking","Track checkouts in your ads",2.6,"Your Meta, Google and TikTok pixels see every checkout step and purchase, in the browser and from Cartirra's server, counted once.",{"path":30,"title":31,"group":11,"order":32,"description":33},"\u002Fguides\u002Fpay-at-table","Pay at table",2.7,"Tables with QR codes, bills guests pay from their phone (all at once or split), the live board, refunds and the day's reconciliation. An add-on, per store.",{"path":35,"title":36,"group":11,"order":37,"description":38},"\u002Fguides\u002Fwarranties","Warranties",2.8,"Give a warranty with an item at checkout, or add one after the sale. The shopper keeps it in their Cartirra account and is reminded before it ends. Growth and above.",{"path":40,"title":41,"group":11,"order":42,"description":43},"\u002Fguides\u002Fauthentication","Authentication",3,"Secret and public keys, test and live mode, rotating keys without downtime, and keeping them safe.",{"path":45,"title":46,"group":11,"order":47,"description":48},"\u002Fguides\u002Ftest-mode","Test mode",4,"Build and test your integration with test keys. Payments, refunds and payouts are simulated; no real money moves.",{"path":50,"title":51,"group":52,"order":53,"description":54},"\u002Fguides\u002Fpagination","Pagination and filtering","Core concepts",10,"Lists are newest first and use cursors. Ask for up to 100 items a page and follow next_cursor.",{"path":56,"title":57,"group":52,"order":58,"description":59},"\u002Fguides\u002Fidempotency","Idempotency",11,"Retry creates and refunds safely. The same Idempotency-Key always gets the same response, and the action happens once.",{"path":61,"title":62,"group":52,"order":63,"description":64},"\u002Fguides\u002Ferrors","Errors and troubleshooting",12,"One error shape everywhere. Branch on code, show message, and quote request_id when you contact support.",{"path":66,"title":67,"group":52,"order":68,"description":69},"\u002Fguides\u002Frate-limits","Rate limits",13,"Each secret key gets its own request budget. Back off on 429 using Retry-After.",{"path":71,"title":72,"group":52,"order":73,"description":74},"\u002Fguides\u002Fversioning","Versioning",14,"The version is in the path. Within v1 we only add things, and anything removed is announced with Deprecation and Sunset headers first.",{"path":76,"title":77,"group":77,"order":78,"description":79},"\u002Fguides\u002Fwebhooks","Webhooks",20,"Cartirra posts signed events to your endpoint when orders, payments, refunds, payouts and customers change. Verify, deduplicate, answer fast.",{"path":81,"title":82,"group":83,"order":84,"description":85},"\u002Fguides\u002Fchangelog","Changelog","Resources",30,"Changes to the Cartirra API and these docs. Within v1, changes are additive only.",{"title":87,"version":88,"tags":89,"webhooks":536},"Cartirra API","1.0.0",[90,112,136,171,239,313,345,355,369,384,409,432,446,456,481,496,511,526],{"name":91,"slug":92,"description":93,"operations":94},"Checkout sessions","checkout-sessions","Open a checkout for a cart; the shopper pays in Cartirra Popup on your page or through Cartirra Redirect.",[95,101,107],{"operationId":96,"slug":97,"method":98,"path":99,"summary":100,"tag":91},"createCheckoutSession","create-checkout-session","post","\u002Fv1\u002Fcheckout-sessions","Create a checkout session",{"operationId":102,"slug":103,"method":104,"path":105,"summary":106,"tag":91},"getCheckoutSession","get-checkout-session","get","\u002Fv1\u002Fcheckout-sessions\u002F{id}","Retrieve a checkout session",{"operationId":108,"slug":109,"method":98,"path":110,"summary":111,"tag":91},"expireCheckoutSession","expire-checkout-session","\u002Fv1\u002Fcheckout-sessions\u002F{id}\u002Fexpire","Expire a checkout session",{"name":113,"slug":114,"description":115,"operations":116},"Payment links","payment-links","Carts you share as a link (WhatsApp, Instagram, SMS): no code needed.",[117,122,126,131],{"operationId":118,"slug":119,"method":104,"path":120,"summary":121,"tag":113},"listPaymentLinks","list-payment-links","\u002Fv1\u002Fpayment-links","List payment links",{"operationId":123,"slug":124,"method":98,"path":120,"summary":125,"tag":113},"createPaymentLink","create-payment-link","Create a payment link",{"operationId":127,"slug":128,"method":104,"path":129,"summary":130,"tag":113},"getPaymentLink","get-payment-link","\u002Fv1\u002Fpayment-links\u002F{id}","Retrieve a payment link",{"operationId":132,"slug":133,"method":134,"path":129,"summary":135,"tag":113},"updatePaymentLink","update-payment-link","patch","Update a payment link",{"name":137,"slug":138,"description":139,"operations":140},"Tables","tables","Pay at table: your tables and the QR code printed on each.",[141,146,152,157,161,166],{"operationId":142,"slug":143,"method":104,"path":144,"summary":145,"tag":137},"listPayAtTableStores","list-pay-at-table-stores","\u002Fv1\u002Fpay-at-table\u002Fstores","List Pay at table stores",{"operationId":147,"slug":148,"method":149,"path":150,"summary":151,"tag":137},"setStorePayAtTable","set-store-pay-at-table","put","\u002Fv1\u002Fstores\u002F{store_id}\u002Fpay-at-table","Turn Pay at table on or off at a store",{"operationId":153,"slug":154,"method":104,"path":155,"summary":156,"tag":137},"listTables","list-tables","\u002Fv1\u002Fstores\u002F{store_id}\u002Ftables","List tables",{"operationId":158,"slug":159,"method":98,"path":155,"summary":160,"tag":137},"createTables","create-tables","Add tables",{"operationId":162,"slug":163,"method":134,"path":164,"summary":165,"tag":137},"updateTable","update-table","\u002Fv1\u002Ftables\u002F{id}","Update a table",{"operationId":167,"slug":168,"method":98,"path":169,"summary":170,"tag":137},"rotateTableQr","rotate-table-qr","\u002Fv1\u002Ftables\u002F{id}\u002Frotate-qr","Replace a table’s QR link",{"name":172,"slug":173,"description":174,"operations":175},"Bills","bills","Pay at table: bills guests pay from the table QR (all at once or split), the live board, refunds and the day’s reconciliation.",[176,181,185,190,195,200,205,210,215,220,224,229,234],{"operationId":177,"slug":178,"method":104,"path":179,"summary":180,"tag":172},"listBills","list-bills","\u002Fv1\u002Fbills","List bills",{"operationId":182,"slug":183,"method":98,"path":179,"summary":184,"tag":172},"openBill","open-bill","Open a bill",{"operationId":186,"slug":187,"method":104,"path":188,"summary":189,"tag":172},"getBillBoard","get-bill-board","\u002Fv1\u002Fbills\u002Fboard","Retrieve the table board",{"operationId":191,"slug":192,"method":104,"path":193,"summary":194,"tag":172},"lookupBillPayments","lookup-bill-payments","\u002Fv1\u002Fbills\u002Fpayments","Find a table payment",{"operationId":196,"slug":197,"method":104,"path":198,"summary":199,"tag":172},"getBillReconciliation","get-bill-reconciliation","\u002Fv1\u002Fbills\u002Freconciliation","Retrieve the day’s reconciliation",{"operationId":201,"slug":202,"method":104,"path":203,"summary":204,"tag":172},"listBillRefunds","list-bill-refunds","\u002Fv1\u002Fbills\u002Frefunds","List the refund queue",{"operationId":206,"slug":207,"method":98,"path":208,"summary":209,"tag":172},"refundBillRefund","refund-bill-refund","\u002Fv1\u002Fbills\u002Frefunds\u002F{id}\u002Frefund","Send a queued refund",{"operationId":211,"slug":212,"method":98,"path":213,"summary":214,"tag":172},"dismissBillRefund","dismiss-bill-refund","\u002Fv1\u002Fbills\u002Frefunds\u002F{id}\u002Fdismiss","Dismiss a queued refund",{"operationId":216,"slug":217,"method":104,"path":218,"summary":219,"tag":172},"getBill","get-bill","\u002Fv1\u002Fbills\u002F{id}","Retrieve a bill",{"operationId":221,"slug":222,"method":134,"path":218,"summary":223,"tag":172},"updateBill","update-bill","Update a bill",{"operationId":225,"slug":226,"method":98,"path":227,"summary":228,"tag":172},"recordBillOutsidePayment","record-bill-outside-payment","\u002Fv1\u002Fbills\u002F{id}\u002Foutside","Record a payment outside Cartirra",{"operationId":230,"slug":231,"method":98,"path":232,"summary":233,"tag":172},"closeBill","close-bill","\u002Fv1\u002Fbills\u002F{id}\u002Fclose","Close a bill",{"operationId":235,"slug":236,"method":98,"path":237,"summary":238,"tag":172},"voidBill","void-bill","\u002Fv1\u002Fbills\u002F{id}\u002Fvoid","Void a bill",{"name":240,"slug":241,"description":242,"operations":243},"Orders","orders","Orders placed through checkout: read them and move them through fulfilment, and answer problems shoppers report.",[244,249,254,259,264,269,274,279,284,289,294,298,303,308],{"operationId":245,"slug":246,"method":104,"path":247,"summary":248,"tag":240},"getOrderRelated","get-order-related","\u002Fv1\u002Forders\u002F{id}\u002Frelated","Retrieve order extras",{"operationId":250,"slug":251,"method":104,"path":252,"summary":253,"tag":240},"listOrders","list-orders","\u002Fv1\u002Forders","List orders",{"operationId":255,"slug":256,"method":104,"path":257,"summary":258,"tag":240},"getOrder","get-order","\u002Fv1\u002Forders\u002F{id}","Retrieve an order",{"operationId":260,"slug":261,"method":104,"path":262,"summary":263,"tag":240},"listOrderActivity","list-order-activity","\u002Fv1\u002Forders\u002F{id}\u002Factivity","List order activity",{"operationId":265,"slug":266,"method":98,"path":267,"summary":268,"tag":240},"updateOrderStatus","update-order-status","\u002Fv1\u002Forders\u002F{id}\u002Fstatus","Update order status",{"operationId":270,"slug":271,"method":98,"path":272,"summary":273,"tag":240},"acceptOrder","accept-order","\u002Fv1\u002Forders\u002F{id}\u002Faccept","Accept an order",{"operationId":275,"slug":276,"method":149,"path":277,"summary":278,"tag":240},"updateOrderDeliveryAddress","update-order-delivery-address","\u002Fv1\u002Forders\u002F{id}\u002Fdelivery-address","Update delivery address",{"operationId":280,"slug":281,"method":98,"path":282,"summary":283,"tag":240},"cancelOrder","cancel-order","\u002Fv1\u002Forders\u002F{id}\u002Fcancel","Cancel an order",{"operationId":285,"slug":286,"method":104,"path":287,"summary":288,"tag":240},"listOrderIssues","list-order-issues","\u002Fv1\u002Forder-issues","List problem reports",{"operationId":290,"slug":291,"method":104,"path":292,"summary":293,"tag":240},"getOrderIssue","get-order-issue","\u002Fv1\u002Forder-issues\u002F{id}","Retrieve a problem report",{"operationId":295,"slug":296,"method":134,"path":292,"summary":297,"tag":240},"updateOrderIssue","update-order-issue","Update a problem report",{"operationId":299,"slug":300,"method":98,"path":301,"summary":302,"tag":240},"markPayOnDeliveryCollected","mark-pay-on-delivery-collected","\u002Fv1\u002Forders\u002F{id}\u002Fpay-on-delivery\u002Fcollected","Mark pay on delivery collected",{"operationId":304,"slug":305,"method":98,"path":306,"summary":307,"tag":240},"markPayOnDeliveryNotPaid","mark-pay-on-delivery-not-paid","\u002Fv1\u002Forders\u002F{id}\u002Fpay-on-delivery\u002Fnot-paid","Mark pay on delivery not paid",{"operationId":309,"slug":310,"method":98,"path":311,"summary":312,"tag":240},"rejectOrder","reject-order","\u002Fv1\u002Forders\u002F{id}\u002Freject","Reject an order",{"name":36,"slug":314,"description":315,"operations":316},"warranties","Warranties on what you sold: sent on checkout lines or added afterwards. Shoppers keep them in their Cartirra account.",[317,322,327,331,336,341],{"operationId":318,"slug":319,"method":104,"path":320,"summary":321,"tag":36},"listWarranties","list-warranties","\u002Fv1\u002Fwarranties","List warranties",{"operationId":323,"slug":324,"method":104,"path":325,"summary":326,"tag":36},"getWarranty","get-warranty","\u002Fv1\u002Fwarranties\u002F{id}","Retrieve a warranty",{"operationId":328,"slug":329,"method":134,"path":325,"summary":330,"tag":36},"updateWarranty","update-warranty","Update a warranty",{"operationId":332,"slug":333,"method":98,"path":334,"summary":335,"tag":36},"voidWarranty","void-warranty","\u002Fv1\u002Fwarranties\u002F{id}\u002Fvoid","Void a warranty",{"operationId":337,"slug":338,"method":104,"path":339,"summary":340,"tag":36},"listOrderWarranties","list-order-warranties","\u002Fv1\u002Forders\u002F{id}\u002Fwarranties","List an order's warranties",{"operationId":342,"slug":343,"method":98,"path":339,"summary":344,"tag":36},"createWarranty","create-warranty","Add a warranty to an order",{"name":346,"slug":347,"description":348,"operations":349},"Payments","payments","The payment behind an order (bank transfer or card).",[350],{"operationId":351,"slug":352,"method":104,"path":353,"summary":354,"tag":346},"getPayment","get-payment","\u002Fv1\u002Fpayments\u002F{id}","Retrieve a payment",{"name":356,"slug":357,"description":358,"operations":359},"Refunds","refunds","Return money to the shopper, in full or in part.",[360,365],{"operationId":361,"slug":362,"method":104,"path":363,"summary":364,"tag":356},"listRefunds","list-refunds","\u002Fv1\u002Forders\u002F{id}\u002Frefunds","List refunds",{"operationId":366,"slug":367,"method":98,"path":363,"summary":368,"tag":356},"createRefund","create-refund","Create a refund",{"name":370,"slug":371,"description":372,"operations":373},"Receipts","receipts","Receipts and credit notes issued for orders.",[374,379],{"operationId":375,"slug":376,"method":104,"path":377,"summary":378,"tag":370},"getOrderReceipt","get-order-receipt","\u002Fv1\u002Forders\u002F{id}\u002Freceipt","Retrieve a receipt",{"operationId":380,"slug":381,"method":104,"path":382,"summary":383,"tag":370},"listOrderCreditNotes","list-order-credit-notes","\u002Fv1\u002Forders\u002F{id}\u002Fcredit-notes","List credit notes",{"name":385,"slug":386,"description":387,"operations":388},"Customers","customers","Shoppers who shared their details with your business.",[389,394,399,404],{"operationId":390,"slug":391,"method":104,"path":392,"summary":393,"tag":385},"listCustomerActivity","list-customer-activity","\u002Fv1\u002Fcustomers\u002F{id}\u002Factivity","List customer activity",{"operationId":395,"slug":396,"method":104,"path":397,"summary":398,"tag":385},"listCustomerAddresses","list-customer-addresses","\u002Fv1\u002Fcustomers\u002F{id}\u002Faddresses","List customer addresses",{"operationId":400,"slug":401,"method":104,"path":402,"summary":403,"tag":385},"listCustomers","list-customers","\u002Fv1\u002Fcustomers","List customers",{"operationId":405,"slug":406,"method":104,"path":407,"summary":408,"tag":385},"getCustomer","get-customer","\u002Fv1\u002Fcustomers\u002F{id}","Retrieve a customer",{"name":410,"slug":411,"description":412,"operations":413},"Promotions","promotions","Discount codes and automatic promotions.",[414,419,423,428],{"operationId":415,"slug":416,"method":104,"path":417,"summary":418,"tag":410},"listPromotions","list-promotions","\u002Fv1\u002Fpromotions","List promotions",{"operationId":420,"slug":421,"method":98,"path":417,"summary":422,"tag":410},"createPromotion","create-promotion","Create a promotion",{"operationId":424,"slug":425,"method":104,"path":426,"summary":427,"tag":410},"getPromotion","get-promotion","\u002Fv1\u002Fpromotions\u002F{id}","Retrieve a promotion",{"operationId":429,"slug":430,"method":134,"path":426,"summary":431,"tag":410},"updatePromotion","update-promotion","Update a promotion",{"name":433,"slug":434,"description":435,"operations":436},"Gift cards","gift-cards","Issue and list gift cards.",[437,442],{"operationId":438,"slug":439,"method":104,"path":440,"summary":441,"tag":433},"listGiftCards","list-gift-cards","\u002Fv1\u002Fgift-cards","List gift cards",{"operationId":443,"slug":444,"method":98,"path":440,"summary":445,"tag":433},"createGiftCard","create-gift-card","Issue a gift card",{"name":447,"slug":448,"description":449,"operations":450},"Reviews","reviews","Ratings shoppers left on completed orders.",[451],{"operationId":452,"slug":453,"method":104,"path":454,"summary":455,"tag":447},"listReviews","list-reviews","\u002Fv1\u002Freviews","List reviews",{"name":457,"slug":458,"description":459,"operations":460},"Balance","balance","Your Cartirra balance and its movements.",[461,466,471,476],{"operationId":462,"slug":463,"method":104,"path":464,"summary":465,"tag":457},"getBalance","get-balance","\u002Fv1\u002Fbalance","Retrieve balance",{"operationId":467,"slug":468,"method":104,"path":469,"summary":470,"tag":457},"listBalanceTransactions","list-balance-transactions","\u002Fv1\u002Fbalance\u002Ftransactions","List balance transactions",{"operationId":472,"slug":473,"method":104,"path":474,"summary":475,"tag":457},"getBalanceTransaction","get-balance-transaction","\u002Fv1\u002Fbalance\u002Ftransactions\u002F{id}","Retrieve a balance transaction",{"operationId":477,"slug":478,"method":104,"path":479,"summary":480,"tag":457},"getDeposit","get-deposit","\u002Fv1\u002Fbalance\u002Fdeposits\u002F{id}","Retrieve a deposit",{"name":482,"slug":483,"description":484,"operations":485},"Payouts","payouts","Money sent from your balance to your bank account.",[486,491],{"operationId":487,"slug":488,"method":104,"path":489,"summary":490,"tag":482},"listPayouts","list-payouts","\u002Fv1\u002Fpayouts","List payouts",{"operationId":492,"slug":493,"method":104,"path":494,"summary":495,"tag":482},"getPayout","get-payout","\u002Fv1\u002Fpayouts\u002F{id}","Retrieve a payout",{"name":497,"slug":498,"description":499,"operations":500},"Stores","stores","Your business's stores.",[501,506],{"operationId":502,"slug":503,"method":104,"path":504,"summary":505,"tag":497},"listStores","list-stores","\u002Fv1\u002Fstores","List stores",{"operationId":507,"slug":508,"method":104,"path":509,"summary":510,"tag":497},"getStore","get-store","\u002Fv1\u002Fstores\u002F{store_id}","Retrieve a store",{"name":512,"slug":513,"description":514,"operations":515},"Events","events","Everything Cartirra sent (or would send) to your webhook endpoint.",[516,521],{"operationId":517,"slug":518,"method":104,"path":519,"summary":520,"tag":512},"listEvents","list-events","\u002Fv1\u002Fevents","List events",{"operationId":522,"slug":523,"method":104,"path":524,"summary":525,"tag":512},"getEvent","get-event","\u002Fv1\u002Fevents\u002F{id}","Retrieve an event",{"name":527,"slug":528,"description":529,"operations":530},"Account","account","The business and mode your key belongs to.",[531],{"operationId":532,"slug":533,"method":104,"path":534,"summary":535,"tag":527},"getContext","get-context","\u002Fv1\u002Fme\u002Fcontext","Retrieve key context",[537,540,543,546,549,552,555,558,561,564,567,570,573,576,579,582,585,588,591,594,597,600,603,606,609,612,615],{"event":538,"slug":539,"summary":538},"order.created","order-created",{"event":541,"slug":542,"summary":541},"order.updated","order-updated",{"event":544,"slug":545,"summary":544},"payment.succeeded","payment-succeeded",{"event":547,"slug":548,"summary":547},"payment.failed","payment-failed",{"event":550,"slug":551,"summary":550},"payment.expired","payment-expired",{"event":553,"slug":554,"summary":553},"refund.succeeded","refund-succeeded",{"event":556,"slug":557,"summary":556},"refund.failed","refund-failed",{"event":559,"slug":560,"summary":559},"payout.paid","payout-paid",{"event":562,"slug":563,"summary":562},"payout.failed","payout-failed",{"event":565,"slug":566,"summary":565},"webhook.test","webhook-test",{"event":568,"slug":569,"summary":568},"customer.created","customer-created",{"event":571,"slug":572,"summary":571},"customer.updated","customer-updated",{"event":574,"slug":575,"summary":574},"bill.opened","bill-opened",{"event":577,"slug":578,"summary":577},"bill.updated","bill-updated",{"event":580,"slug":581,"summary":580},"bill.payment_received","bill-payment-received",{"event":583,"slug":584,"summary":583},"bill.closed","bill-closed",{"event":586,"slug":587,"summary":586},"bill.voided","bill-voided",{"event":589,"slug":590,"summary":589},"customer.consent_revoked","customer-consent-revoked",{"event":592,"slug":593,"summary":592},"order.issue_reported","order-issue-reported",{"event":595,"slug":596,"summary":595},"order.issue_updated","order-issue-updated",{"event":598,"slug":599,"summary":598},"warranty.created","warranty-created",{"event":601,"slug":602,"summary":601},"warranty.updated","warranty-updated",{"event":604,"slug":605,"summary":604},"warranty.voided","warranty-voided",{"event":607,"slug":608,"summary":607},"order.accepted","order-accepted",{"event":610,"slug":611,"summary":610},"order.rejected","order-rejected",{"event":613,"slug":614,"summary":613},"loyalty.tier_changed","loyalty-tier-changed",{"event":616,"slug":617,"summary":616},"loyalty.reward_redeemed","loyalty-reward-redeemed",{"id":619,"title":57,"body":620,"description":59,"extension":897,"group":52,"meta":898,"navigation":899,"order":58,"path":56,"seo":900,"stem":901,"__hash__":902},"guides\u002Fguides\u002Fidempotency.md",{"type":621,"value":622,"toc":892},"minimark",[623,632,708,713,774,781,785,809,813,881,888],[624,625,626,627,631],"p",{},"Networks fail. If a request to create something times out, you can't tell whether Cartirra received it. An ",[628,629,630],"strong",{},"idempotency key"," makes the retry safe: Cartirra runs the request once and returns the first response to every retry.",[633,634,639],"pre",{"className":635,"code":636,"language":637,"meta":638,"style":638},"language-bash shiki shiki-themes github-light github-dark","curl -X POST https:\u002F\u002Fapi.cartirra.com\u002Fv1\u002Forders\u002Ford_0193a1b2c3d47e5f8a9b0c1d2e3f4a5b\u002Frefunds \\\n  -H \"Authorization: Bearer $CARTIRRA_SECRET_KEY\" \\\n  -H \"Idempotency-Key: 6f1c2b7e-1d5a-4c55-9a0e-7d6f3f1b9a10\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{ \"amount\": { \"amount\": \"2000.00\", \"currency\": \"NGN\" }, \"reason\": \"Missing item\" }'\n","bash","",[640,641,642,664,681,690,699],"code",{"__ignoreMap":638},[643,644,646,650,654,658,661],"span",{"class":645,"line":12},"line",[643,647,649],{"class":648},"sScJk","curl",[643,651,653],{"class":652},"sj4cs"," -X",[643,655,657],{"class":656},"sZZnC"," POST",[643,659,660],{"class":656}," https:\u002F\u002Fapi.cartirra.com\u002Fv1\u002Forders\u002Ford_0193a1b2c3d47e5f8a9b0c1d2e3f4a5b\u002Frefunds",[643,662,663],{"class":652}," \\\n",[643,665,666,669,672,676,679],{"class":645,"line":17},[643,667,668],{"class":652},"  -H",[643,670,671],{"class":656}," \"Authorization: Bearer ",[643,673,675],{"class":674},"sVt8B","$CARTIRRA_SECRET_KEY",[643,677,678],{"class":656},"\"",[643,680,663],{"class":652},[643,682,683,685,688],{"class":645,"line":42},[643,684,668],{"class":652},[643,686,687],{"class":656}," \"Idempotency-Key: 6f1c2b7e-1d5a-4c55-9a0e-7d6f3f1b9a10\"",[643,689,663],{"class":652},[643,691,692,694,697],{"class":645,"line":47},[643,693,668],{"class":652},[643,695,696],{"class":656}," \"Content-Type: application\u002Fjson\"",[643,698,663],{"class":652},[643,700,702,705],{"class":645,"line":701},5,[643,703,704],{"class":652},"  -d",[643,706,707],{"class":656}," '{ \"amount\": { \"amount\": \"2000.00\", \"currency\": \"NGN\" }, \"reason\": \"Missing item\" }'\n",[709,710,712],"h2",{"id":711},"which-endpoints-take-one","Which endpoints take one",[714,715,716,729],"table",{},[717,718,719],"thead",{},[720,721,722,726],"tr",{},[723,724,725],"th",{},"Endpoint",[723,727,728],{},"Idempotency-Key",[730,731,732,746,756,765],"tbody",{},[720,733,734,740],{},[735,736,737],"td",{},[640,738,739],{},"POST \u002Fv1\u002Forders\u002F{id}\u002Frefunds",[735,741,742,745],{},[628,743,744],{},"Required."," Refunds move money.",[720,747,748,753],{},[735,749,750],{},[640,751,752],{},"POST \u002Fv1\u002Fcheckout-sessions",[735,754,755],{},"Recommended",[720,757,758,763],{},[735,759,760],{},[640,761,762],{},"POST \u002Fv1\u002Fpromotions",[735,764,755],{},[720,766,767,772],{},[735,768,769],{},[640,770,771],{},"POST \u002Fv1\u002Fgift-cards",[735,773,755],{},[624,775,776,777,780],{},"Each endpoint's reference page says whether it takes a key. Reads (",[640,778,779],{},"GET",") don't need one.",[709,782,784],{"id":783},"rules","Rules",[786,787,788,796,799,802],"ul",{},[789,790,791,792,795],"li",{},"A key is 8–255 characters of ",[640,793,794],{},"A–Z a–z 0–9 . _ : -",". A UUID v4 is a good choice.",[789,797,798],{},"Make one key per action, not per attempt: generate it before the first try and reuse it for every retry of that action.",[789,800,801],{},"Keys are kept for 24 hours and belong to your business and mode.",[789,803,804,805,808],{},"A replay returns the first status and body, with the header ",[640,806,807],{},"Idempotency-Replayed: true",".",[709,810,812],{"id":811},"what-you-may-see","What you may see",[714,814,815,828],{},[717,816,817],{},[720,818,819,822,825],{},[723,820,821],{},"Status",[723,823,824],{},"Code",[723,826,827],{},"Meaning",[730,829,830,843,855,868],{},[720,831,832,835,840],{},[735,833,834],{},"400",[735,836,837],{},[640,838,839],{},"idempotency_key_required",[735,841,842],{},"This endpoint needs a key and none was sent",[720,844,845,847,852],{},[735,846,834],{},[735,848,849],{},[640,850,851],{},"validation_failed",[735,853,854],{},"The key isn't 8–255 allowed characters",[720,856,857,860,865],{},[735,858,859],{},"409",[735,861,862],{},[640,863,864],{},"idempotency_request_in_progress",[735,866,867],{},"The first request with this key is still running. Wait a moment and retry",[720,869,870,873,878],{},[735,871,872],{},"422",[735,874,875],{},[640,876,877],{},"idempotency_key_reused",[735,879,880],{},"The key was already used for a different request. Use a new key for a new action",[624,882,883,884,887],{},"Errors are remembered too: if the first request failed validation, the retry gets the same error. A ",[640,885,886],{},"5xx"," is not remembered, so retrying the same key after a server error runs the request again, safely.",[889,890,891],"style",{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}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);}",{"title":638,"searchDepth":17,"depth":42,"links":893},[894,895,896],{"id":711,"depth":17,"text":712},{"id":783,"depth":17,"text":784},{"id":811,"depth":17,"text":812},"md",{},true,{"title":57,"description":59},"guides\u002Fidempotency","fR7kwyCZh5B_Z7p1iz2acvKqiQQ2fGdoJqnYiVMpc9Y",[904,906],{"title":51,"path":50,"stem":905,"children":-1},"guides\u002Fpagination",{"title":62,"path":61,"stem":907,"children":-1},"guides\u002Ferrors",1795864569992]