Coupons

Creates a coupon. Exactly one of amount_off or percent_off must be provided; supplying both, or neither, is rejected. When duration is repeating, duration_in_months is required.

post/v1/coupons

Request

  • Base URL
    https://api.withflex.com
  • URL
    https://api.withflex.com/v1/coupons
  • Auth
    HTTP bearer

Request body

Example request

{
  "coupon": {
    "applies_to": {
      "products": [
        "fprod_01J9XR8M3K7VZ8N2YB4WJ6T0RA"
      ]
    },
    "name": "Coupon",
    "amount_off": 100,
    "duration": "once",
    "percent_off": 10,
    "max_redemptions": 100,
    "metadata": {
      "key": "value"
    }
  }
}

Response

An envelope wrapping a single coupon object.

Example response

{
  "coupon": {
    "coupon_id": "fcoup_1234567890",
    "amount_off": 2500,
    "applies_to": {
      "products": [
        "fprod_01J9XR8M3K7VZ8N2YB4WJ6T0RA"
      ]
    },
    "duration": "once",
    "duration_in_months": 0,
    "metadata": {
      "order_id": "8842",
      "channel": "shopify"
    },
    "name": "Example",
    "percent_off": 0,
    "max_redemptions": 0,
    "times_redeemed": 0,
    "valid": false,
    "created_at": "2026-06-15T14:30:00Z",
    "test_mode": false
  }
}

Changes

    • warning

      the / request property's max was set to 2147483647.00

    • warning

      the / request property's max was set to 2147483647.00

    • warning

      the / request property's max was set to 2147483647.00

    • warning

      the / request property's min was set to -2147483648.00

    • warning

      the / request property's min was set to -2147483648.00

    • warning

      the / request property's min was set to -2147483648.00