Skip to Content
StoreOSv0.27.1
Core GraphQL APIReferenceQueries

Coupons

Only coupons that the user has access to will be returned. Requires a signed-in staff user. Needs the `Coupon` `read` permission. Send the `x-tenant` header (the gateway sets it from your API key).

QUERYcoupons(where: CommonPaginationDto): CouponsWithPagination!

Only coupons that the user has access to will be returned. Requires a signed-in staff user. Needs the Coupon read permission. Send the x-tenant header (the gateway sets it from your API key).

Arguments

where?

Returns

  1. coupons
meta?
nodes?
Example Request
query Coupons {  coupons {    meta {      currentPage      hasNextPage      totalCount      totalPages    }    nodes {      _id      applicableForMinimumExpense      code      commits {        action        committedAt        note      }      createdAt      grantType      grantedUsers {        _id        accountStatus        createdAt        email        lastLoginAt        mustChangePassword        name        phoneNumber      }      isAutoGenerated      isDemo      maxAllowedValue    }  }}
Example Response
{  "data": {    "coupons": {      "meta": {        "currentPage": 10.5,        "hasNextPage": true,        "totalCount": 10.5,        "totalPages": 10.5      },      "nodes": [        {          "_id": "1",          "applicableForMinimumExpense": 10.5,          "code": "string",          "commits": [            {              "action": "string",              "committedAt": "<DateTime>",              "note": "string"            }          ],          "createdAt": "<DateTime>",          "grantType": "GLOBAL",          "grantedUsers": [            {              "_id": "1",              "accountStatus": "ACTIVE",              "createdAt": "<DateTime>",              "email": "string",              "lastLoginAt": "<DateTime>",              "mustChangePassword": true,              "name": "string",              "phoneNumber": "string"            }          ],          "isAutoGenerated": true,          "isDemo": true,          "maxAllowedValue": 10.5        }      ]    }  }}