Skip to Content
StoreOSv0.27.1
Core GraphQL APIReferenceMutations

Create Coupon

This mutation is used to create a new coupon. { permissions: ['*', 'create'], collectionName: 'Coupon', } Requires a signed-in staff user. Needs the `Coupon` `create` permission. Send the `x-tenant` header (the gateway sets it from your API key).

MUTATIONcreateCoupon(input: CreateCouponInput!, tenant: String): CommonMutationResponse!

This mutation is used to create a new coupon. { permissions: ['*', 'create'], collectionName: 'Coupon', } Requires a signed-in staff user. Needs the Coupon create permission. Send the x-tenant header (the gateway sets it from your API key).

Arguments

input*
tenant?String

Returns

  1. createCoupon
_id*ID!
Example Request
mutation CreateCoupon($input: CreateCouponInput!) {  createCoupon(input: $input) {    _id  }}
Variables
{  "input": {    "code": "string",    "usesLimit": 10,    "value": 10.5,    "valueType": "PERCENTAGE"  }}
Example Response
{  "data": {    "createCoupon": {      "_id": "1"    }  }}