#shyam-m_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1410619698890145805
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi, what does 'adding it to customer credit balance from coupon promocode' mean exactly? Are you able to share an example please?
When you create a coupon, you can choose which product it applies to: https://docs.stripe.com/api/coupons/object?api-version=2025-04-30.preview#coupon_object-applies_to
You can limit it that way if you're using the Coupons API
promocode is created with limit 1 and here the example to add
var options = new CustomerBalanceTransactionCreateOptions
{
Amount = -amount, // amount in cents
Currency = currency,
};
var transactionService = new CustomerBalanceTransactionService(_stripeClient);
var transaction = await transactionService.CreateAsync(customerId, options);
yeah, you could limit it to a specific product, https://docs.stripe.com/api/coupons/object?api-version=2025-04-30.preview#coupon_object-applies_to as well
Are you able to try that?
Coupon limit is working fine but how can restrict to US Customers as coupon is created with EUR Currency'
I know you can pass currency options to that coupon: https://docs.stripe.com/api/coupons/create?api-version=2025-04-30.preview#create_coupon-currency_options but since you want to only offer it to non-US customers, I think applying it to a specific product would still work as you pass the currency: https://docs.stripe.com/api/products/create?api-version=2025-04-30.preview#create_product-default_price_data-currency for the price. You can have a different product for 'usd' currency.