创建结账会话
创建与客户关联的结账会话,用于通过 SDK 初始化支付
customer 资源时生成的唯一标识符来创建结账会话。
additional_data 对象,可以将其作为结账会话的一部分发送。授权
请求体
Country where the transaction must be processed (MAX 2; MIN 2; ISO 3166-1).
The unique identifier of the account. You find this information on the Yuno dashboard (UUID, 36 chars).
The unique identifier of the customer, created using the Create Customer endpoint (UUID, 36 chars).
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.
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.
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.
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.
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
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
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.