Returns a list of your promotion codes.
Parameters
No parameters.
More parameters
- activeboolean
Filter promotion codes by whether they are active.
- codestring
Only return promotion codes that have this case-insensitive code.
- couponstring
Only return promotion codes for this coupon.
- createdobject
A filter on the list, based on the object
created
field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options.- created.
gtinteger Minimum value to filter by (exclusive)
- created.
gteinteger Minimum value to filter by (inclusive)
- created.
ltinteger Maximum value to filter by (exclusive)
- created.
lteinteger Maximum value to filter by (inclusive)
- customerstring
Only return promotion codes that are restricted to this customer.
- ending_
beforestring A cursor for use in pagination.
ending_
is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting withbefore obj_
, your subsequent call can includebar ending_
in order to fetch the previous page of the list.before=obj_ bar - limitinteger
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
- starting_
afterstring A cursor for use in pagination.
starting_
is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending withafter obj_
, your subsequent call can includefoo starting_
in order to fetch the next page of the list.after=obj_ foo
Returns
A object with a data
property that contains an array of up to limit
promotion codes, starting after promotion code starting_
. Each entry in the array is a separate promotion code object. If no more promotion codes are available, the resulting array will be empty.
{ "object": "list", "url": "/v1/promotion_codes", "has_more": false, "data": [ { "id": "promo_1MiM6KLkdIwHu7ixrIaX4wgn", "object": "promotion_code", "active": true, "code": "A1H1Q1MG", "coupon": { "id": "nVJYDOag", "object": "coupon", "amount_off": null, "created": 1678040164, "currency": null, "duration": "repeating", "duration_in_months": 3, "livemode": false, "max_redemptions": null, "metadata": {}, "name": null, "percent_off": 25.5, "redeem_by": null, "times_redeemed": 0, "valid": true }, "created": 1678040164, "customer": null, "expires_at": null, "livemode": false, "max_redemptions": null, "metadata": {}, "restrictions": { "first_time_transaction": false, "minimum_amount": null, "minimum_amount_currency": null }, "times_redeemed": 0 } ]}