Sync Orders
Connect your customer's orders to their Croissant Collection.
When to call the /carts
endpoints
/carts
endpointsCreate New Carts POST /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');
Fulfill Orders POST /carts/{id}/fulfill
POST /carts/{id}/fulfill
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.
Cancel Orders POST /carts/{id}/cancel
POST /carts/{id}/cancel
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
POST /carts
: Customer Completed CheckoutUpdated over 1 year ago