KIZUNA

KIZUNA Agent Open API v1 — Hotels and Ticket Catalogue/Quotes

This document is public. Test and live access to the API is opened only after your company signs a non-disclosure agreement (NDA) with KIZUNA. Other languages: 日本語 · 中文

Status: phase D. This document covers the hotel directory, the hotel search, the offer read, hotel orders and cancellations, the prepaid balance, and the ticket catalogue, open dates and quotes (section 6E). Ticket orders come with a later phase.

1. Basics

Success envelope: {"data": {...}}. Error envelope: {"error": {"code": "...", "message": "..."}}.

2. Test mode and live mode

Mode What answers Cost
test A built-in simulator. The data is fixed and fictional. None. No supplier is contacted.
live Real availability and real selling prices. Counts against the search quota.

Successful responses include "test": true or "test": false. An offer made in one mode does not exist in the other mode.

Simulator hotels (test mode only):

hotel_id Behaviour
900001 Two offers: one refundable with breakfast, one non-refundable room only.
900002 Always sold out.
900003 One refundable offer.

An offer is refundable only while free cancellation is still possible: in test mode, until 3 days before check-in. For test searches, use a check-in date at least 4 days ahead; with a nearer date every test offer is non-refundable.

3. GET /api/agent/v1/hotels — hotel directory

Query parameters (all optional): city, q (part of the hotel name), page (1 to 1000, 50 hotels per page).

curl -H "Authorization: Bearer $TOKEN" \
  "https://splendor-star.co.jp/api/agent/v1/hotels?city=Tokyo&page=1"
{"data": {
  "hotels": [
    {"hotel_id": 900001, "name": "TEST Hotel Sakura (テスト・架空)",
     "name_zh": null, "city": "Test City",
     "address": "1-1 Test Street, Test City", "star_rating": 4.0,
     "latitude": null, "longitude": null}
  ],
  "page": 1, "has_more": false, "test": true
}}

The directory does not use the search quota.

4. POST /api/agent/v1/hotels/search — price and availability

Field Type Rule
hotel_ids list of integers Required. 1 to 20 ids from the directory.
check_in date Required. From tomorrow (Japan time) to 365 days ahead.
check_out date Required. 1 to 14 nights after check_in.
rooms integer 1 to 50. Default 1. 1 to 4 when the guests (rooms × adults_per_room) are fewer than the group size (10 by default; KIZUNA can change it).
adults_per_room integer 1 to 4. Default 2.
nationality string Required. 2-letter country code of the guests.
curl -X POST -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"hotel_ids":[900001,900002],"check_in":"2027-03-01",
       "check_out":"2027-03-03","rooms":1,"adults_per_room":2,
       "nationality":"VN"}' \
  https://splendor-star.co.jp/api/agent/v1/hotels/search
{"data": {
  "currency": "JPY", "test": true,
  "check_in": "2027-03-01", "check_out": "2027-03-03",
  "rooms": 1, "adults_per_room": 2,
  "hotels": [
    {"hotel_id": 900001, "name": "TEST Hotel Sakura (テスト・架空)",
     "offers": [
       {"offer_id": "o_…", "room_name": "TEST Twin Room", "board": "RO",
        "refundable": false, "free_cancel_until": null,
        "total_price": 20000, "price_per_room_night": 10000,
        "expires_at": "2027-01-10T03:30:00Z", "confirmation": "auto"},
       {"offer_id": "o_…", "room_name": "TEST Twin Room", "board": "BB",
        "refundable": true, "free_cancel_until": "2027-02-26T00:00:00Z",
        "total_price": 24000, "price_per_room_night": 12000,
        "expires_at": "2027-01-10T03:30:00Z", "confirmation": "auto"}
     ]}
  ],
  "unavailable_hotel_ids": [900002]
}}

Offer fields:

Field Meaning
offer_id Identifies this price for this agency. Used later to order.
room_name Room type.
board RO room only, BB breakfast, HB half board, FB full board, AI all inclusive, or null.
refundable true when free cancellation is still possible.
free_cancel_until Last moment of free cancellation (UTC), or null.
total_price Whole stay, all rooms, JPY.
price_per_room_night total_price divided by rooms × nights. For display.
expires_at The offer is valid until this time (30 minutes by default).
confirmation auto: confirmed at once when the order fits in your prepaid balance. staff: confirmed by KIZUNA staff.

Notes:

5. GET /api/agent/v1/offers/{offer_id} — read one offer

Returns the offer fields of section 4 and:

{"resource": "hotel", "currency": "JPY", "test": true,
 "hotel": {"hotel_id": 900001, "name": "TEST Hotel Sakura (テスト・架空)",
           "check_in": "2027-03-01", "check_out": "2027-03-03",
           "rooms": 1, "adults_per_room": 2, "nationality": "VN"}}

An offer of another account, or of the other mode, returns 404. An expired offer returns 410 offer_expired. Search again.

6. Limits

Limit Default When exceeded
All agent API requests 120 per minute per token 429 rate_limited
Live searches that need fresh availability 10 per minute and 2,000 per day per agency 429 search_quota_exceeded, Retry-After: 60

KIZUNA can change the search quota per agency. Test mode and repeated searches do not use it.

If you send two identical searches at the same time, both can query availability. Each one then uses one unit of the quota and gets its own offers. Wait for the first answer before you repeat a search.

6A. Orders: before you start

Ordering spends money, so it needs two secrets:

  1. The Bearer token, as for every endpoint.
  2. The order key, in the header X-Order-Key. KIZUNA makes it for your account and gives it to you once. KIZUNA does not retain the plaintext order key; it stores only a verification hash, a last-four-character hint, and the key-set time. KIZUNA cannot show the key again. If you lose it, ask for a new key; the old key then stops working.

Keep the order key on your server only. Do not put it in a browser or an app.

Every order also needs the header Idempotency-Key: 1 to 100 characters of A-Z a-z 0-9 . _ -. Use a new value for each new order. If the connection breaks, send the same request again with the same key. You receive the same order (HTTP 200), in its current state; no second order is created.

Prepaid balance

All API orders are paid in advance, in JPY. There is no credit. KIZUNA records each payment you send as a deposit. The balance is your deposits minus your orders and cancellation fees. An order is confirmed at once only when it fits in the balance. Otherwise KIZUNA staff decide, and the order waits in the state pending_staff. With no deposit, every order waits for staff.

Before the API is switched on

KIZUNA switches the API on (test or live) for your account only after the NDA is signed with your company.

6B. POST /api/agent/v1/bookings — order an offer

Headers: Authorization, X-Order-Key, Idempotency-Key, Content-Type: application/json.

{"offer_id": "o_…", "accepted_total_price": 48000,
 "client_ref": "TEST-0001",
 "rooms": [{"guests": [{"first_name": "TARO", "last_name": "KAKUU"},
                       {"first_name": "HANAKO", "last_name": "KAKUU"}]}],
 "contact": {"first_name": "TARO", "last_name": "KAKUU",
             "email": "test@example.com", "phone": "+81 3 0000 0000"},
 "remarks": "Non-smoking if possible"}
Field Rule
offer_id Required. An offer of your account that has not expired. One offer can be ordered once.
accepted_total_price Required. Integer. The maximum total price you accept, in JPY. It must not be lower than the offered total_price. KIZUNA never books above it.
rooms Required. One entry per room of the offer, each with exactly adults_per_room guests.
first_name, last_name Latin letters, space, ' and -. At most 40 characters.
contact Required. Names as above, a valid e-mail and a phone number.
client_ref Optional. Your own reference. At most 64 characters.
remarks Optional. At most 500 characters. A request to the hotel, not a promise.

Before booking, KIZUNA checks the price with the hotel again. If the price or the cancellation terms changed, nothing is booked and you get 409 price_changed or 409 terms_changed. Search again.

Answers:

HTTP state Meaning
201 confirmed The room is booked.
202 pending_staff KIZUNA staff decide. Read the order later.
202 processing The hotel has not given a final answer yet. Read the order later.
200 any A repeat of an earlier request with the same Idempotency-Key.

The answer body is one order:

{"data": {"booking_id": "b_…", "state": "confirmed", "resource": "hotel",
  "confirmation": "auto", "client_ref": "TEST-0001",
  "total_price": 48000, "currency": "JPY", "refundable": true,
  "free_cancel_until": "2027-02-06T15:00:00Z", "failure_code": null,
  "cancellation_fee": null, "test": false,
  "hotel": {"hotel_id": 101, "name": "…", "room_name": "…", "board": "BB",
            "check_in": "2027-02-10", "check_out": "2027-02-12",
            "rooms": 1, "adults_per_room": 2},
  "created_at": "…", "confirmed_at": "…"}}

In test mode the simulator decides: hotel 900003 waits for staff, the other simulator hotels are confirmed at once. No money moves.

6C. Read orders and the balance

Endpoint Answer
GET /api/agent/v1/bookings?page=1 {"bookings": [order, …], "page": 1, "has_more": false, "test": false}, newest first, 50 per page.
GET /api/agent/v1/bookings/{booking_id} One order, as above. An order of another account reads as 404.
GET /api/agent/v1/balance {"currency": "JPY", "deposited": 0, "used": 0, "balance": 0, "test": false}

Test orders and live orders are kept apart, like offers.

6D. Cancel (two steps)

  1. Send POST /api/agent/v1/bookings/{booking_id}/cancel-quote. No body is needed. Answer: {"booking_id": "b_…", "quote_id": "q_…", "fee": 0, "currency": "JPY", "expires_at": "…Z", "test": false}.
  2. Send POST /api/agent/v1/bookings/{booking_id}/cancel. The X-Order-Key header is required. Body: {"quote_id": "q_…", "accept_fee": 0}. Put the quote_id and the fee of the quote in the body, unchanged (accept_fee is a whole number).

A quote is valid for a few minutes (expires_at). When it has expired, ask for a new quote. Each quote has a new quote_id. A new quote makes the older one invalid (409 quote_changed). For an order in pending_staff, quote_id is null; leave it out of the cancel body.

Order state Result
pending_staff No quote needed. accept_fee is 0. The order becomes cancelled at once (200).
confirmed, fee 0 A free cancellation is submitted without a cancellation fee. It becomes cancelled when cancellation is confirmed (200); until then it may remain cancel_pending (202).
confirmed, with a fee The order becomes cancel_pending (202). KIZUNA staff handle it. Read the order later.
processing Cannot be cancelled (409 invalid_state). Wait for the final answer.

6E. Tickets: catalogue, open dates, quote (phase D)

Ticket orders are not open yet. POST /api/agent/v1/bookings with a ticket offer answers 409 resource_not_orderable. Use the quote to show a price; book the ticket through KIZUNA staff for now.

Request Answer
GET /api/agent/v1/tickets?q=&page=1 {"tickets": [ticket, …], "page": 1, "has_more": false, "test": false}, 50 per page. q matches the ticket name.
POST /api/agent/v1/tickets/{ticket_id}/availability Open dates of one plan.
POST /api/agent/v1/tickets/{ticket_id}/quote A price for given ticket types and counts on one date.

A ticket has ticket_id, name, area, categories, description, cancel_policy and plans. Each plan has plan_id, name, confirmation (auto or staff), booking_deadline, min_tickets, max_tickets, start_times ([{"start_time_id", "time"}], empty when the plan has no start time) and ticket_types ([{"unit_id", "name", "type"}]).

Availability body: {"plan_id": 1, "date_from": "YYYY-MM-DD", "date_to": "YYYY-MM-DD"}. Dates run from tomorrow (Japan time) to 365 days ahead; one request covers at most 31 days. The answer lists every day: {"date", "available", "start_time_ids"}. It has no price: ask for a quote.

Quote body: {"plan_id": 1, "date": "YYYY-MM-DD", "start_time_id": 2, "tickets": [{"unit_id": 3, "count": 2}]}. Send start_time_id only when the plan has start times. The total count must be within the plan's min_tickets and max_tickets. The answer is {"currency": "JPY", "test", "ticket_id", "plan_id", "date", "start_time_id", "available", "offer"}. offer is null when the date is not available or the ticket is not offered to your account. Otherwise it is {"offer_id", "total_price", "tickets", "expires_at", "confirmation"}; GET /api/agent/v1/offers/{offer_id} reads it again.

Availability and quotes count against the same search quota as the hotel search. In test mode three fictional tickets (ids 910001–910003) answer: one with instant confirmation and two start times (closed on Tuesdays), one confirmed by staff, one always sold out.

7. Errors

HTTP code Meaning
400 invalid_json The body is not a JSON object.
400 invalid_hotel_ids, invalid_check_in, invalid_check_out, invalid_dates, invalid_rooms, invalid_adults_per_room, invalid_nationality, invalid_page The named field is wrong.
401 unauthorized The token is missing or not valid.
403 api_not_enabled The open API is off for this account.
404 not_found No such offer or order for this account.
410 offer_expired Search again.
400 invalid_offer_id, invalid_accepted_total_price, invalid_guest_name, invalid_contact, invalid_client_ref, invalid_remarks Order: the named field is wrong. invalid_rooms also means the rooms or guests do not match the offer.
400 missing_idempotency_key, invalid_idempotency_key Order: the Idempotency-Key header is missing or wrong.
401 invalid_order_key Order: the X-Order-Key header is missing or not valid.
409 offer_already_used This offer was already ordered. Search again.
409 price_changed, terms_changed, offer_unavailable Nothing was booked. Search again.
409 idempotency_conflict This Idempotency-Key was used with a different request.
409 request_in_progress The first request with this Idempotency-Key is still running. Retry later with the same key.
409 booking_failed The booking could not be made. Nothing was charged.
400 invalid_accept_fee Cancel: accept_fee must be a whole number of yen, 0 or more.
409 cancel_quote_required Cancel: ask for a quote first (also when the quote has expired).
400 invalid_quote_id Cancel: quote_id is missing or not the id of a quote.
409 fee_mismatch Cancel: accept_fee is not the quoted fee.
409 quote_changed Cancel or quote: another quote was made meanwhile. Ask for a quote again.
409 invalid_state Cancel: an order in this state cannot be cancelled.
409 cancel_unavailable Cancel: no quote is available now. Try again later or contact KIZUNA.
409 cancel_failed Cancel: the cancellation could not be sent. The order stands. Ask for a new quote.
429 rate_limited, search_quota_exceeded Wait, then retry.
400 invalid_plan_id, invalid_date_from, invalid_date_to, invalid_date, invalid_dates, invalid_start_time_id, invalid_tickets Tickets: the named field is wrong.
409 resource_not_orderable Order: this kind of offer (tickets) cannot be ordered through the API yet.
409 offer_needs_staff Order: a group-price offer (confirmation staff) cannot be ordered through the API. Nothing was booked and the offer stays valid. Contact KIZUNA staff.
503 supplier_unavailable Prices are temporarily unavailable. Retry after Retry-After seconds.
503 internal_error A temporary error on the KIZUNA side. Retry after Retry-After seconds.

8. What the API never returns

Cost prices, markup rates, rebates and the names of KIZUNA's suppliers are not part of any response.