FCHubFCHub.co

Create coupon

Create a new coupon. Amount values for fixed-type coupons are in cents.

POST
/coupons

Authorization

applicationPassword
AuthorizationBasic <token>

WordPress Application Password authentication. Generate one at wp-admin > Users > Application Passwords. Use as Basic Auth with username:application_password (base64-encoded).

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "https://your-site.com/wp-json/fluent-cart/v2/coupons" \  -H "Content-Type: application/json" \  -d '{    "title": "string",    "code": "string",    "type": "percentage",    "amount": 0,    "status": "active",    "stackable": "yes",    "show_on_checkout": "yes"  }'
{
  "coupon": {
    "id": 0,
    "code": "string",
    "title": "string",
    "type": "percentage",
    "amount": 0,
    "status": "active",
    "stackable": "yes",
    "show_on_checkout": "yes",
    "notes": "string",
    "usage_count": 0,
    "start_date": "2019-08-24T14:15:22Z",
    "end_date": "2019-08-24T14:15:22Z",
    "conditions": {
      "max_uses": 0,
      "min_purchase_amount": 0,
      "max_discount_amount": 0,
      "included_products": [
        0
      ],
      "included_categories": [
        0
      ]
    },
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  }
}