Create a checkout session
Creates a hosted checkout session for the total of the supplied line items and returns its URL. Payment-method saving is enabled by default and requires a customer email; set enablePaymentMethodSave to false to opt out.
Authorization
basic Basic HTTP authentication
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "https://example.com/v1/payments/checkout-session" \ -H "Content-Type: application/json" \ -d '{ "lineItems": [ { "name": "Test Widget", "amount": 2000, "quantity": 1 } ], "successUrl": "https://merchant.example.com/success?session_id={CHECKOUT_SESSION_ID}", "cancelUrl": "https://merchant.example.com/cancel" }'{ "paymentId": "01928e3e-7b6c-7c8e-9b3a-5b9f8b9b9b9b", "status": "PENDING", "amount": 7200, "sessionId": "cs_test_a1B2c3D4", "sessionUrl": "https://checkout.stripe.com/c/pay/cs_test_a1B2c3D4", "customerId": "01928e3e-7b6c-7c8e-9b3a-5b9f8b9b9bcc", "paymentMethodId": "01928e3e-7b6c-7c8e-9b3a-5b9f8b9b9bff"}{ "statusCode": 400, "error": "Bad Request", "message": [ "amount must not be less than 100" ]}{ "statusCode": 401, "error": "Unauthorized", "message": "Missing Authorization header"}Charge a saved payment method POST
Charges an active saved payment method off-session and captures the payment immediately. The payment method must belong to the supplied customer and authenticated merchant.
Retrieve a payment GET
Returns the authenticated merchant's payment with status, amount totals, payment-method details, and transaction and refund history. Payments owned by another merchant are not returned.