curl --request POST \
--url https://api.gojinko.com/v1/agent_payment/submit \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"trip_id": "<string>",
"quote_id": "2097152",
"payment": {
"type": "spt",
"shared_payment_token": "<string>"
}
}
'import requests
url = "https://api.gojinko.com/v1/agent_payment/submit"
payload = {
"trip_id": "<string>",
"quote_id": "2097152",
"payment": {
"type": "spt",
"shared_payment_token": "<string>"
}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
trip_id: '<string>',
quote_id: '2097152',
payment: {type: 'spt', shared_payment_token: '<string>'}
})
};
fetch('https://api.gojinko.com/v1/agent_payment/submit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gojinko.com/v1/agent_payment/submit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'trip_id' => '<string>',
'quote_id' => '2097152',
'payment' => [
'type' => 'spt',
'shared_payment_token' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gojinko.com/v1/agent_payment/submit"
payload := strings.NewReader("{\n \"trip_id\": \"<string>\",\n \"quote_id\": \"2097152\",\n \"payment\": {\n \"type\": \"spt\",\n \"shared_payment_token\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.gojinko.com/v1/agent_payment/submit")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"trip_id\": \"<string>\",\n \"quote_id\": \"2097152\",\n \"payment\": {\n \"type\": \"spt\",\n \"shared_payment_token\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gojinko.com/v1/agent_payment/submit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"trip_id\": \"<string>\",\n \"quote_id\": \"2097152\",\n \"payment\": {\n \"type\": \"spt\",\n \"shared_payment_token\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"payment_attempt_id": "<string>",
"trip_id": "trip_1048576",
"quote_id": "2097152",
"quoted_cart_id": 123,
"payment_status": "not_started",
"booking_status": "<string>",
"payment_error": {
"code": "CREDENTIAL_FORMAT_INVALID",
"message": "<string>"
},
"recovery": {
"action": "poll",
"replacement_credential_required": true
},
"recovery_status": "automatic",
"fulfillment_cart_id": 123,
"failure_reason": "booking_not_created",
"items": [
{
"item_id": 123,
"outcome": "<string>",
"booked_item_id": "itm_aaaaaaaaaaaaafhuxsdxpbzrbfz5hm3a",
"failure_reason": "booking_not_created"
}
],
"booking_ref": "<string>",
"quote_expires_at": "2023-11-07T05:31:56Z",
"retry_after_seconds": 123,
"authentication": {
"url": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
},
"money": {
"authorized": {
"amount": 123,
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50"
},
"captured": {
"amount": 123,
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50"
},
"released": {
"amount": 123,
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50"
},
"refunded": {
"amount": 123,
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50"
},
"externally_reimbursed": {
"amount": 123,
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50"
},
"resolution_status": "pending",
"refund_reference": "<string>"
}
}{
"payment_attempt_id": "<string>",
"trip_id": "trip_1048576",
"quote_id": "2097152",
"quoted_cart_id": 123,
"payment_status": "not_started",
"booking_status": "<string>",
"payment_error": {
"code": "CREDENTIAL_FORMAT_INVALID",
"message": "<string>"
},
"recovery": {
"action": "poll",
"replacement_credential_required": true
},
"recovery_status": "automatic",
"fulfillment_cart_id": 123,
"failure_reason": "booking_not_created",
"items": [
{
"item_id": 123,
"outcome": "<string>",
"booked_item_id": "itm_aaaaaaaaaaaaafhuxsdxpbzrbfz5hm3a",
"failure_reason": "booking_not_created"
}
],
"booking_ref": "<string>",
"quote_expires_at": "2023-11-07T05:31:56Z",
"retry_after_seconds": 123,
"authentication": {
"url": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
},
"money": {
"authorized": {
"amount": 123,
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50"
},
"captured": {
"amount": 123,
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50"
},
"released": {
"amount": 123,
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50"
},
"refunded": {
"amount": 123,
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50"
},
"externally_reimbursed": {
"amount": 123,
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50"
},
"resolution_status": "pending",
"refund_reference": "<string>"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>",
"doc_url": "<string>",
"field": "selections[1].quantity"
},
"payment_error": {
"code": "CREDENTIAL_FORMAT_INVALID",
"message": "<string>"
},
"recovery": {
"action": "poll",
"replacement_credential_required": true
},
"expires_at": "2026-09-04T12:39:56Z",
"quote_id": "2097152",
"quoted_cart_id": 2097152,
"reason": "travelers_changed"
}{
"error": {
"code": "AUTH_REQUIRED",
"message": "Invalid or expired API key.",
"doc_url": "https://docs.gojinko.com/authentication/api-keys"
}
}{
"error": {
"code": "PAYMENT_REQUIRED",
"message": "Insufficient balance — this call costs $0.0150 and your organization has $0.0000 available. Top up at https://dashboard.gojinko.com/developers/billing/topup",
"doc_url": "https://docs.gojinko.com/concepts/errors"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>",
"doc_url": "<string>",
"field": "selections[1].quantity"
},
"payment_error": {
"code": "CREDENTIAL_FORMAT_INVALID",
"message": "<string>"
},
"recovery": {
"action": "poll",
"replacement_credential_required": true
},
"expires_at": "2026-09-04T12:39:56Z",
"quote_id": "2097152",
"quoted_cart_id": 2097152,
"reason": "travelers_changed"
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>",
"doc_url": "<string>",
"field": "selections[1].quantity"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>",
"doc_url": "<string>",
"field": "selections[1].quantity"
},
"payment_error": {
"code": "CREDENTIAL_FORMAT_INVALID",
"message": "<string>"
},
"recovery": {
"action": "poll",
"replacement_credential_required": true
},
"expires_at": "2026-09-04T12:39:56Z",
"quote_id": "2097152",
"quoted_cart_id": 2097152,
"reason": "travelers_changed"
}{
"error": {
"code": "QUOTE_EXPIRED",
"message": "The quote behind this checkout expired at 2026-09-04T12:39:56Z.",
"doc_url": "https://docs.gojinko.com/concepts/errors"
},
"expires_at": "2026-09-04T12:39:56Z",
"quote_id": "2097152",
"reason": "travelers_changed"
}{
"error": {
"code": "BAD_REQUEST",
"message": "A required field is missing or invalid.",
"doc_url": "https://docs.gojinko.com/concepts/errors"
}
}{
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests. Retry after the Retry-After delay.",
"doc_url": "https://docs.gojinko.com/concepts/errors"
}
}{
"error": {
"code": "UPSTREAM_REJECTED",
"message": "The request was declined for this offer. Try another offer.",
"doc_url": "https://docs.gojinko.com/concepts/errors"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>",
"doc_url": "<string>",
"field": "selections[1].quantity"
},
"payment_error": {
"code": "CREDENTIAL_FORMAT_INVALID",
"message": "<string>"
},
"recovery": {
"action": "poll",
"replacement_credential_required": true
},
"expires_at": "2026-09-04T12:39:56Z",
"quote_id": "2097152",
"quoted_cart_id": 2097152,
"reason": "travelers_changed"
}{
"error": {
"code": "UPSTREAM_TIMEOUT",
"message": "The request timed out before a result was available. Retry the request.",
"doc_url": "https://docs.gojinko.com/concepts/errors"
}
}agent-payment submit
Submit a typed SPT payment with Idempotency-Key, or a legacy flat Shared Payment Token
curl --request POST \
--url https://api.gojinko.com/v1/agent_payment/submit \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"trip_id": "<string>",
"quote_id": "2097152",
"payment": {
"type": "spt",
"shared_payment_token": "<string>"
}
}
'import requests
url = "https://api.gojinko.com/v1/agent_payment/submit"
payload = {
"trip_id": "<string>",
"quote_id": "2097152",
"payment": {
"type": "spt",
"shared_payment_token": "<string>"
}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
trip_id: '<string>',
quote_id: '2097152',
payment: {type: 'spt', shared_payment_token: '<string>'}
})
};
fetch('https://api.gojinko.com/v1/agent_payment/submit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gojinko.com/v1/agent_payment/submit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'trip_id' => '<string>',
'quote_id' => '2097152',
'payment' => [
'type' => 'spt',
'shared_payment_token' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gojinko.com/v1/agent_payment/submit"
payload := strings.NewReader("{\n \"trip_id\": \"<string>\",\n \"quote_id\": \"2097152\",\n \"payment\": {\n \"type\": \"spt\",\n \"shared_payment_token\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.gojinko.com/v1/agent_payment/submit")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"trip_id\": \"<string>\",\n \"quote_id\": \"2097152\",\n \"payment\": {\n \"type\": \"spt\",\n \"shared_payment_token\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gojinko.com/v1/agent_payment/submit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"trip_id\": \"<string>\",\n \"quote_id\": \"2097152\",\n \"payment\": {\n \"type\": \"spt\",\n \"shared_payment_token\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"payment_attempt_id": "<string>",
"trip_id": "trip_1048576",
"quote_id": "2097152",
"quoted_cart_id": 123,
"payment_status": "not_started",
"booking_status": "<string>",
"payment_error": {
"code": "CREDENTIAL_FORMAT_INVALID",
"message": "<string>"
},
"recovery": {
"action": "poll",
"replacement_credential_required": true
},
"recovery_status": "automatic",
"fulfillment_cart_id": 123,
"failure_reason": "booking_not_created",
"items": [
{
"item_id": 123,
"outcome": "<string>",
"booked_item_id": "itm_aaaaaaaaaaaaafhuxsdxpbzrbfz5hm3a",
"failure_reason": "booking_not_created"
}
],
"booking_ref": "<string>",
"quote_expires_at": "2023-11-07T05:31:56Z",
"retry_after_seconds": 123,
"authentication": {
"url": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
},
"money": {
"authorized": {
"amount": 123,
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50"
},
"captured": {
"amount": 123,
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50"
},
"released": {
"amount": 123,
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50"
},
"refunded": {
"amount": 123,
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50"
},
"externally_reimbursed": {
"amount": 123,
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50"
},
"resolution_status": "pending",
"refund_reference": "<string>"
}
}{
"payment_attempt_id": "<string>",
"trip_id": "trip_1048576",
"quote_id": "2097152",
"quoted_cart_id": 123,
"payment_status": "not_started",
"booking_status": "<string>",
"payment_error": {
"code": "CREDENTIAL_FORMAT_INVALID",
"message": "<string>"
},
"recovery": {
"action": "poll",
"replacement_credential_required": true
},
"recovery_status": "automatic",
"fulfillment_cart_id": 123,
"failure_reason": "booking_not_created",
"items": [
{
"item_id": 123,
"outcome": "<string>",
"booked_item_id": "itm_aaaaaaaaaaaaafhuxsdxpbzrbfz5hm3a",
"failure_reason": "booking_not_created"
}
],
"booking_ref": "<string>",
"quote_expires_at": "2023-11-07T05:31:56Z",
"retry_after_seconds": 123,
"authentication": {
"url": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
},
"money": {
"authorized": {
"amount": 123,
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50"
},
"captured": {
"amount": 123,
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50"
},
"released": {
"amount": 123,
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50"
},
"refunded": {
"amount": 123,
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50"
},
"externally_reimbursed": {
"amount": 123,
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50"
},
"resolution_status": "pending",
"refund_reference": "<string>"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>",
"doc_url": "<string>",
"field": "selections[1].quantity"
},
"payment_error": {
"code": "CREDENTIAL_FORMAT_INVALID",
"message": "<string>"
},
"recovery": {
"action": "poll",
"replacement_credential_required": true
},
"expires_at": "2026-09-04T12:39:56Z",
"quote_id": "2097152",
"quoted_cart_id": 2097152,
"reason": "travelers_changed"
}{
"error": {
"code": "AUTH_REQUIRED",
"message": "Invalid or expired API key.",
"doc_url": "https://docs.gojinko.com/authentication/api-keys"
}
}{
"error": {
"code": "PAYMENT_REQUIRED",
"message": "Insufficient balance — this call costs $0.0150 and your organization has $0.0000 available. Top up at https://dashboard.gojinko.com/developers/billing/topup",
"doc_url": "https://docs.gojinko.com/concepts/errors"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>",
"doc_url": "<string>",
"field": "selections[1].quantity"
},
"payment_error": {
"code": "CREDENTIAL_FORMAT_INVALID",
"message": "<string>"
},
"recovery": {
"action": "poll",
"replacement_credential_required": true
},
"expires_at": "2026-09-04T12:39:56Z",
"quote_id": "2097152",
"quoted_cart_id": 2097152,
"reason": "travelers_changed"
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>",
"doc_url": "<string>",
"field": "selections[1].quantity"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>",
"doc_url": "<string>",
"field": "selections[1].quantity"
},
"payment_error": {
"code": "CREDENTIAL_FORMAT_INVALID",
"message": "<string>"
},
"recovery": {
"action": "poll",
"replacement_credential_required": true
},
"expires_at": "2026-09-04T12:39:56Z",
"quote_id": "2097152",
"quoted_cart_id": 2097152,
"reason": "travelers_changed"
}{
"error": {
"code": "QUOTE_EXPIRED",
"message": "The quote behind this checkout expired at 2026-09-04T12:39:56Z.",
"doc_url": "https://docs.gojinko.com/concepts/errors"
},
"expires_at": "2026-09-04T12:39:56Z",
"quote_id": "2097152",
"reason": "travelers_changed"
}{
"error": {
"code": "BAD_REQUEST",
"message": "A required field is missing or invalid.",
"doc_url": "https://docs.gojinko.com/concepts/errors"
}
}{
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests. Retry after the Retry-After delay.",
"doc_url": "https://docs.gojinko.com/concepts/errors"
}
}{
"error": {
"code": "UPSTREAM_REJECTED",
"message": "The request was declined for this offer. Try another offer.",
"doc_url": "https://docs.gojinko.com/concepts/errors"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>",
"doc_url": "<string>",
"field": "selections[1].quantity"
},
"payment_error": {
"code": "CREDENTIAL_FORMAT_INVALID",
"message": "<string>"
},
"recovery": {
"action": "poll",
"replacement_credential_required": true
},
"expires_at": "2026-09-04T12:39:56Z",
"quote_id": "2097152",
"quoted_cart_id": 2097152,
"reason": "travelers_changed"
}{
"error": {
"code": "UPSTREAM_TIMEOUT",
"message": "The request timed out before a result was available. Retry the request.",
"doc_url": "https://docs.gojinko.com/concepts/errors"
}
}Authorizations
Headers
Required on a typed submission (a body with payment); without it the request is refused with 400 CREDENTIAL_FORMAT_INVALID. Ignored on the legacy body. 1–255 printable ASCII characters. Reuse only for the same payment submission: the same key with the same body replays the first outcome, with a different body it is refused.
1 - 255^[ -~]+$(?![\s\S])Body
- Option 1
- Option 2
The quote the traveler approved: the quote_id checkout returned. The payment is taken against this quote only; a quote that is no longer payable is refused with 410 QUOTE_EXPIRED and nothing is charged.
^[1-9][0-9]{0,17}$(?![\s\S])"2097152"
Show child attributes
Show child attributes
Response
Legacy authorization result or typed payment outcome
- Option 1
- Option 2
The trip this attempt pays, written with a trip_ prefix (trip_1048576); the trip answers carry the same id without it (1048576). Strip the prefix to compare the two.
"trip_1048576"
The quote this payment is taken against.
"2097152"
Deprecated: use quote_id instead. The same quote as an integer.
not_started, pending, requires_authentication, authorized, captured, declined, cancelling, cancelled, expired, failed The detailed status of the booking this payment started, not_scheduled until booking begins. booking_state on GET /v1/trip/{trip_id} is its summary.
Why the payment has not gone through, or null. On the checkout_url payment page, a card the issuer declines (card_declined) or whose authentication fails (authentication_failed) is reported here while payment_status stays pending and recovery.action is poll: the payer can use another card on the same page until the quote expires. It returns to null when a card is authorized. CARD_ALIAS_EXPIRED: The card alias expired before the booking was dispatched. Follow recovery.action; when it is retry_new_key: Submit the card again on the pay hostname with a new Idempotency-Key.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
automatic, manual_review Deprecated: use booking_ref instead. An internal number for the booking this payment funds.
Why the booking failed, when it failed after payment and the cause is known: offer_unavailable, price_changed, booking_not_created (the supplier holds no booking; nothing was booked and no money was taken), booking_cancelled_at_provider, ticketing_refused. Null otherwise. For offer_unavailable, the supplier no longer sells the priced offer. Nothing was booked and the card authorisation was released. Search again and book a new offer. The booking.failed webhook carries the same reason with a sentence to show the traveller (failure_message).
"booking_not_created"
Show child attributes
Show child attributes
The booking reference. Absent until the booking has one; never null.
Seconds to wait before reading the payment attempt again. Present only while recovery.action is poll; absent otherwise, never null.
Where the customer authenticates when recovery.action is authenticate: open url before expires_at. For a Shared Payment Token (spt), url is a Jinko-hosted page that needs the token's hashed value: read the issued token's next_action.use_stripe_sdk.value with your own Stripe secret key and open url + "#hv=" + <value>, passing the value unchanged. The value travels in the URL fragment, which keeps it out of server logs.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
