Skip to main content
GET
/
discount-code
Retrieve Discount Code
curl --request GET \
  --url https://api.nuwebgroup.com/v1/discount-code \
  --header 'Authorization: Bearer <token>'
{
  "data": {
    "type": "discountCodes",
    "id": 1,
    "attributes": {
      "type": "fixed",
      "code": "FIXED10",
      "amount": 1000,
      "applyToNetPrice": false,
      "maxUsesPerOrder": 1,
      "maximumUses": 100,
      "maxUsesPerCustomer": 2,
      "minimumSpend": 1000,
      "maximumDiscount": {
        "GBP": 2500,
        "EUR": 3000
      },
      "validFrom": "2021-11-22T11:59:00.000000Z",
      "validTo": "2021-11-25T11:59:00.000000Z",
      "boxOfficeOnly": false,
      "disabledAt": null,
      "createdAt": "2021-11-22T11:59:00.000000Z",
      "updatedAt": "2021-11-22T11:59:00.000000Z"
    },
    "relationships": {
      "currencies": {
        "data": {
          "type": "currencies",
          "id": 1
        }
      },
      "saleItems": {
        "data": [
          {
            "type": "saleItems",
            "id": 1
          },
          {
            "type": "saleItems",
            "id": 2
          }
        ]
      }
    },
    "links": {
      "self": "http://api.willms.com/v1/discount-codes?id=1"
    }
  },
  "included": [
    {
      "type": "currencies",
      "id": 1,
      "attributes": {
        "name": "Pounds",
        "code": "GBP",
        "symbol": "Ā£"
      }
    }
  ]
}

Authorizations

Authorization
string
header
required

The 'Bearer' token can be obtained from the token management interface or via the login endpoint using your admin user credentials.

Query Parameters

id
integer

The 'id' of the discount code you wish to retrieve.

code
string

The 'code' of the discount code you wish to retrieve.

withTrashed
enum<string>

Controls records returned depending on their deletedAt status. This is a global flag, so will apply to all resources, including relationships such as resources returned under the included attribute.

  • true to include deleted records
  • false to exclude deleted records (or leave blank)

Available options:
true,
false
only
string

A list of attributes that you wish to be returned in the payload. When empty or omitted, all fields will be included by default. Use dot-notation for both top-level resources and child resources, i.e. discountCodes.code. Can be used in conjunction with except providing both parameters don't reference the same resource.

except
string

A list of attributes that you wish to exclude from the payload. When empty or omitted, all fields will be included by default. Use dot-notation for both top-level resources and child resources, i.e. discountCodes.code. Can be used in conjunction with only providing both parameters don't reference the same resource.

Response

Successfully retrieved the discount code.

data
object
included
object[]