List all promotion codes
Returns a list of your promotion codes.
API Endpoint: GET /v1/promotion_codes
from os import getenv
from sideko_stripe import Stripe
client = Stripe(token=getenv("API_TOKEN"))
res = client.promotion_code.list()from os import getenv
from sideko_stripe import AsyncStripe
client = AsyncStripe(token=getenv("API_TOKEN"))
res = await client.promotion_code.list()Retrieve a promotion code
Retrieves the promotion code with the given ID. In order to retrieve a promotion code by the customer-facing code use list with the desired code.
API Endpoint: GET /v1/promotion_codes/{promotion_code}
from os import getenv
from sideko_stripe import Stripe
client = Stripe(token=getenv("API_TOKEN"))
res = client.promotion_code.get(promotion_code="string")from os import getenv
from sideko_stripe import AsyncStripe
client = AsyncStripe(token=getenv("API_TOKEN"))
res = await client.promotion_code.get(promotion_code="string")Create a promotion code
A promotion code points to a coupon. You can optionally restrict the code to a specific customer, redemption limit, and expiration date.
API Endpoint: POST /v1/promotion_codes
from os import getenv
from sideko_stripe import Stripe
client = Stripe(token=getenv("API_TOKEN"))
res = client.promotion_code.create(coupon="string")from os import getenv
from sideko_stripe import AsyncStripe
client = AsyncStripe(token=getenv("API_TOKEN"))
res = await client.promotion_code.create(coupon="string")Update a promotion code
Updates the specified promotion code by setting the values of the parameters passed. Most fields are, by design, not editable.
API Endpoint: POST /v1/promotion_codes/{promotion_code}
from os import getenv
from sideko_stripe import Stripe
client = Stripe(token=getenv("API_TOKEN"))
res = client.promotion_code.update(promotion_code="string")from os import getenv
from sideko_stripe import AsyncStripe
client = AsyncStripe(token=getenv("API_TOKEN"))
res = await client.promotion_code.update(promotion_code="string")