Skip to main content
POST
/
v1
/
promo_codes
/
{id}
Update Promo Code
curl --request POST \
  --url https://api.withflex.com/v1/promo_codes/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "promo_code": {
    "active": false,
    "metadata": {
      "key": "value"
    }
  }
}
'
{
  "promo_code": {
    "promo_code_id": "fpromo_01HACM7FZ1084XB1GB6053VM0E",
    "code": "SUMMER2016",
    "coupon": {
      "coupon_id": "fcoup_1234567890",
      "amount_off": 100,
      "applies_to": null,
      "duration": "once",
      "duration_in_months": null,
      "metadata": {
        "key": "value"
      },
      "name": "Coupon",
      "percent_off": 10,
      "max_redemptions": 100,
      "times_redeemed": 0,
      "valid": true,
      "created_at": "2024-05-17T14:59:21Z",
      "test_mode": true
    },
    "max_redemptions": 100,
    "times_redeemed": 0,
    "created_at": "2024-05-17T14:59:21Z",
    "customer": "fcus_01HACM7FZ1084XB1GB6053VM0D",
    "active": true,
    "metadata": {
      "key": "value"
    },
    "test_mode": false
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.withflex.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Use a Bearer token to access this API.

Path Parameters

id
string
required
Example:

"obj_01EXAMPLE00000000000000000"

Body

application/json
promo_code
object
required
Example:
{
"active": false,
"metadata": { "key": "value" }
}

Response

Success

promo_code
object
required

A promo code represents a code for a coupon that can be redeemed by a customer.

Example:
{
"promo_code_id": "fpromo_01HACM7FZ1084XB1GB6053VM0E",
"code": "SUMMER2016",
"coupon": {
"coupon_id": "fcoup_1234567890",
"amount_off": 100,
"applies_to": null,
"duration": "once",
"duration_in_months": null,
"metadata": { "key": "value" },
"name": "Coupon",
"percent_off": 10,
"max_redemptions": 100,
"times_redeemed": 0,
"valid": true,
"created_at": "2024-05-17T14:59:21Z",
"test_mode": true
},
"max_redemptions": 100,
"times_redeemed": 0,
"created_at": "2024-05-17T14:59:21Z",
"customer": "fcus_01HACM7FZ1084XB1GB6053VM0D",
"active": true,
"metadata": { "key": "value" },
"test_mode": false
}