Order Lifecycle

After receiving a payment confirmation webhook, use the Croissant Retailer API to manage the order through its lifecycle — fulfillment, cancellation, and returns.

Base URLs

EnvironmentBase URL
Productionhttps://api.retailer.croissant.com/v0
Sandboxhttps://api.retailer.sbx.croissant.com/v0

Authentication

All API requests require a Bearer token. Obtain one using your client credentials:

bash
# Example: obtain a token
curl -X POST https://api.retailer.sbx.croissant.com/v0/token \
  -H "Content-Type: application/json" \
  -d '{"clientId": "your-client-id", "clientSecret": "your-client-secret"}'
Info
Your client credentials are provided by the Croissant team during onboarding. Contact partnerships@croissant.com if you need sandbox or production credentials.

Order Flow

1Receive payment.confirmed webhook → create order in your system
2Call POST /carts to register the order with Croissant
3When shipped, call POST /carts/:id/fulfill to mark as fulfilled
4If cancelled, call POST /carts/:id/cancel instead

Endpoints

Create Order

Register an order with Croissant. This should be called after you receive the payment confirmed webhook and create the order in your system.

Get Order

Retrieve order details including buyback pricing information.

Fulfill Order

Mark an order as fulfilled when it has been shipped or delivered. This triggers settlement processing.

bash
# Example: fulfill an order
curl -X POST https://api.retailer.sbx.croissant.com/v0/carts/550e8400-e29b-41d4-a716-446655440000/fulfill \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIs..."

Cancel Order

Cancel an order. This voids the Croissant Pay session and releases any card hold.

Returns & Refunds

To be updated.

Error Handling

The API returns standard HTTP status codes with a JSON error body:

StatusMeaning
200 / 201Success
400Bad request — check the request body
401Unauthorized — missing or invalid token
403Forbidden — insufficient scopes
404Not found — invalid order ID
422Unprocessable — validation error
500Server error — retry with backoff
json
// Error response format
{
  "message": "Cart not found"
}

Questions? Contact partnerships@croissant.com or reach out to your partnership manager. For a high-level overview, return to the Introduction.