Attributes API


This API example demonstrates how to describe body attributes of a request or response message.

In this case, the description is complementary (and duplicate!) to the provided JSON example in the body section. The Advanced Attributes API example will demonstrate how to avoid duplicates and how to reuse attribute descriptions.

API Blueprint

Coupons
Coupon

A coupon contains information about a percent-off or amount-off discount you might want to apply to a customer.

Retrieve a Coupon

Retrieves the coupon with the given ID.

REQUEST

RESPONSE

Headers
Content-Type application/json
200 application/json
                        {
    "id": "250FF",
    "created": 1415203908,
    "percent_off": 25,
    "redeem_by": null
}

                      
                        {
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "created": {
      "type": "number",
      "description": "Time stamp"
    },
    "percent_off": {
      "type": "number",
      "description": "A positive integer between 1 and 100 that represents the discount\nthe coupon will apply."
    },
    "redeem_by": {
      "type": "number",
      "description": "Date after which the coupon can no longer be redeemed"
    }
  },
  "required": [
    "id"
  ]
}