Skip to content

Stripe: Retrieve a coupon

Stripe coupons.getCouponsCoupon: arguments, response, policy and SDK examples.

← Coupons operations · Get started

Operation stripe.getcouponscoupon

Provider route: GET /v1/coupons/{coupon}. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/stripe with npm, or alter-sdk-stripe with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { StripeIntegration } from "@alter-ai/stripe";
async function execute(input: Parameters<StripeIntegration["coupons"]["getCouponsCoupon"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new StripeIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.coupons.getCouponsCoupon(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_stripe import StripeIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = StripeIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.coupons.get_coupons_coupon(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.couponstringRequired within parentMaximum length: 5000
queryobjectOptionalAdditional keys: not allowed
query.expandarrayOptional
query.expand[]stringEach itemMaximum length: 5000

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Create a coupon — response body

Referenced models: Create a coupon — response body

Create a coupon — response body
FieldTypePresenceDescription and constraints
$objectRootA coupon contains information about a percent-off or amount-off discount you
might want to apply to a customer. Coupons may be applied to [subscriptions](https://docs.stripe.com/api#subscriptions), [invoices](https://docs.stripe.com/api#invoices),
[checkout sessions](https://docs.stripe.com/api/checkout/sessions), [quotes](https://docs.stripe.com/api#quotes), and more. Coupons do not work with conventional one-off [charges](/api/charges/create) or [payment intents](https://docs.stripe.com/api/payment_intents).
amount_offJSONOptional
amount_off (anyOf 1)JSONAlternative
amount_off (anyOf 1) (anyOf 1)integerAlternativeAmount (in the `currency` specified) that will be taken off the subtotal of any invoices for this customer.
amount_off (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
amount_off (anyOf 2)nullAlternative
applies_toModelOptionalExpand Create a coupon — response body — applies to
createdJSONRequired within parent
created (anyOf 1)integerAlternativeTime at which the object was created. Measured in seconds since the Unix epoch.
Format: unix-time
created (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
currencyJSONOptional
currency (anyOf 1)stringAlternativeIf `amount_off` has been set, the three-letter [ISO code for the currency](https://stripe.com/docs/currencies) of the amount to take off.
Format: currency
currency (anyOf 2)nullAlternative
currency_optionsobjectOptionalCoupons defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).
Additional keys: see wildcard field
currency_options.*ModelAdditional keysExpand Create a coupon — response body — currency options value
durationstringRequired within parentOne of `forever`, `once`, or `repeating`. Describes how long a customer who applies this coupon will get the discount.
Known values: forever, once, repeating
duration_in_monthsJSONOptional
duration_in_months (anyOf 1)JSONAlternative
duration_in_months (anyOf 1) (anyOf 1)integerAlternativeIf `duration` is `repeating`, the number of months the coupon applies. Null if coupon `duration` is `forever` or `once`.
duration_in_months (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
duration_in_months (anyOf 2)nullAlternative
idstringRequired within parentUnique identifier for the object.
Maximum length: 5000
livemodebooleanRequired within parentIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
max_redemptionsJSONOptional
max_redemptions (anyOf 1)JSONAlternative
max_redemptions (anyOf 1) (anyOf 1)integerAlternativeMaximum number of times this coupon can be redeemed, in total, across all customers, before it is no longer valid.
max_redemptions (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
max_redemptions (anyOf 2)nullAlternative
metadataJSONOptional
metadata (anyOf 1)objectAlternativeSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
Additional keys: see wildcard field
metadata (anyOf 1).*stringAdditional keysMaximum length: 500
metadata (anyOf 2)nullAlternative
nameJSONOptional
name (anyOf 1)stringAlternativeName of the coupon displayed to customers on for instance invoices or receipts.
Maximum length: 5000
name (anyOf 2)nullAlternative
objectstringRequired within parentString representing the object's type. Objects of the same type share the same value.
Known values: coupon
percent_offJSONOptional
percent_off (anyOf 1)JSONAlternative
percent_off (anyOf 1) (anyOf 1)numberAlternativePercent that will be taken off the subtotal of any invoices for this customer for the duration of the coupon. For example, a coupon with percent_off of 50 will make a $ (or local equivalent)100 invoice $ (or local equivalent)50 instead.
percent_off (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
percent_off (anyOf 2)nullAlternative
redeem_byJSONOptional
redeem_by (anyOf 1)JSONAlternative
redeem_by (anyOf 1) (anyOf 1)integerAlternativeDate after which the coupon can no longer be redeemed.
Format: unix-time
redeem_by (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
redeem_by (anyOf 2)nullAlternative
times_redeemedJSONRequired within parent
times_redeemed (anyOf 1)integerAlternativeNumber of times this coupon has been applied to a customer.
times_redeemed (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
validbooleanRequired within parentTaking account of the above properties, whether this coupon can still be applied to a customer.

Referenced models: Create a coupon — response body — applies to, Create a coupon — response body — currency options value

Create a coupon — response body — applies to
FieldTypePresenceDescription and constraints
$objectRoot
productsarrayRequired within parentA list of product IDs this coupon applies to
products[]stringEach itemMaximum length: 5000
Create a coupon — response body — currency options value
FieldTypePresenceDescription and constraints
$objectRoot
amount_offJSONRequired within parent
amount_off (anyOf 1)integerAlternativeAmount (in the `currency` specified) that will be taken off the subtotal of any invoices for this customer.
amount_off (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$

SDK function policy ID: stripe.getcouponscoupon. Catalog operation: GetCouponsCoupon. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Pinned headers: {"Stripe-Version": "2026-09-30.endive"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.