This page explains how to use promo codes when submitting an order through the API. Rye supports two approaches: passing your own codes manually, and automatic promo code discovery.Documentation Index
Fetch the complete documentation index at: https://docs-test.rye.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Manual Promo Codes
With each order, you can include multiple promo codes to see if there are any applicable discounts. Our system will automatically check each code, and apply the first one that is valid.Example
Promo codes are provided when creating a checkout intent as an array of strings within thepromoCodes field, with each string representing a single code.
appliedPromoCodes with its discount in discount.amountSubunits.
Automatic Promo Code Discovery
SetdiscoverPromoCodes: true when creating a checkout intent and Rye will automatically find and apply the best available promo code for the merchant. This is a cost optimization feature — Rye aggregates promo codes from multiple sources, caches them, and selects the code that gives the highest discount during offer retrieval, with no manual sourcing required on your end.
How it works
- Include
"discoverPromoCodes": truein your create checkout intent request. - During offer retrieval, Rye searches its aggregated promo code database for the merchant.
- The best available code is applied automatically.
- The applied code and discount amount appear in the offer response in the same
appliedPromoCodesanddiscount.amountSubunitsfields as manual codes.
Example
Notes
- Any invalid codes (manual or discovered) are ignored, so you don’t need to implement logic to catch errors.
- Input requirements for manual codes:
- Alphanumeric, up to 32 characters per promo code.
- Up to 16 promo codes can be sent with each order.

