curl --request POST \
--url https://api.gojinko.com/v1/flight_refund_preview \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"booking_ref": "JNK-A0AUR2",
"last_name": "Doe"
}
'import requests
url = "https://api.gojinko.com/v1/flight_refund_preview"
payload = {
"booking_ref": "JNK-A0AUR2",
"last_name": "Doe"
}
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({booking_ref: 'JNK-A0AUR2', last_name: 'Doe'})
};
fetch('https://api.gojinko.com/v1/flight_refund_preview', 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/flight_refund_preview",
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([
'booking_ref' => 'JNK-A0AUR2',
'last_name' => 'Doe'
]),
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/flight_refund_preview"
payload := strings.NewReader("{\n \"booking_ref\": \"JNK-A0AUR2\",\n \"last_name\": \"Doe\"\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/flight_refund_preview")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"booking_ref\": \"JNK-A0AUR2\",\n \"last_name\": \"Doe\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gojinko.com/v1/flight_refund_preview")
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 \"booking_ref\": \"JNK-A0AUR2\",\n \"last_name\": \"Doe\"\n}"
response = http.request(request)
puts response.read_body{
"seat_refunds": [
{
"offer_id": "<string>",
"seat_number": "12B",
"status": "pending_airline_refund",
"amount": {
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50"
},
"carrier": "United",
"message": "Your paid seat will be refunded once United refunds Jinko.",
"airline_refund_registered": true,
"traveler_ref": "pax_1",
"pax_ref_id": "pax_1"
}
],
"quote_id": "svq_01J7ZR3M8FKX2P9C",
"quote": "svq_01J7ZR3M8FKX2P9C",
"state": "completed",
"commitable": true,
"support_level": "AUTO",
"manual_reason": "fare rules require agent review",
"operation_kind": "cancel",
"settlement_basis": "sell_minus_penalty",
"expires_at": "2026-09-03T12:15:00Z",
"booked_item_id": "itm_7f2c9a4e8b1d",
"item": "itm_7f2c9a4e8b1d",
"refund": {
"amount": 123,
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50",
"amount_money": {
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50"
},
"basis": "sell_minus_penalty"
},
"penalty": {
"amount": 123,
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50",
"amount_money": {
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50"
},
"fee_known": true,
"breakdown": {
"airline_fee": {
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50"
},
"non_refundable_taxes": {
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50"
},
"used_fare": {
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50"
}
}
},
"documents": [
{
"number": "0012345678901",
"type": "TKT",
"state": "ACTIVE",
"recoverable": false
}
],
"ancillary_recoverable": true,
"not_commitable_reason": "manual_required"
}{
"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": "NOT_FOUND",
"message": "booking not found"
}
}{
"error": {
"code": "CONFLICT",
"message": "This booking cannot be cancelled online. Contact Jinko support."
},
"code": "not_cancellable"
}{
"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"
}
}flight-refund-preview
Preview what cancelling a booked flight (every ticket on the item) would return to the customer
curl --request POST \
--url https://api.gojinko.com/v1/flight_refund_preview \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"booking_ref": "JNK-A0AUR2",
"last_name": "Doe"
}
'import requests
url = "https://api.gojinko.com/v1/flight_refund_preview"
payload = {
"booking_ref": "JNK-A0AUR2",
"last_name": "Doe"
}
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({booking_ref: 'JNK-A0AUR2', last_name: 'Doe'})
};
fetch('https://api.gojinko.com/v1/flight_refund_preview', 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/flight_refund_preview",
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([
'booking_ref' => 'JNK-A0AUR2',
'last_name' => 'Doe'
]),
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/flight_refund_preview"
payload := strings.NewReader("{\n \"booking_ref\": \"JNK-A0AUR2\",\n \"last_name\": \"Doe\"\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/flight_refund_preview")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"booking_ref\": \"JNK-A0AUR2\",\n \"last_name\": \"Doe\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gojinko.com/v1/flight_refund_preview")
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 \"booking_ref\": \"JNK-A0AUR2\",\n \"last_name\": \"Doe\"\n}"
response = http.request(request)
puts response.read_body{
"seat_refunds": [
{
"offer_id": "<string>",
"seat_number": "12B",
"status": "pending_airline_refund",
"amount": {
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50"
},
"carrier": "United",
"message": "Your paid seat will be refunded once United refunds Jinko.",
"airline_refund_registered": true,
"traveler_ref": "pax_1",
"pax_ref_id": "pax_1"
}
],
"quote_id": "svq_01J7ZR3M8FKX2P9C",
"quote": "svq_01J7ZR3M8FKX2P9C",
"state": "completed",
"commitable": true,
"support_level": "AUTO",
"manual_reason": "fare rules require agent review",
"operation_kind": "cancel",
"settlement_basis": "sell_minus_penalty",
"expires_at": "2026-09-03T12:15:00Z",
"booked_item_id": "itm_7f2c9a4e8b1d",
"item": "itm_7f2c9a4e8b1d",
"refund": {
"amount": 123,
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50",
"amount_money": {
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50"
},
"basis": "sell_minus_penalty"
},
"penalty": {
"amount": 123,
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50",
"amount_money": {
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50"
},
"fee_known": true,
"breakdown": {
"airline_fee": {
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50"
},
"non_refundable_taxes": {
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50"
},
"used_fare": {
"value": 41250,
"currency": "USD",
"decimal_places": 2,
"display": "USD 412.50"
}
}
},
"documents": [
{
"number": "0012345678901",
"type": "TKT",
"state": "ACTIVE",
"recoverable": false
}
],
"ancillary_recoverable": true,
"not_commitable_reason": "manual_required"
}{
"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": "NOT_FOUND",
"message": "booking not found"
}
}{
"error": {
"code": "CONFLICT",
"message": "This booking cannot be cancelled online. Contact Jinko support."
},
"code": "not_cancellable"
}{
"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"
}
}refund is what the customer paid less the penalty; for a ticket that was exchanged it is what the airline refunds for the ticket now held, on a void as on a refund (settlement_basis: supplier_refund). All amounts are customer-facing only. The platform decides WHICH operation this is and reports it as operation_kind: a ticket still inside its void window is void, the ticket is voided, penalty-free, and anything else is cancel, a refund under the fare rules. You cannot ask for one; read what you are given, because the void window closes with time. commitable: false with support_level: MANUAL_REQUIRED is not a dead end: the commit takes manual_ok: true and hands the operation to a Jinko agent. The handle this returns is named quote: it is what POST /v1/flight_refund_commit consumes, and it stops binding at expires_at. Every call here needs API authentication; this is about which mode identifies the booking. Call get_booking first, then send booking_ref and the selected booked_item_id. Guests must send last_name; owning credentials may omit it. The deprecated provider, order_id, provider_reference and provider_booking_id are accepted until 2027-04-30 where the request declares them; a request that sends one is answered with Deprecation and Sunset headers.Body
The booked item, from get_booking items[].booked_item_id. Preserved across exchanges. Omit only when the booking has exactly one item of the requested domain; otherwise a 409 returns items to choose from.
^itm_[a-z2-7]+$(?![\s\S])"itm_aaaaaaaaaaaaafhuxsdxpbzrbfz5hm3a"
Deprecated: name the booking with booking_ref and booked_item_id from get_booking. Names the booking instead of booking_ref and last_name, never beside it, and needs a credential that owns the booking. Accepted until 2027-04-30; a request that sends it is answered with Deprecation and Sunset headers.
1Response
What cancelling the flight item would return
Whether a commit against this quote would be accepted as it stands. A MANUAL_REQUIRED quote is never commitable and is still SUBMITTABLE: send the commit with manual_ok: true to hand it to a Jinko agent. Otherwise, when false, not_commitable_reason says why and committing is pointless.
true
How this refund would be carried out. AUTO — the platform refunds the ticket end to end under the fare rules. AUTO_VOID — the ticket is still inside the airline's void window, so the platform voids it and the ENTIRE charge is reversed, penalty-free; there is no supplier figure to report on a void. MANUAL_REQUIRED — it is possible, but a Jinko agent has to act (manual_reason says why): the commit is refused unless you send manual_ok: true, which hands it to that agent. Do not treat MANUAL_REQUIRED as a failure. Time-sensitive: a void window closes, so read the level from a live preview.
AUTO, AUTO_VOID, MANUAL_REQUIRED What this quote would do — refund the ticket under the fare rules (cancel) or void it (void). On a void the whole charge comes back and the penalty is zero. The status read reports the operation that actually ran under this same name, so the two compare directly. The handle that binds this quote is quote; operation is the "svc_…" handle the COMMIT answers, and it never appears on a quote.
cancel, void How the refund is settled. sell_minus_penalty — what the customer paid for this ticket, less the penalty (a cancellation). original_charge — the whole charge is reversed, penalty-free (a void). supplier_refund — the ticket was exchanged, and the refund is what the airline refunds for the ticket now held, on a void as on a cancellation. It follows operation_kind and whether the ticket was exchanged, which the platform derives; the caller cannot ask for one.
"sell_minus_penalty"
Whether the ancillaries bought with this ticket come back with it. false when any document is an EMD — the platform cannot refund or void one, so that value has to be recovered by a person, and the quote is MANUAL_REQUIRED. Tell the customer before they commit, not after.
true
Why commitable is false. Today: manual_required (a Jinko agent has to act — resubmit with manual_ok: true; manual_reason says why), penalty_exceeds_sell (the penalty is at least what the customer paid), multi_currency_basis (the airline prices the refund in a currency the customer was not charged in, so no single figure exists). Two refusals are never values here: a fare the airline will not refund is 409 not_cancellable from this preview itself, and an airline with no refund route is 422 provider_unsupported. The contract reserves further values (provider_unsupported, funds_unavailable, insufficient_time_to_converge) and new reasons may be added, so treat an unrecognised value as "not right now".
"manual_required"
