@gojinko/api-client 2.14.0 → 2.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/public-api.yaml CHANGED
@@ -14,6 +14,56 @@ components:
14
14
  type: http
15
15
  scheme: bearer
16
16
  schemas:
17
+ AgentPaymentSubmitRequest:
18
+ type: object
19
+ properties:
20
+ trip_id:
21
+ type: string
22
+ example: trip_1048576
23
+ shared_payment_token:
24
+ type: string
25
+ example: spt_1Nq8L2eZvKYlo2C0
26
+ required:
27
+ - trip_id
28
+ - shared_payment_token
29
+ AgentPaymentSubmitResponse:
30
+ type: object
31
+ properties:
32
+ fulfillment_cart_id:
33
+ type: integer
34
+ status:
35
+ type: string
36
+ example: processing
37
+ payment_verified:
38
+ type: boolean
39
+ message:
40
+ type: string
41
+ checkout_url:
42
+ type: string
43
+ description: Hosted-checkout fallback, present only on a 3DS step-up / decline.
44
+ recap_token:
45
+ type: string
46
+ AgentSPTParams:
47
+ type: object
48
+ properties:
49
+ max_amount:
50
+ type: integer
51
+ description: Locked cart total in the smallest currency unit — scope the Shared
52
+ Payment Token to at most this.
53
+ example: 259449
54
+ currency:
55
+ type: string
56
+ example: EUR
57
+ stripe_profile:
58
+ type: string
59
+ description: Stripe Agentic Commerce network_business_profile id the SPT is
60
+ granted against. Empty until the preview account is provisioned.
61
+ expires_at:
62
+ type: string
63
+ example: 2026-06-10T13:04:56Z
64
+ required:
65
+ - max_amount
66
+ - currency
17
67
  AncillaryOffer:
18
68
  type: object
19
69
  description: A purchasable ancillary (bag, seat, bundle, ...) offered on a trip item.
@@ -51,6 +101,49 @@ components:
51
101
  type: integer
52
102
  required:
53
103
  - offer_id
104
+ CheckoutRequest:
105
+ type: object
106
+ properties:
107
+ trip_id:
108
+ type: string
109
+ example: trip_1048576
110
+ required:
111
+ - trip_id
112
+ CheckoutResponse:
113
+ type: object
114
+ properties:
115
+ session_id:
116
+ type: string
117
+ example: cs_1048576
118
+ checkout_url:
119
+ type: string
120
+ example: https://book.gojinko.com/checkout?sid=1048576
121
+ status:
122
+ type: string
123
+ example: pending_payment
124
+ expires_at:
125
+ type: string
126
+ example: 2026-06-01T13:04:56Z
127
+ total_amount:
128
+ type: object
129
+ properties:
130
+ amount:
131
+ type: number
132
+ example: 318.4
133
+ value:
134
+ type: number
135
+ currency:
136
+ type: string
137
+ example: USD
138
+ decimal_places:
139
+ type: integer
140
+ example: 2
141
+ items:
142
+ type: array
143
+ items:
144
+ nullable: true
145
+ agent_spt_params:
146
+ $ref: "#/components/schemas/AgentSPTParams"
54
147
  HealthResponse:
55
148
  type: object
56
149
  properties:
@@ -911,39 +1004,6 @@ components:
911
1004
  - trip_id
912
1005
  - item_id
913
1006
  - selections
914
- BookResponse:
915
- type: object
916
- properties:
917
- session_id:
918
- type: string
919
- checkout_url:
920
- type: string
921
- status:
922
- type: string
923
- expires_at:
924
- type: string
925
- total_amount:
926
- type: object
927
- properties:
928
- amount:
929
- type: number
930
- value:
931
- type: number
932
- currency:
933
- type: string
934
- decimal_places:
935
- type: integer
936
- items:
937
- type: array
938
- items:
939
- nullable: true
940
- BookRequest:
941
- type: object
942
- properties:
943
- trip_id:
944
- type: string
945
- required:
946
- - trip_id
947
1007
  HotelSearchResponse:
948
1008
  type: object
949
1009
  properties:
@@ -1524,6 +1584,159 @@ paths:
1524
1584
  application/json:
1525
1585
  schema:
1526
1586
  $ref: "#/components/schemas/HealthResponse"
1587
+ /v1/agent_payment/submit:
1588
+ post:
1589
+ tags:
1590
+ - Pricing & booking
1591
+ summary: Submit an agent payment — present trip_id + a Shared Payment Token to
1592
+ schedule + authorize the booking; returns a checkout_url fallback if
1593
+ customer action (3DS) is required
1594
+ security:
1595
+ - ApiKeyAuth: []
1596
+ - BearerAuth: []
1597
+ requestBody:
1598
+ content:
1599
+ application/json:
1600
+ schema:
1601
+ $ref: "#/components/schemas/AgentPaymentSubmitRequest"
1602
+ responses:
1603
+ "200":
1604
+ description: Authorization result
1605
+ content:
1606
+ application/json:
1607
+ schema:
1608
+ $ref: "#/components/schemas/AgentPaymentSubmitResponse"
1609
+ "400":
1610
+ description: Bad request
1611
+ content:
1612
+ application/json:
1613
+ schema:
1614
+ $ref: "#/components/schemas/ErrorResponse"
1615
+ example:
1616
+ error:
1617
+ code: BAD_REQUEST
1618
+ message: Malformed JSON in request body.
1619
+ doc_url: https://docs.gojinko.com/concepts/errors
1620
+ "401":
1621
+ description: Authentication required
1622
+ content:
1623
+ application/json:
1624
+ schema:
1625
+ $ref: "#/components/schemas/ErrorResponse"
1626
+ example:
1627
+ error:
1628
+ code: AUTH_REQUIRED
1629
+ message: Invalid or expired API key.
1630
+ doc_url: https://docs.gojinko.com/api-reference/authentication
1631
+ "422":
1632
+ description: Validation error
1633
+ content:
1634
+ application/json:
1635
+ schema:
1636
+ $ref: "#/components/schemas/ErrorResponse"
1637
+ example:
1638
+ error:
1639
+ code: BAD_REQUEST
1640
+ message: "origins: origins is required; trip_type: trip_type is required"
1641
+ doc_url: https://docs.gojinko.com/concepts/errors
1642
+ "429":
1643
+ description: Rate limit or quota exceeded
1644
+ content:
1645
+ application/json:
1646
+ schema:
1647
+ $ref: "#/components/schemas/ErrorResponse"
1648
+ example:
1649
+ error:
1650
+ code: RATE_LIMITED
1651
+ message: Rate limit or quota exceeded.
1652
+ doc_url: https://docs.gojinko.com/concepts/errors
1653
+ "502":
1654
+ description: Upstream service error
1655
+ content:
1656
+ application/json:
1657
+ schema:
1658
+ $ref: "#/components/schemas/ErrorResponse"
1659
+ example:
1660
+ error:
1661
+ code: UPSTREAM_ERROR
1662
+ message: Upstream travel provider returned an error. Please retry.
1663
+ doc_url: https://docs.gojinko.com/concepts/errors
1664
+ /v1/checkout:
1665
+ post:
1666
+ tags:
1667
+ - Pricing & booking
1668
+ summary: Checkout a trip — returns a checkout URL the user opens to pay, plus
1669
+ the Shared Payment Token params an agent can use to pay programmatically
1670
+ security:
1671
+ - ApiKeyAuth: []
1672
+ - BearerAuth: []
1673
+ requestBody:
1674
+ content:
1675
+ application/json:
1676
+ schema:
1677
+ $ref: "#/components/schemas/CheckoutRequest"
1678
+ responses:
1679
+ "200":
1680
+ description: Checkout session
1681
+ content:
1682
+ application/json:
1683
+ schema:
1684
+ $ref: "#/components/schemas/CheckoutResponse"
1685
+ "400":
1686
+ description: Bad request
1687
+ content:
1688
+ application/json:
1689
+ schema:
1690
+ $ref: "#/components/schemas/ErrorResponse"
1691
+ example:
1692
+ error:
1693
+ code: BAD_REQUEST
1694
+ message: Malformed JSON in request body.
1695
+ doc_url: https://docs.gojinko.com/concepts/errors
1696
+ "401":
1697
+ description: Authentication required
1698
+ content:
1699
+ application/json:
1700
+ schema:
1701
+ $ref: "#/components/schemas/ErrorResponse"
1702
+ example:
1703
+ error:
1704
+ code: AUTH_REQUIRED
1705
+ message: Invalid or expired API key.
1706
+ doc_url: https://docs.gojinko.com/api-reference/authentication
1707
+ "422":
1708
+ description: Validation error
1709
+ content:
1710
+ application/json:
1711
+ schema:
1712
+ $ref: "#/components/schemas/ErrorResponse"
1713
+ example:
1714
+ error:
1715
+ code: BAD_REQUEST
1716
+ message: "origins: origins is required; trip_type: trip_type is required"
1717
+ doc_url: https://docs.gojinko.com/concepts/errors
1718
+ "429":
1719
+ description: Rate limit or quota exceeded
1720
+ content:
1721
+ application/json:
1722
+ schema:
1723
+ $ref: "#/components/schemas/ErrorResponse"
1724
+ example:
1725
+ error:
1726
+ code: RATE_LIMITED
1727
+ message: Rate limit or quota exceeded.
1728
+ doc_url: https://docs.gojinko.com/concepts/errors
1729
+ "502":
1730
+ description: Upstream service error
1731
+ content:
1732
+ application/json:
1733
+ schema:
1734
+ $ref: "#/components/schemas/ErrorResponse"
1735
+ example:
1736
+ error:
1737
+ code: UPSTREAM_ERROR
1738
+ message: Upstream travel provider returned an error. Please retry.
1739
+ doc_url: https://docs.gojinko.com/concepts/errors
1527
1740
  /v1/find_destination:
1528
1741
  post:
1529
1742
  tags:
@@ -2044,8 +2257,9 @@ paths:
2044
2257
  /v1/book:
2045
2258
  post:
2046
2259
  tags:
2047
- - cart
2048
- summary: Checkout a trip (returns a payment/checkout URL)
2260
+ - Pricing & booking
2261
+ summary: DEPRECATED — use /checkout. Alias retained for backward compatibility.
2262
+ deprecated: true
2049
2263
  security:
2050
2264
  - ApiKeyAuth: []
2051
2265
  - BearerAuth: []
@@ -2053,44 +2267,69 @@ paths:
2053
2267
  content:
2054
2268
  application/json:
2055
2269
  schema:
2056
- $ref: "#/components/schemas/BookRequest"
2270
+ $ref: "#/components/schemas/CheckoutRequest"
2057
2271
  responses:
2058
2272
  "200":
2059
2273
  description: Checkout session
2060
2274
  content:
2061
2275
  application/json:
2062
2276
  schema:
2063
- $ref: "#/components/schemas/BookResponse"
2277
+ $ref: "#/components/schemas/CheckoutResponse"
2064
2278
  "400":
2065
2279
  description: Bad request
2066
2280
  content:
2067
2281
  application/json:
2068
2282
  schema:
2069
2283
  $ref: "#/components/schemas/ErrorResponse"
2284
+ example:
2285
+ error:
2286
+ code: BAD_REQUEST
2287
+ message: Malformed JSON in request body.
2288
+ doc_url: https://docs.gojinko.com/concepts/errors
2070
2289
  "401":
2071
2290
  description: Authentication required
2072
2291
  content:
2073
2292
  application/json:
2074
2293
  schema:
2075
2294
  $ref: "#/components/schemas/ErrorResponse"
2295
+ example:
2296
+ error:
2297
+ code: AUTH_REQUIRED
2298
+ message: Invalid or expired API key.
2299
+ doc_url: https://docs.gojinko.com/api-reference/authentication
2076
2300
  "422":
2077
2301
  description: Validation error
2078
2302
  content:
2079
2303
  application/json:
2080
2304
  schema:
2081
2305
  $ref: "#/components/schemas/ErrorResponse"
2306
+ example:
2307
+ error:
2308
+ code: BAD_REQUEST
2309
+ message: "origins: origins is required; trip_type: trip_type is required"
2310
+ doc_url: https://docs.gojinko.com/concepts/errors
2082
2311
  "429":
2083
2312
  description: Rate limit or quota exceeded
2084
2313
  content:
2085
2314
  application/json:
2086
2315
  schema:
2087
2316
  $ref: "#/components/schemas/ErrorResponse"
2317
+ example:
2318
+ error:
2319
+ code: RATE_LIMITED
2320
+ message: Rate limit or quota exceeded.
2321
+ doc_url: https://docs.gojinko.com/concepts/errors
2088
2322
  "502":
2089
2323
  description: Upstream service error
2090
2324
  content:
2091
2325
  application/json:
2092
2326
  schema:
2093
2327
  $ref: "#/components/schemas/ErrorResponse"
2328
+ example:
2329
+ error:
2330
+ code: UPSTREAM_ERROR
2331
+ message: Upstream travel provider returned an error. Please retry.
2332
+ doc_url: https://docs.gojinko.com/concepts/errors
2094
2333
  /v1/hotel_search:
2095
2334
  post:
2096
2335
  tags: