Discounts & Cart Data
Croissant Pay is not a Shopify payment method. It reduces the amount due with discounts equal to the value it has authorized, then settles with you directly. Read this before touching cart code, and before adding automatic discounts of your own.
The Five Discounts
The app registers five automatic discounts on install. They stay inert until a shopper authorizes a Croissant Pay session.
| Discount | Class | Represents |
|---|---|---|
| Croissant Incentive | Order | A first-order offer, when the shopper qualifies |
| Croissant Credit Drop | Order | A targeted credit award Croissant sent the shopper |
| Croissant Credit | Order | The shopper's existing Croissant credit balance |
| Croissant Pay | Order | The amount authorized on the shopper's card |
| Croissant Shipping | Shipping | Free shipping on every delivery option |
What Reaches the Order
The authorized value arrives as separate discount lines — one for each component that applies, using the titles above. A shopper with no offer and no credit drop sees three lines rather than five. Two properties are worth knowing when you verify an order:
- The Croissant discount lines always sum to the amount Croissant authorized for that cart. This is the check to make when testing.
- Each is capped against the order total, so the combined Croissant discounts can never exceed what is owed, whatever happens to the cart afterwards.
Free shipping applies whenever a session is authorized, and is not configurable per store.
Stacking With Your Own Discounts
Croissant's discounts are registered as combinable, so they are set up to coexist with your promotions:
| Croissant discount | Combines with product | Combines with order | Combines with shipping |
|---|---|---|---|
| Incentive, Credit Drop, Credit, Pay | Yes | Yes | Yes |
| Shipping | Yes | Yes | No |
The one deliberate exception is shipping: Croissant Shipping does not combine with other shipping discounts. If you run your own free-shipping promotion, expect one of the two to win rather than both to apply — which is the correct outcome, since shipping can only be free once.
Cart Data You Must Not Modify
When a shopper authorizes, Croissant records the authorization on the cart so the discounts apply at checkout. What that looks like depends on your plan.
Shopify Plus
Handled entirely by the checkout block. Nothing is added to your cart attributes and nothing in your theme needs to change.
Basic, Grow, and Advanced
The cart block adds the Croissant cart attributes below. Treat every one as an opaque value owned by Croissant: your theme, your apps, and anything else touching the cart must leave them exactly as they are.
| Cart attribute | Visible in admin |
|---|---|
croissant_pay_token | Yes |
croissant_pay_checkout_id | Yes |
_croissant_pay_session_id | No |
_croissant_pay_subtotal | No |
Attributes prefixed with an underscore are private to Shopify: they travel with the cart and order and are readable through the API, but are not displayed in the admin.
To confirm the handoff worked, from any browser on the storefront:
// After returning from the Croissant session
fetch("/cart.js")
.then((r) => r.json())
.then(({ attributes }) => console.log(attributes));
// Expect the four croissant_* attributes to be presentattributes object — replacing the object drops keys you did not include. Clearing them cancels the shopper's authorization for that cart, and they will reach checkout with no discount. Croissant clears them itself when they are no longer valid; you never need to.When the Cart Changes After Authorization
Croissant authorizes a specific amount against the cart as it stood. If the shopper edits the cart afterwards, the discounts still cap to the live order total, so the store is never over-discounted — but the shopper may now be leaving credit unused. The Croissant block detects this and offers to re-authorize: the update action in the checkout block on Plus, or the Your cart changed state on the cart for other plans.
You do not need to handle any of this. Just do not hide the Croissant block once a session is authorized, or the shopper will have no way to update or remove it.
Next: Orders & Reconciliation → what lands on the order and what Croissant receives