跳转到主要内容
POST
此请求使用创建 customer 资源时生成的唯一标识符来创建结账会话。
如果您的工作流需要发送 additional_data 对象,可以将其作为结账会话的一部分发送。

授权

public-api-key
string
header
默认值:<Your public-api-key>
必填
private-secret-key
string
header
默认值:<Your private-secret-key>
必填

请求体

application/json
merchant_order_id
string
必填

The unique identifier of the customer's order (MAX 255; MIN 3).

payment_description
string
必填

The description of the payment (MAX 255; MIN 3).

country
string
必填

Country where the transaction must be processed (MAX 2; MIN 2; ISO 3166-1).

account_id
string
必填

The unique identifier of the account. You find this information on the Yuno dashboard (UUID, 36 chars).

customer_id
string

The unique identifier of the customer, created using the Create Customer endpoint (UUID, 36 chars).

callback_url
string

The URL where we will redirect your customer after making the purchase. Required for alternative payment methods with redirection. (MAX 526; MIN 3)

amount
object

Specifies the payment amount object, with the value and currency.

alternative_amount
object

Alternative currency representation of the transaction amount.

shipping_methods
object[]

Delivery options the customer can pick from inside a wallet widget (Fast Checkout). The first method is preselected. The currency of every amount must match the session currency.

metadata
object[]

Specifies a list of metadata objects. You can add up to 120 metadata objects.

workflow
enum<string>

Checkout workflow type.

可用选项:
SDK_CHECKOUT,
CHECKOUT,
SDK_SEAMLESS
installments
object

The object to send the installment plan created in Yuno to show your customers and let them choose from. This optional field is used in case a particular installments plan needs to be used in the session. if not sent, we will display the installment plan created for the account for each scenario, if any.

recurring_payment
object

Optional object to enable and configure recurring payments (subscriptions).

checkout_id
string

The unique identifier (UUID) of the Custom Checkout to use for this session. Optional. When omitted, the session uses the account's default checkout. The checkout must be a checkout configuration published on the same account as the session, otherwise the API rejects the request with 400 INVALID_CHECKOUT_CODE.

wallet_card_acceptance
object

Optional. Limits which cards the customer can select in the Apple Pay payment sheet. Cards that do not match are shown greyed out. Every field is optional; a field that is not sent keeps the default behaviour. Values must be uppercase, and an empty list is rejected with 400 INVALID_PARAMETERS. It can only be set when the session is created.

summary_items
object[]

Order breakdown the wallet sheet displays (at least one item; the last entry is the grand total). The currency of every amount must match the session currency. When shipping_methods is also sent, Apple Pay uses the first method's summary_items instead; Google Pay does the same only when the shipping address handler is registered.

tax_collection
boolean

Set to true to quote and charge the tax of the customer's address before the payment. Needs external_subscription with customer_id and items, and your organization must have tax collection enabled (403 PRODUCT_NOT_ENABLED otherwise). With the SDK, pass onBillingAddressChanged to startCheckout. Default false.

示例:

true

external_subscription
object

The Stripe Billing subscription that Yuno creates after the payment is approved, for the price and tax flow described in Local price and taxes. Send customer_id and items. id (an existing subscription) cannot be sent with items or with tax_collection. trial_period_days and metadata are not supported yet and are rejected with 400.

响应

200

merchant_order_id
string
示例:

"1717681150"

checkout_session
string
示例:

"c437f4cc-7d66-40e6-a8df-7c3cde1ddca7"

country
string
示例:

"US"

payment_description
string
示例:

"Test Cards"

customer_id
string
示例:

"55006822-7c79-490b-bea1-81798b9afc74"

callback_url
string | null
示例:

"https://www.example.com/?checkoutSession=c437f4cc-7d66-40e6-a8df-7c3cde1ddca7"

amount
object
created_at
string
示例:

"2023-07-20T17:06:17.232130Z"

metadata
object[] | null
workflow
string
示例:

"SDK_CHECKOUT"

installments
object
checkout_id
string
示例:

"6822f80c-684e-41a3-8628-78963d3d60f7"

used
boolean

Used.

示例:

false

tax_collection
boolean

true when the checkout session quotes and charges taxes before the payment.

external_subscription
object

The Stripe Billing subscription that Yuno creates after the payment is approved, for the price and tax flow described in Local price and taxes. Send customer_id and items. id (an existing subscription) cannot be sent with items or with tax_collection. trial_period_days and metadata are not supported yet and are rejected with 400.