Skip to main content
This page runs one purchase end to end. You start with a stored card and finish with a merchant order reference and the amount charged.

Before you start

You need an enrollment with status ACTIVE. Setup covers how to create one, and GET /agentic/enrollments/:id reads its status.
Confirm the enrollment
Continue when status reads ACTIVE. Anything else means you cannot charge the card yet.

Check the mandate

A single charge runs under a mandate with frequency set to ONE_TIME and maxCharges set to 1. Read the mandate with GET /agentic/mandates/:id to confirm the terms before you price anything.
Request
Response
The amount is a ceiling rather than a target. Compare it against the final quote total once you select a shipping option. A one-time mandate authorizes a single charge and cannot authorize another once that charge completes.

Run the purchase

1

Search merchant catalogs

Send the words the user gave you to POST /agentic/products/search. Filters narrow the result set, and context sets the country and currency for pricing.If your application handles discovery, skip the search and variant steps. Construct a merchant checkout URL with the item quantity and any attribution parameters. Then continue at Create the quote.
Request
Response
Shortlist a product by id. Add merchantPreference to the request when the user names a merchant or when you want Reap to prefer one.
2

Read the product details

Search results carry a price range and one preview variant. POST /agentic/products/details expands a product into its description, media, and option groups.
Request
Response
Carry the optionId of each chosen value into the next step. Check available on every option value, because an unavailable value cannot resolve to a purchasable variant. Any product ID that fails to resolve comes back in errors rather than stopping the call.Skip the next step when the user accepts the defaultVariant, which is already a purchasable variant.
3

Resolve the variant

A quote accepts a variant rather than a product. Turn the selected options into one variant with POST /agentic/products/variant.
Request
Response
A requiresShipping value of true means the quote needs a shipping address. Stop here when available reads false and offer the user another option.
4

Create the quote

POST /agentic/quotes opens the merchant checkout and returns current pricing from the merchant. Send exactly one of items and externalCheckout. offerCode is optional for both quote sources.
Use items with the variant IDs returned by Reap discovery. Send the shipping address whenever a variant requires shipping.
Request
Response
Keep the quote ID and note expiresAt. Prices come from the merchant, so the total can differ from the variant price once shipping and tax land.Reap makes one merchant request for each quote attempt. It does not retry a failed request.Correct CHECKOUT_URL_INVALID, OFFER_CODE_INVALID, OFFER_CODE_EXPIRED, and QUOTE_UNFULFILLABLE errors before you create another quote. CARD_PAYMENT_UNAVAILABLE means card payment is unavailable for this checkout. Do not retry the same request unchanged; choose another checkout or contact Reap.
5

Select a shipping option

One option arrives preselected. Send a different one to POST /agentic/quotes/:id/shipping-option, which reprices the quote and returns the updated breakdown.
Request
Response
Show amountBreakdown.finalAmount to the user as the amount you will charge. Read the quote again with GET /agentic/quotes/:id at any point to get the current total without changing anything.
6

Create the checkout

POST /agentic/checkouts charges the enrollment for the quote. Send the URL the user returns to after approving. In the sandbox, send X-Simulate-Checkout: COMPLETED to simulate a completed checkout. This header is rejected in production.
Request
Response
Branch on nextAction. When it holds a value, send the user to nextAction.url to review and approve the charge. When it is empty, the charge already ran under terms the user approved earlier.
7

Confirm the order

Read the checkout with GET /agentic/checkouts/:id once the user lands back on your return URL. A completed checkout carries the merchant order reference and the amount charged.
Request
Response
Store orderId against your own record of the purchase. It is the reference the user and the merchant both recognize. Reconcile against finalAmount rather than the quote total, because it is the amount actually charged.

Next steps

Recurring Purchases

Charge the same card again on a schedule.

Lifecycle and Statuses

Every status value and what to do about it.
Field level detail for every field, header, and error sits in the API Reference tab. This page carries the sequence rather than repeating that detail.