Discounts

Create a new discount

Create a new discount with the specified details. Discounts can be either: - Coupon codes: Customers enter a code at checkout to receive the discount - Sale discounts: Automatically applied based on conditions Both fixed amount and percentage-based discounts are supported.

Authorization

Public key Secret key
x-fngs-public-key<token>

In: header

x-fngs-secret-key<token>

In: header

Request Body

application/json

POST /v0/discounts/create Request body

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

POST
/v0/discounts/create
curl -X POST "https://example.com/v0/discounts/create" \  -H "Content-Type: application/json" \  -d '{    "type": "code",    "amount": 1,    "amountType": "fixed",    "validFrom": 0,    "excludedOffers": [      "string"    ],    "includedOffers": [      "string"    ],    "currency": "AFN",    "status": "active",    "timezone": "string"  }'
{  "status": "success",  "data": {    "discount": {      "object": "discount",      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "type": "code",      "name": null,      "amount": "string",      "amountType": "fixed",      "discountCode": null,      "validFrom": null,      "validUntil": null,      "purchaseLimit": null,      "timesUsed": 0,      "status": "active",      "includesAllOffers": false,      "excludedOffers": [        "string"      ],      "currency": "AFN"    }  }}