curl --request GET \
--url https://api.gojinko.com/v1/trip/{trip_id}/payment_attempts/{payment_attempt_id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.gojinko.com/v1/trip/{trip_id}/payment_attempts/{payment_attempt_id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.gojinko.com/v1/trip/{trip_id}/payment_attempts/{payment_attempt_id}', 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/trip/{trip_id}/payment_attempts/{payment_attempt_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.gojinko.com/v1/trip/{trip_id}/payment_attempts/{payment_attempt_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.gojinko.com/v1/trip/{trip_id}/payment_attempts/{payment_attempt_id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gojinko.com/v1/trip/{trip_id}/payment_attempts/{payment_attempt_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"payment_attempt_id": "<string>",
"trip_id": "<string>",
"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>",
"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": "Malformed JSON in request body.",
"doc_url": "https://docs.gojinko.com/concepts/errors"
}
}{
"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"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found.",
"doc_url": "https://docs.gojinko.com/concepts/errors"
}
}{
"error": {
"code": "CONFLICT",
"message": "The operation conflicts with the current state of the resource.",
"doc_url": "https://docs.gojinko.com/concepts/errors"
}
}{
"error": {
"code": "GONE",
"message": "The resource no longer exists.",
"doc_url": "https://docs.gojinko.com/concepts/errors"
}
}{
"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": "UPSTREAM_UNAVAILABLE",
"message": "The service is temporarily unavailable. Retry after the Retry-After delay.",
"doc_url": "https://docs.gojinko.com/concepts/errors"
}
}{
"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"
}
}trip payment-attempts
Read a payment attempt outcome
curl --request GET \
--url https://api.gojinko.com/v1/trip/{trip_id}/payment_attempts/{payment_attempt_id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.gojinko.com/v1/trip/{trip_id}/payment_attempts/{payment_attempt_id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.gojinko.com/v1/trip/{trip_id}/payment_attempts/{payment_attempt_id}', 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/trip/{trip_id}/payment_attempts/{payment_attempt_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.gojinko.com/v1/trip/{trip_id}/payment_attempts/{payment_attempt_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.gojinko.com/v1/trip/{trip_id}/payment_attempts/{payment_attempt_id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gojinko.com/v1/trip/{trip_id}/payment_attempts/{payment_attempt_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"payment_attempt_id": "<string>",
"trip_id": "<string>",
"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>",
"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": "Malformed JSON in request body.",
"doc_url": "https://docs.gojinko.com/concepts/errors"
}
}{
"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"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found.",
"doc_url": "https://docs.gojinko.com/concepts/errors"
}
}{
"error": {
"code": "CONFLICT",
"message": "The operation conflicts with the current state of the resource.",
"doc_url": "https://docs.gojinko.com/concepts/errors"
}
}{
"error": {
"code": "GONE",
"message": "The resource no longer exists.",
"doc_url": "https://docs.gojinko.com/concepts/errors"
}
}{
"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": "UPSTREAM_UNAVAILABLE",
"message": "The service is temporarily unavailable. Retry after the Retry-After delay.",
"doc_url": "https://docs.gojinko.com/concepts/errors"
}
}{
"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
Response
Payment attempt outcome
not_started, pending, requires_authentication, authorized, captured, declined, cancelling, cancelled, expired, failed Show child attributes
Show child attributes
Show child attributes
Show child attributes
automatic, manual_review Why the booking failed, when it failed after payment and the cause is known: offer_not_available, 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_not_available, 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
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
