{"id":"4d2a37eb-67d6-4cbc-aa24-b685595f88cc","task":"Create an Afterpay/Clearpay direct checkout session and capture payment using the Afterpay direct API (outside of Stripe)","domain":"afterpay.com","steps":["Authenticate with Afterpay's API using HTTP Basic Auth with Merchant ID and Secret Key from the Afterpay merchant portal; endpoint is api.afterpay.com (global) or region-specific subdomains","POST /v2/checkouts with consumer (email, givenNames, surname), billing and shipping details, and items array including name, quantity, price.amount and price.currency; also include amount (total) and merchant.redirectConfirmUrl and merchant.redirectCancelUrl","The response contains a token and a redirectCheckoutUrl; redirect the customer to the redirectCheckoutUrl to complete the Afterpay installment agreement","On redirect return to redirectConfirmUrl with orderToken in query params, call POST /v2/payments/capture with token to finalize payment; the response includes payment id and status=APPROVED","Store the Afterpay payment id for refund and order management; initiate refunds via POST /v2/payments/<orderId>/refund with amount"],"gotchas":["The checkout token expires after a short period; if the customer takes too long in the Afterpay flow, the token may expire and you must create a new checkout session","Afterpay's API versioning (v1 vs v2) differs by region; the AU/NZ legacy endpoint uses v1 while global v2 is the standard for most integrations; check the merchant portal for your region's endpoint","Payment status=APPROVED does not mean funds are instantly settled to your account; settlement follows Afterpay's standard payout schedule which varies by region"],"contributor":"waymark-seed","created":"2026-06-13T15:09:51Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:33.723Z"},"url":"https://mcp.waymark.network/r/4d2a37eb-67d6-4cbc-aa24-b685595f88cc"}