How it works
- 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 submits the token with the
trip_idand thequote_idthe traveler approved. - Jinko authorizes the payment and starts fulfillment.
expires_at, call checkout again and mint a new token against the new agent_spt_params. A stale quote is refused with QUOTE_EXPIRED, and nothing is charged.
Submit the token
MCP: callsubmit_agent_payment with the trip_id, the quote_id and the token. On success the answer carries the Jinko booking reference booking_ref; get_trip returns the same booking_ref if the reply is lost.
REST: send a typed submission to POST /v1/agent_payment/submit with an Idempotency-Key header:
jinko agent-pay submit --trip-id <id> --quote-id <id> --token <spt> sends the same typed submission.
MCP and the CLI derive the idempotency key from the trip_id, the quote_id and the token: calling again with the same three returns the first attempt’s outcome instead of charging again. On REST you choose the key; see Retries never charge twice.
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.
Customer authentication
If the traveler’s bank requires customer authentication (3-D Secure), the traveler must complete it before the payment can finish. The submission then answerspayment_status: requires_authentication with authentication, a url and its expires_at (the same time as quote_expires_at):
- Read your issued token’s
next_action.use_stripe_sdk.valuewith your Stripe secret key. - Send the traveler to
authentication.urlwith#hv=and that value appended, unchanged, beforeauthentication.expires_at. You can instead runstripe.handleNextAction({ hashedValue })on your own page. - Read the trip until
payment_attempt.payment_statusis no longerrequires_authentication,cancellingorpending. authorizedorcapturedmeans the payment went through and fulfillment proceeds.failed,declinedorcancelledmeans it did not: submit a new token before the deadline.expiredmeans the quote expired with it: call checkout again, then mint and submit a new token.
Declined token
When the token is declined, the answer carries acheckout_url instead of a booking_ref. The traveler can pay there with another method, or the agent can submit a new token before the quote expires.
