Talk to usGet started
Checkout

Start a checkout

Asynchronous. AgentPay opens the merchant in its own browser, reaches the review, mints the card for the real total, pays, and clears 3DS. Returns a checkout_id to poll.

POST/v1/checkout
Live API. A POST to /v1/cards issues a real card.
Authorizations
Authorizationstringrequired
Bearer token: Authorization: Bearer mk_live_.... Create a key in the AgentPay console under Developer, API keys.
Bodyapplication/json
taskstringrequired
What to buy, in plain English.
merchantstringrequired
The merchant to buy from, e.g. namecheap or amazon.
amountnumberrequired
The most to spend, in dollars. Becomes the card cap.
confirm_paybooleandefault: false
false: the run stops at the final review and waits for the account owner's yes in the console. true: pay without a human yes, up to the cap. The agent's own approval mode can only make this stricter; the response's confirm_pay says what was granted.
idempotency_keystring
Your own key for this checkout, up to 120 characters. A retry with the same key returns the same checkout instead of starting a second run. Always send one.
connection_idstring
Run signed in on a connection. When omitted, the newest connected connection for the merchant is used.
own_card_idstring
Pay with the person's connected card (GET /v1/cards, source: "own") instead of an issued one. The run stops at the review until the cardholder approves on their phone; confirm_pay cannot skip that.
resume_ofstring
The id of an ended checkout of yours that left its own items in the basket. The new run continues from that basket.
card_holder_namestring
The name to type on the card for this run. Issued cards only.
start_urlstring
The page to open first: a full https address or a bare domain. Needed when the account has no stored login for the merchant.
Response200application/json
checkout_idstring
The run id. Poll it.
statusstring
queued on creation.
confirm_payboolean
What was granted. true only if you asked for it and the agent's mode allows it.
hoststring
The site the run will open, once known.
pollstring
The path to poll, /v1/checkout/{checkout_id}.
request_idstring
The request id, also in the X-Mooj-Request-Id header.
Errors
StatusCodeWhen
400invalid_requesttask, merchant or amount is missing, or own_card_id is not a card id.
400connection_not_foundconnection_id names no connected connection on the account.
400site_requiredNo stored login for the merchant. Pass start_url, or connect the merchant once in the console.
400site_ambiguousSeveral stored logins for the merchant. hosts lists them; pass start_url.
400agent_requiredThe account has several agents and none was named.
402plan_limitThe plan's cards a month, or per-card cap, is reached.
404card_not_foundNo connected card with that own_card_id.
404checkout_not_foundresume_of names no checkout of yours.
409not_resumableThe resume_of run left nothing in the basket.
409agent_pausedThe agent is paused in the console.
409busyThe merchant session is running another checkout. Retry shortly.
503own_card_unavailablePaying with an own card is not switched on for the account.
502checkout_start_failedThe engine could not be started. Retry with the same idempotency_key.