trip tool builds the trip and returns a trip_id. The agent passes that ID to checkout, which prices the full trip, returns the priced quote’s quote_id, and returns the payment options available for that transaction.
Payment flow
Checkout Link
Use a Checkout Link when a person should review the trip and enter the payment details. Jinko hosts the payment page. The traveler sees the trip and combined total, then completes the payment in the browser.- The agent builds the trip and receives its
trip_id. - The agent calls
checkoutwith thattrip_id. - Checkout returns a
checkout_url. - The agent sends or opens the link for the traveler.
- The traveler reviews the trip and pays on the hosted page.
Shared Payment Token
Use a Shared Payment Token when the agent should pay programmatically without sending the traveler to a payment page.- The agent calls
checkoutwith thetrip_id. - Checkout returns the total, its
quote_idandexpires_at, andagent_spt_paramswith the maximum amount, currency, and payment profile. - The agent platform uses those parameters to mint a Shared Payment Token.
- The agent calls
submit_agent_paymentwith thetrip_id, the token, and thequote_idthe traveler approved. - Jinko authorizes the payment and starts fulfillment.
Pay the quote the traveler approved
Pass thequote_id from the checkout the traveler approved. The payment is then taken against that quote only:
- A
quote_idthat is not one of the trip’s quotes is refused withNOT_FOUND, and nothing is charged. - A quote that can no longer be paid, because it passed its
expires_ator the travelers changed after it was priced, is refused withQUOTE_EXPIRED, and nothing is charged. Run checkout again, show the new total, and pay the newquote_id. - Running checkout again creates a new quote. A payment that names the earlier
quote_idstill pays the earlier quote while it is valid, so it never moves to a price the traveler did not see.
quote_id, the payment is taken against the trip’s latest valid quote, and the answer names the quote it charged as quote_id.
Retries never charge twice
Each payment submission carries an idempotency key:- MCP
submit_agent_paymentderives the key from thetrip_id, thequote_idand the token. Calling it again with the same three returns the first attempt’s outcome instead of charging again. - REST takes the key in the
Idempotency-Keyheader on a typed submission toPOST /v1/agent_payment/submit, a body withtrip_id,quote_idandpayment. The header is required there: without it the request is refused with 400CREDENTIAL_FORMAT_INVALID. Use 1 to 255 printable ASCII characters and one key per intended payment. The key is compared on the trip, the quote, the credential type and the amount, not on the credential itself: the same key with the same trip and quote replays the first outcome, even when the token differs (the first accepted request wins and the new token is never tried). The same key with a different trip, quote or credential type is refused with 409IDEMPOTENCY_KEY_REUSED.
jinko agent-pay submit --trip-id <id> --quote-id <id> --token <spt> and derives the key the way MCP does. A body with only trip_id and shared_payment_token is the older form: it pays the trip’s latest valid quote and ignores Idempotency-Key.
Virtual Credit Card
Use a Virtual Credit Card when your secure backend should pay programmatically with a VCC. VCC payments must be enabled for the tenant and listed as available by checkout. A VCC has no customer authentication handoff, so the credential must complete without one.Choose the right path
- Choose Checkout Link when a person should review and pay.
- Choose Shared Payment Token when an agent platform controls payment.
- Choose Virtual Credit Card when your secure backend provides an enabled VCC.
