This guide demonstrates how to integrate with the Sell Anything API by walking through the complete lifecycle of a checkout, from creation to final status.
To initiate a new checkout, send a POST
request to:
All processing is asynchronous. Always poll the
GET
endpoint after each major step.Once in a terminal state (
completed
orfailed
), the intent is complete.Use
failureReason
to display helpful error messages to users.
awaiting_confirmation
After creating the intent, poll the following endpoint to wait for it to reach the awaiting_confirmation
state:
Repeat the request every few seconds until you receive:
This reflects completion of background processing (offers, shipping, costs).
Before proceeding to payment confirmation, inspect the latest checkout intent response to confirm:
Ensure your UI reflects the full final cost to the user and allows for selection or changes if applicable.
You can extract this information from the GET /api/v1/checkout-intents/{id}
response payload.
Retrieve a payment token for the credit card you want to use. Follow the steps here.
Once the user has reviewed the final cost and approved, confirm the intent with their payment card information:
After confirmation, poll the GET endpoint again until you reach one of the terminal states:
completed
: Order was placed successfully.failed
: Something went wrong (e.g., out of stock, expired).Example polling logic:
or
This flow enables you to build a robust checkout experience around asynchronous processing and confirmation.