For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

Promo Codes

Promo Code objects

Get promo codes

get
/v1/promo-codes

This operation returns a list of active discount promo codes. Deleted promo codes are not included in the response.

Note: This operation needs Authentication and supports the following JSON:API features:

  • Sparse fieldsets - supports all fields of promoCodes and related resources with fields query parameter.

Authorizations
AuthorizationstringRequired

Bearer HTTP authentication. Allowed headers-- Authorization: Bearer <api_key>

Query parameters
page[size]integer · int32 · min: 1 · max: 1000Optional

The number of resources to return in a single response.

page[before]string · min: 1 · max: 36Optional

Unique identifier.

Pattern: ^[a-zA-Z0-9-]+$
page[after]string · min: 1 · max: 36Optional

Unique identifier.

Pattern: ^[a-zA-Z0-9-]+$
Responses
200

Successful response with promo codes data in JSON:API format.

application/vnd.api+json
get/v1/promo-codes
GET /pos/v1/promo-codes HTTP/1.1
Host: api.mews.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "data": [
    {
      "id": "5efa8b3c-b930-4b31-918d-95ab0e212e64",
      "type": "promoCodes",
      "attributes": {
        "discountType": "percent",
        "amount": "10.00",
        "channel": "ecommerce",
        "code": "SUMMER",
        "active": true,
        "description": "10% off on all orders",
        "maxUsages": 100,
        "startsAt": "2023-10-15T00:00:00Z",
        "endsAt": "2023-10-20T00:00:00Z",
        "createdAt": "2023-10-16T14:30:00Z",
        "updatedAt": "2023-10-19T14:30:00Z"
      }
    }
  ],
  "links": {
    "prev": "https://api.mews-demo.com/pos/v1/promo-codes?page%5Bbefore%5D=NA&page%5Bsize%5D=1",
    "next": "https://api.mews-demo.com/pos/v1/promo-codes?page%5Bafter%5D=NA&page%5Bsize%5D=1"
  }
}

Last updated

Was this helpful?