Integration Guides

Sync Orders

Connect your customer's orders to their Croissant Collection.

When to call the /carts endpoints

Create New Carts POST /carts.

Your customer completes checkout

You will include if your customer's isOptedIn value is "true" or "false". The isConverted property will be true because your customer has paid for their order. This request must be made authenticated and from a server. This endpoint does not support client-side requests.

isOptedIn

Your customer's isOptedIn value is tracked in their browser's localStorage.

// Retrieve the value from localStorage
const optInValue = localStorage.getItem('croissant_opt_in');

Your store fulfills your customer's order

When your customer's order has been fulfilled, send a POST request to /carts/{id}/fulfill Your customers will not be able to sell their item to Croissant until the order has been fulfilled. Include the same include the value of id you passed along when the cart was created.

Your store cancels your customer's order

If you need to cancel a customer's order, send a POST request to /carts/{id}/cancel

๐Ÿšง

API Cart-tastrophe Prevention

Make sure you are capturing the 'isOptedIn' attribute from your customer's cart. When this value is 'true', the customer's Croissant-Eligible products will automatically populate in their Croissant Collection.


๐Ÿงช Recipes

Example Request POST /carts: Customer Completed Checkout