Discounts

Update a discount

Update an existing discount's details. You can modify the name, amount, expiration, and other properties. Note: Changing the discount code may affect customers who have saved the old code.

Authorization

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

In: header

x-fngs-secret-key<token>

In: header

Path Parameters

discountId*string

PATCH /v0/discounts/:discountId/update Parameter

Formatuuid

Request Body

application/json

PATCH /v0/discounts/:discountId/update Request body

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

PATCH
/v0/discounts/{discountId}/update
curl -X PATCH "https://example.com/v0/discounts/497f6eca-6276-4993-bfeb-53cbbbba6f08/update" \  -H "Content-Type: application/json" \  -d '{    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"  }'
{  "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"    }  }}