Update a Checkout Session
POST / v1 / checkout / sessions /:id
Updates a Checkout Session object.
Related guide: Dynamically update a Checkout Session
Parameters
- line _ items array of objects A list of items the customer is purchasing. When updating line items, you must retransmit the entire array of line items. To retain an existing line item, specify its
id. To update an existing line item, specify itsidalong with the new values of the fields to update. To add a new line item, specify one ofpriceorprice_dataandquantity. To remove an existing line item, omit the line item’s ID from the retransmitted array. To reorder a line item, specify it at the desired position in the retransmitted array. - metadata map Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to
metadata.
More parameters
- collected _ information object
- shipping _ options array of objects
Returns
Returns a Checkout Session object.
Response
Retrieve a Checkout Session
GET / v1 / checkout / sessions /:id
Retrieves a Checkout Session object.
Parameters
No parameters.
Returns
Returns a Checkout Session object.
Response
Retrieve a Checkout Session's line items
GET / v1 / checkout / sessions /:id / line_items
When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
Parameters
No parameters.
More parameters
- ending _ before string
- limit integer
- starting _ after string
Returns
A dictionary with a data property that contains an array of up to limit Checkout Session line items, starting after Line Item starting_after. Each entry in the array is a separate Line Item object. If no more line items are available, the resulting array will be empty.
Response
