---
title: Create a coupon request.
slug: create-a-coupon-request
docTags: 
createdAt: 2025-09-12T20:51:28.311Z
---

{
  "id": "3iiwR5-OA0mFnTzr3IJcB",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.b.preview.loyaltyservices.io/api/v3/coupon-requests",
    "servers": [
      {
        "url": "https://api.b.preview.loyaltyservices.io/api/v3/coupon-requests"
      }
    ],
    "name": "Create a coupon request.",
    "description": "<p>Creates new coupon(s) that can be assigned to a member with the coupon-use service. This service will create the coupon request and generate the coupons.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "activateCoupons",
          "type": "boolean",
          "description": "When set to true all of the generated coupons will be activated",
          "default": false
        },
        {
          "kind": "optional",
          "name": "useCoupons",
          "type": "boolean",
          "description": "<p>When set to true, all generated coupons are marked as used. This requires activateCoupons to be enabled, the coupon request type to be Award, and a member identifier to be provided.</p>",
          "default": false
        },
        {
          "kind": "optional",
          "name": "async",
          "type": "boolean",
          "description": "<p>Submits the operation for background processing and returns a ‘202 Accepted’ response\nalong with an identifier to track the processing status.\nRequires the \"api:async-task</p><div></div>\" scope.<p></p>",
          "default": false
        }
      ],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "Create coupon request object",
          "customType": "CouponRequest",
          "schema": [
            {
              "name": "offerCode",
              "kind": "required",
              "type": "string",
              "description": "Code for the offer that contains the definition of this coupon. This defines the attributes available and required.",
              "example": "Offer12345",
              "maxLength": 50
            },
            {
              "name": "name",
              "kind": "required",
              "type": "string",
              "description": "Name of the coupon request",
              "maxLength": 300
            },
            {
              "name": "description",
              "kind": "optional",
              "type": "string",
              "description": "Description of the coupon request",
              "maxLength": 500
            },
            {
              "name": "expirationType",
              "kind": "optional",
              "type": "string",
              "description": "<p>Expiration type for the coupon. Supported values are Exact, Never, Rolling. When Exact is set the startDate and expirationDate are required. If Rolling the expirationDayPeriod and expirationTimePeriod are required.</p>",
              "example": "Rolling",
              "default": "Rolling"
            },
            {
              "name": "startDate",
              "kind": "optional",
              "type": "string<date>",
              "description": "Earliest date when coupon can be used. Defaults to today's date if not set.",
              "format": "date"
            },
            {
              "name": "expirationDate",
              "kind": "optional",
              "type": "string<date>",
              "description": "<p>When expirationType=Exact this attribute identifies when the coupon expires.</p>",
              "format": "date"
            },
            {
              "name": "expirationDayPeriod",
              "kind": "optional",
              "type": "integer<int32>",
              "description": "<p>When expirationType=Rolling this attribute identifies when the coupon expires after this many days.</p>",
              "example": 60,
              "format": "int32"
            },
            {
              "name": "expirationTimePeriod",
              "kind": "optional",
              "type": "integer<int32>",
              "description": "<p>When expirationType=Rolling this attribute identifies when the coupon expires after this many hours in addition to the expirationDayPeriod days.</p>",
              "example": 60,
              "format": "int32"
            },
            {
              "name": "useTypeCode",
              "kind": "optional",
              "type": "string",
              "description": "<p>Coupon Use Type Code, one of Multi, Single</p>",
              "example": "Single",
              "default": "Single"
            },
            {
              "name": "couponRequestType",
              "kind": "optional",
              "type": "string",
              "description": "<p>Coupon Request Type: Award/Bulk</p>",
              "example": "Bulk",
              "default": "Bulk"
            },
            {
              "name": "memberIdentifier",
              "kind": "optional",
              "type": "string",
              "description": "<p>Awards new coupon(s) to this member, if activateCoupons is set and coupon request type is Award.</p>"
            },
            {
              "name": "couponCount",
              "kind": "optional",
              "type": "integer<int32>",
              "description": "Number of coupons that should be created. Only set when creating coupons.",
              "example": 1,
              "default": 1,
              "format": "int32"
            },
            {
              "name": "attributes",
              "kind": "optional",
              "type": "array",
              "description": "If the offer was setup with custom attributes these will need to be passed in this array.",
              "modelRef": "#/components/schemas/CouponRequestAttribute",
              "customType": "CouponRequestAttribute[]",
              "schema": [
                {
                  "name": "name",
                  "kind": "required",
                  "type": "string",
                  "description": "Name of the coupon request attribute. Will be unique for the offer.",
                  "example": "site_tier",
                  "maxLength": 300
                },
                {
                  "name": "value",
                  "kind": "required",
                  "type": "string",
                  "description": "<p>Value for this attribute, validation rules are defined during offer setup.</p>",
                  "example": 123,
                  "maxLength": 50
                }
              ]
            }
          ],
          "modelRef": "#/components/schemas/CouponRequest",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "OAuth2",
          "name": "OAuth2",
          "kind": "optional",
          "type": "oauth2",
          "description": "<p>See <a href=\"https://docs.wearephaedon.com/docs/platform-api-authentication\" target=\"_blank\">https://docs.wearephaedon.com/docs/platform-api-authentication</a></p>",
          "oauth2Flows": {
            "clientCredentials": {
              "tokenUrl": "https://phaedon.oktapreview.com/oauth2/auscfbbmieFBGGOzR1d7/v1/token",
              "scopes": {
                "api:custom-data:read": "Grants read access to custom data information",
                "api:custom-data:modify": "Grants modify access to custom data information",
                "api:data-codes:read": "Grants read access to data codes",
                "api:data-codes:modify": "Grants modify access to data codes",
                "api:coupon-compensation:read": "Grants read access to compensations for coupon code",
                "api:coupon-compensation:create": "Grants access to create compensations for coupon code",
                "api:coupon-compensation:modify": "Grants access to edit compensation nights for coupon code",
                "api:coupon-request:modify": "Grants modify access to create coupons",
                "api:member:search": "Grants search access to member information",
                "api:member:verify": "Grants verify access to member information",
                "api:member:merge": "Grants access to merge members",
                "api:member:enroll": "Grants access to enroll members",
                "api:member:modify": "Grants modify access to member information",
                "api:member:read": "Grants read access to member information",
                "api:member:close": "Grants access to close member account",
                "api:member:migrate": "Grants access to migrate member accounts",
                "api:member-address:read": "Grants read access to member address information",
                "api:member-address:modify": "Grants modify access to member address information",
                "api:member-alias:read": "Grants read access to member alias information",
                "api:member-alias:modify": "Grants modify access to member alias information",
                "api:member-badge:read": "Grants read access to member badge information",
                "api:member-badge:modify": "Grants modify access to member badge information",
                "api:member-bonus:add": "Grants access to add a bonus to a member",
                "api:member-bonus:read": "Grants read access to member bonus information",
                "api:member-comments:read": "Grants read access to member comments information",
                "api:member-comments:modify": "Grants modify access to member comments information",
                "api:member-communication:read": "Grants read access to member communication information",
                "api:member-communication:modify": "Grants modify access to member communication information",
                "api:member-coupon:read": "Grants read access to member coupon information",
                "api:member-coupon-use:cancel": "Grants access to cancel member coupon uses",
                "api:member-coupon:transfer": "Grants access to transfer a member coupon",
                "api:member-coupon-use:update": "Grants access to update member coupon uses",
                "api:member-currency:read": "Grants read access to member currency information",
                "api:member-currency:adjust": "Grants access to adjust member currency",
                "api:member-currency:migrate": "Grants access to migrate member currency",
                "api:member-currency-conversion:convert": "Grants access to convert member currency",
                "api:member-email:read": "Grants read access to member email information",
                "api:member-email:modify": "Grants modify access to member email information",
                "api:member-event:read": "Grants read access to member events",
                "api:member-event:modify": "Grants modify access to member events",
                "api:event-rule:read": "Grants read access to event rules",
                "api:event-rule:modify": "Grants access to modify event rule",
                "api:event-rule:admin": "Grants full admin access to event rules",
                "api:member-list:read": "Grants read access to member list information",
                "api:member-list:modify": "Grants modify access to member list information",
                "api:member-partner-link:read": "Grants read access to member partner link information",
                "api:member-partner-link:modify": "Grants modify access to member partner link information",
                "api:member-payment-card:read": "Grants read access to member payment card information",
                "api:member-payment-card:modify": "Grants modify access to member payment card information",
                "api:member-phone:read": "Grants read access to member phone information",
                "api:member-phone:modify": "Grants modify access to member phone information",
                "api:member-preference:read": "Grants read access to member preference information",
                "api:member-preference:modify": "Grants modify access to member preference information",
                "api:member-promotion:read": "Grants read access to member promotion information",
                "api:member-promotion:register": "Grants access to register a member into a promotion",
                "api:member-redemption:create": "Grants redeem access to member redemption information",
                "api:member-redemption:over-redeem": "Grants access to over redeem",
                "api:member-redemption:read": "Grants read access to member redemption information",
                "api:member-redemption:cancel": "Grants access to cancel member redemptions",
                "api:member-redemption:migrate": "Allows migration of member redemption information",
                "api:member-redemption:patch": "Grants patching access to member redemption",
                "api:member-tier:read": "Grants read access to member tier information",
                "api:member-tier:adjust": "Grants access to adjust member tiers",
                "api:member-tier:migrate": "Grants access to migrate member tiers",
                "api:member-transaction:read": "Grants read access to transaction information",
                "api:member-transaction:cancel": "Grants access to cancel transactions",
                "api:member-transaction:clone": "Grants access to clone transactions",
                "api:member-transfer:transfer": "Grants access to do member to member transfers",
                "api:preference:read": "Grants read access to preference information",
                "api:promotion:read": "Grants read access to promotion information",
                "api:tier:read": "Grant read access to tier information",
                "api:promotion:register": "Grants access to register a member into a promotion using token",
                "api:promotion-token:manage": "Grants access to generate promotion token",
                "api:redemption:read": "Grants read access to redemption information",
                "api:redemption:modify": "Grants access to modify redemption information",
                "api:bonus-rule:read": "Grants read access to bonus rule configuration",
                "api:bonus-rule:modify": "Grants access to modify bonus rule configuration",
                "api:bonus-rule:manage": "Grants limited admin access to bonus rule configuration",
                "api:bonus-rule:admin": "Grants full admin access to bonus rules",
                "api:promotion-rule:read": "Grants read access to promotion rule configuration",
                "api:promotion-rule:modify": "Grants access to modify promotion rule configuration",
                "api:promotion-rule:manage": "Grants limited admin access to promotion rule configuration",
                "api:promotion-rule:admin": "Grants full admin access to promotion rules",
                "api:reports:under-investigation": "Grants access to under investigation report",
                "api:transaction:submit": "Grants access to submit transactions",
                "api:transaction:migrate": "Grants access to migrate transactions",
                "api:user:read": "Grants access to read user information",
                "api:user:modify": "Grants access to create user",
                "api:user-task:read": "Grants read access to user tasks",
                "api:user-task:modify": "Grants modify access to user tasks",
                "api:user-role:read": "Grants read access to user roles",
                "api:user-role:modify": "Grants modify access to user roles",
                "api:compensation:read": "Grants read access to hotel summary information",
                "api:compensation:modify": "Grants modify access to hotel summary information",
                "api:member-referral:read": "Grants read access to member referral information",
                "api:member-referral:modify": "Grants modify access to member referral information",
                "api:member-referral-codes:read": "Grants read access to member referral codes",
                "api:member-referral-codes:create": "Grants access to create member referral codes",
                "api:outbound-notification:modify": "Grants access to send outbound notification",
                "api:outbound-notification:read": "Grants access to read outbound notification types",
                "api:background-task:read": "Grants read access to background task information",
                "api:async-task:create": "Grants access to submit operations for background processing",
                "api:async-task:read": "Grants read access to background processing results",
                "api:audit-configuration:read": "Grants read access to audit configuration information",
                "api:audit-configuration:modify": "Grants modify access to audit configuration information",
                "api:badge:read": "Grant read access to badge information",
                "api:broadcast-messages:read": "Grant Read access to broadcast messages",
                "api:expression-config:read": "Grant read access to expression builder configuration",
                "api:managed-entity:read": "Grant read access to managed entity data",
                "api:customer-satisfaction:modify": "Grants modify access to customer satisfaction metrics",
                "api:member-linked-account:modify": "Grant modify access to member linked account",
                "api:member-linked-account:read": "Grants access to read linked member accounts",
                "api:enroll-codes:read": "Grants access to read enroll codes",
                "api:contact-us:modify": "Grants access to submit Contact Us inquiry",
                "api:data-release:read": "Grants read access to data releases",
                "api:points-pool:read": "Grants read access to points pools",
                "api:points-pool:modify": "Grants modify access to points pools",
                "api:segment:read": "Grants read access to segments",
                "api:segment:modify": "Grants modify access to segments",
                "api:communication-type:read": "Grants read access to communication types",
                "api:communication-type:modify": "Grants modify access to communication types",
                "api:member-status-match:read": "Grants read access to status match eligibility and submitted images/applications",
                "api:member-status-match:create": "Grants access to upload status match images and submit applications"
              }
            }
          },
          "requiredScopes": [
            "api:coupon-request:modify"
          ]
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Success",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "",
            "customType": "Coupon[]",
            "schema": [
              {
                "name": "couponId",
                "kind": "optional",
                "type": "integer<int64>",
                "readOnly": true,
                "description": "<p>Coupon Id (null on create requests)</p>",
                "example": 147258369,
                "format": "int64"
              },
              {
                "name": "couponRequestId",
                "kind": "optional",
                "type": "integer<int64>",
                "readOnly": true,
                "description": "Id of the coupon request that generated this coupon",
                "example": 147258370,
                "format": "int64"
              },
              {
                "name": "offer",
                "kind": "optional",
                "type": "object",
                "description": "Offer defines an offer user which coupons can be issued",
                "modelRef": "#/components/schemas/Offer",
                "customType": "Offer",
                "schema": [
                  {
                    "name": "offerId",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "description": "<p>Offer Id (null on create requests)</p>",
                    "example": 147258369,
                    "format": "int64"
                  },
                  {
                    "name": "offerTypeCode",
                    "kind": "required",
                    "type": "string",
                    "description": "Offer Type Code",
                    "example": "Discount"
                  },
                  {
                    "name": "code",
                    "kind": "optional",
                    "type": "string",
                    "description": "External offer code. Provided by client during offer setup.",
                    "example": "ALON2020"
                  },
                  {
                    "name": "name",
                    "kind": "optional",
                    "type": "string",
                    "description": "Offer Name",
                    "example": "Free night"
                  },
                  {
                    "name": "description",
                    "kind": "optional",
                    "type": "string",
                    "description": "Offer Description",
                    "example": "Award double points"
                  },
                  {
                    "name": "featureVersion",
                    "kind": "optional",
                    "type": "integer<int32>",
                    "description": "Coupon implementation version",
                    "example": 2,
                    "format": "int32"
                  },
                  {
                    "name": "statusCode",
                    "kind": "required",
                    "type": "string",
                    "description": "<p>Offer Status Code, one of Enabled, Disabled</p>",
                    "example": "Enabled"
                  },
                  {
                    "name": "startDateTime",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "description": "Offer start DateTime",
                    "format": "date-time"
                  },
                  {
                    "name": "endDateTime",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "description": "Offer end DateTime",
                    "format": "date-time"
                  },
                  {
                    "name": "offerAttributes",
                    "kind": "optional",
                    "type": "array",
                    "description": "<p>If includeOfferAttributes is true, Offer Attributes</p>",
                    "modelRef": "#/components/schemas/OfferAttribute",
                    "customType": "OfferAttribute[]",
                    "schema": [
                      {
                        "name": "offerAttributeId",
                        "kind": "optional",
                        "type": "integer<int64>",
                        "description": "<p>Offer Attribute Id (null on create requests)</p>",
                        "example": 147258369,
                        "format": "int64"
                      },
                      {
                        "name": "attribute",
                        "kind": "required",
                        "type": "object",
                        "description": "",
                        "modelRef": "#/components/schemas/Attribute",
                        "customType": "Attribute",
                        "schema": [
                          {
                            "name": "attributeId",
                            "kind": "optional",
                            "type": "integer<int64>",
                            "readOnly": true,
                            "description": "<p>Attribute Id (null on create requests)</p>",
                            "example": 147258369,
                            "format": "int64"
                          },
                          {
                            "name": "typeCode",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>Attribute Type Code, one of: Validation, Reporting</p>",
                            "example": "Validation"
                          },
                          {
                            "name": "statusCode",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>Attribute Status Code, one of: Enabled, Disabled</p>",
                            "example": "Enabled"
                          },
                          {
                            "name": "name",
                            "kind": "optional",
                            "type": "string",
                            "description": "Attribute Name",
                            "example": "AccountNumber"
                          },
                          {
                            "name": "description",
                            "kind": "optional",
                            "type": "string",
                            "description": "Attribute Description",
                            "example": "Account Number"
                          },
                          {
                            "name": "dataTypeCode",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>Attribute Data Type Code, one of: boolean, choice, date, memberAccount, multiselect, numeric, open</p>",
                            "example": "open"
                          }
                        ]
                      },
                      {
                        "name": "defaultValue",
                        "kind": "optional",
                        "type": "string",
                        "description": "Indicates what shall be used if no other value is supplied",
                        "example": "Standard"
                      },
                      {
                        "name": "requireOnUse",
                        "kind": "optional",
                        "type": "boolean",
                        "description": "Indicates if presence of attribute is required for coupon use operation",
                        "example": true
                      },
                      {
                        "name": "requireOnHold",
                        "kind": "optional",
                        "type": "boolean",
                        "description": "Indicates if presence of attribute is required for coupon hold operation",
                        "example": true
                      },
                      {
                        "name": "includeOnResponse",
                        "kind": "optional",
                        "type": "boolean",
                        "description": "<p>If true: The system will include this Attribute and Value on Coupon Use or Validation response</p>",
                        "example": false
                      },
                      {
                        "name": "attributeTypeCode",
                        "kind": "optional",
                        "type": "string",
                        "description": "<p>Attribute Type Code, one of: Validation, Reporting</p>",
                        "example": "Validation"
                      },
                      {
                        "name": "operatorCode",
                        "kind": "optional",
                        "type": "string",
                        "description": "<p>Attribute operator code. Examples: EQ, NEQ, LT, LTE, GT, GTE</p>",
                        "example": "EQ"
                      },
                      {
                        "name": "operand",
                        "kind": "optional",
                        "type": "string",
                        "description": "Value that operator applies to",
                        "example": "GI"
                      },
                      {
                        "name": "smartGroupId",
                        "kind": "optional",
                        "type": "integer<int64>",
                        "description": "Id of the Smart Group that operator applies to",
                        "example": 147258369,
                        "format": "int64"
                      }
                    ]
                  },
                  {
                    "name": "benefits",
                    "kind": "optional",
                    "type": "object",
                    "description": "<p>Benefit configuration on the offer. Only populated when includeBenefits=true.</p>",
                    "modelRef": "#/components/schemas/CouponBenefits",
                    "customType": "CouponBenefits",
                    "schema": [
                      {
                        "name": "tierCode",
                        "kind": "optional",
                        "type": "string",
                        "description": "Result tier code awarded at time of coupon use",
                        "example": "Gold",
                        "maxLength": 50
                      },
                      {
                        "name": "futureTierCode",
                        "kind": "optional",
                        "type": "string",
                        "description": "Future result tier code awarded at time of coupon use",
                        "example": "Platinum",
                        "maxLength": 50
                      },
                      {
                        "name": "bonusCode",
                        "kind": "optional",
                        "type": "string",
                        "description": "Bonus rule code awarded at time of coupon use",
                        "example": "STAY_BONUS",
                        "maxLength": 50
                      },
                      {
                        "name": "redemption",
                        "kind": "optional",
                        "type": "object",
                        "description": "Redemption benefit awarded at time of coupon use",
                        "modelRef": "#/components/schemas/CouponBenefitsRedemption",
                        "customType": "CouponBenefitsRedemption",
                        "schema": [
                          {
                            "name": "ruleCode",
                            "kind": "optional",
                            "type": "string",
                            "description": "Redemption rule code awarded at time of coupon use",
                            "example": "ITEM1",
                            "maxLength": 50
                          },
                          {
                            "name": "quantity",
                            "kind": "optional",
                            "type": "integer<int32>",
                            "description": "Number of redemption awards to create at time of coupon use",
                            "example": 1,
                            "format": "int32"
                          }
                        ]
                      }
                    ]
                  }
                ]
              },
              {
                "name": "code",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "description": "Unique external ID for coupon instance",
                "example": "ZPVWTAROW2OQ"
              },
              {
                "name": "statusCode",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "description": "<p>Coupon Status Code, one of Activated, Cancelled, Inactive, Terminated</p>",
                "example": "Activated"
              },
              {
                "name": "startDate",
                "kind": "optional",
                "type": "string<date>",
                "description": "Earliest date when coupon can be used",
                "format": "date"
              },
              {
                "name": "endDate",
                "kind": "optional",
                "type": "string<date>",
                "description": "Latest date when coupon can be used",
                "format": "date"
              },
              {
                "name": "useTypeCode",
                "kind": "optional",
                "type": "string",
                "description": "<p>Coupon Use Type Code, one of Multi, Single</p>",
                "example": "Single",
                "default": "Single"
              },
              {
                "name": "useLimit",
                "kind": "optional",
                "type": "integer<int32>",
                "readOnly": true,
                "description": "The number of times a coupon may be used",
                "example": 1,
                "default": 1,
                "format": "int32"
              },
              {
                "name": "currentUse",
                "kind": "optional",
                "type": "integer<int32>",
                "readOnly": true,
                "description": "Current count of uses logged",
                "example": 1,
                "format": "int32"
              },
              {
                "name": "couponUses",
                "kind": "optional",
                "type": "array",
                "description": "<p>If includeUses is true, the uses of the coupon. This is only populated after a coupon has been applied to a member</p>",
                "modelRef": "#/components/schemas/CouponUse",
                "customType": "CouponUse[]",
                "schema": [
                  {
                    "name": "useDateTime",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "description": "Recorded DateTime of use",
                    "format": "date-time"
                  },
                  {
                    "name": "statusCode",
                    "kind": "required",
                    "type": "string",
                    "description": "<p>Coupon Use status code, one of: Released, Returned, Used</p>",
                    "example": "Used"
                  },
                  {
                    "name": "channelCode",
                    "kind": "required",
                    "type": "string",
                    "description": "<p>Coupon Use channel code, one of: CallCenter, System</p>",
                    "example": "System"
                  },
                  {
                    "name": "alias",
                    "kind": "optional",
                    "type": "string",
                    "description": "Alias of a coupon use as unique key for a given coupon. Operationally used to check for duplicate holds."
                  },
                  {
                    "name": "useCount",
                    "kind": "required",
                    "type": "integer<int32>",
                    "description": "Number of times coupon was used",
                    "example": 1,
                    "format": "int32"
                  },
                  {
                    "name": "couponUseAttributes",
                    "kind": "optional",
                    "type": "array",
                    "description": "<p>If includeAttributes is true, Coupon Use Attributes</p>",
                    "modelRef": "#/components/schemas/CouponUseAttribute",
                    "customType": "CouponUseAttribute[]",
                    "schema": [
                      {
                        "name": "couponUseAttributeId",
                        "kind": "optional",
                        "type": "integer<int64>",
                        "description": "<p>Coupon Use Attribute Id (null on create requests)</p>",
                        "example": 147258369,
                        "format": "int64"
                      },
                      {
                        "name": "attribute",
                        "kind": "required",
                        "type": "object",
                        "description": "",
                        "modelRef": "#/components/schemas/Attribute",
                        "customType": "Attribute",
                        "schema": [
                          {
                            "name": "attributeId",
                            "kind": "optional",
                            "type": "integer<int64>",
                            "readOnly": true,
                            "description": "<p>Attribute Id (null on create requests)</p>",
                            "example": 147258369,
                            "format": "int64"
                          },
                          {
                            "name": "typeCode",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>Attribute Type Code, one of: Validation, Reporting</p>",
                            "example": "Validation"
                          },
                          {
                            "name": "statusCode",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>Attribute Status Code, one of: Enabled, Disabled</p>",
                            "example": "Enabled"
                          },
                          {
                            "name": "name",
                            "kind": "optional",
                            "type": "string",
                            "description": "Attribute Name",
                            "example": "AccountNumber"
                          },
                          {
                            "name": "description",
                            "kind": "optional",
                            "type": "string",
                            "description": "Attribute Description",
                            "example": "Account Number"
                          },
                          {
                            "name": "dataTypeCode",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>Attribute Data Type Code, one of: boolean, choice, date, memberAccount, multiselect, numeric, open</p>",
                            "example": "open"
                          }
                        ]
                      },
                      {
                        "name": "value",
                        "kind": "optional",
                        "type": "string",
                        "description": "Value associated with the attribute",
                        "example": "Standard"
                      }
                    ]
                  }
                ]
              },
              {
                "name": "couponAttributes",
                "kind": "optional",
                "type": "array",
                "description": "<p>If includeAttributes is true, Coupon Attributes</p>",
                "modelRef": "#/components/schemas/CouponAttribute",
                "customType": "CouponAttribute[]",
                "schema": [
                  {
                    "name": "couponAttributeId",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "readOnly": true,
                    "description": "<p>Coupon Attribute Id (null on create requests)</p>",
                    "example": 147258369,
                    "format": "int64"
                  },
                  {
                    "name": "attribute",
                    "kind": "required",
                    "type": "object",
                    "description": "",
                    "modelRef": "#/components/schemas/Attribute",
                    "customType": "Attribute",
                    "schema": [
                      {
                        "name": "attributeId",
                        "kind": "optional",
                        "type": "integer<int64>",
                        "readOnly": true,
                        "description": "<p>Attribute Id (null on create requests)</p>",
                        "example": 147258369,
                        "format": "int64"
                      },
                      {
                        "name": "typeCode",
                        "kind": "required",
                        "type": "string",
                        "description": "<p>Attribute Type Code, one of: Validation, Reporting</p>",
                        "example": "Validation"
                      },
                      {
                        "name": "statusCode",
                        "kind": "required",
                        "type": "string",
                        "description": "<p>Attribute Status Code, one of: Enabled, Disabled</p>",
                        "example": "Enabled"
                      },
                      {
                        "name": "name",
                        "kind": "optional",
                        "type": "string",
                        "description": "Attribute Name",
                        "example": "AccountNumber"
                      },
                      {
                        "name": "description",
                        "kind": "optional",
                        "type": "string",
                        "description": "Attribute Description",
                        "example": "Account Number"
                      },
                      {
                        "name": "dataTypeCode",
                        "kind": "required",
                        "type": "string",
                        "description": "<p>Attribute Data Type Code, one of: boolean, choice, date, memberAccount, multiselect, numeric, open</p>",
                        "example": "open"
                      }
                    ]
                  },
                  {
                    "name": "value",
                    "kind": "optional",
                    "type": "string",
                    "description": "Value associated with the attribute",
                    "example": "2021-12-31T12:00:00"
                  },
                  {
                    "name": "requireOnUse",
                    "kind": "optional",
                    "type": "boolean",
                    "readOnly": true,
                    "description": "<p>When using the coupon, a value is required for the attribute</p>",
                    "example": true
                  },
                  {
                    "name": "requireOnHold",
                    "kind": "optional",
                    "type": "boolean",
                    "readOnly": true,
                    "description": "<p>When putting the coupon on hold, a value is required for the attribute</p>",
                    "example": false
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/Coupon",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "202",
        "description": "Accepted",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "AsyncTask",
            "schema": [
              {
                "name": "asyncTaskId",
                "kind": "optional",
                "type": "integer<int64>",
                "readOnly": true,
                "description": "",
                "format": "int64"
              },
              {
                "name": "taskTypeCode",
                "kind": "optional",
                "type": "string",
                "description": "Task source",
                "example": "PlatformAPI"
              },
              {
                "name": "taskCode",
                "kind": "optional",
                "type": "string",
                "description": "Task type",
                "example": "enrollMember"
              },
              {
                "name": "requestDate",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "Date and time the async task was created",
                "format": "date-time"
              },
              {
                "name": "requestData",
                "kind": "optional",
                "type": "object",
                "description": "Inputs for async task",
                "example": "",
                "schema": []
              },
              {
                "name": "statusCode",
                "kind": "optional",
                "type": "string",
                "description": "<p>Execution status of async task, one of: queued, processed, error</p>"
              },
              {
                "name": "responseDate",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "Date and time the async task finished processing",
                "format": "date-time"
              },
              {
                "name": "responseData",
                "kind": "optional",
                "type": "object",
                "description": "Outputs of async task",
                "example": "",
                "schema": []
              },
              {
                "name": "fileName",
                "kind": "optional",
                "type": "string",
                "description": "Name of uploaded file"
              },
              {
                "name": "lineNumber",
                "kind": "optional",
                "type": "integer",
                "description": "Line number in uploaded file"
              },
              {
                "name": "fileData",
                "kind": "optional",
                "type": "string",
                "description": "Data from uploaded file"
              }
            ],
            "modelRef": "#/components/schemas/AsyncTask",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Bad request",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "ErrorResponse",
            "schema": [
              {
                "name": "errors",
                "kind": "optional",
                "type": "array",
                "description": "List of errors",
                "modelRef": "#/components/schemas/ValidationError",
                "customType": "ValidationError[]",
                "schema": [
                  {
                    "name": "code",
                    "kind": "optional",
                    "type": "string",
                    "description": "Error code assigned to this violation"
                  },
                  {
                    "name": "fieldName",
                    "kind": "optional",
                    "type": "string",
                    "description": "<p>Name of field that violated validation constraint (optional)</p>"
                  },
                  {
                    "name": "message",
                    "kind": "optional",
                    "type": "string",
                    "description": "Internal message describing the error"
                  },
                  {
                    "name": "messageParameters",
                    "kind": "optional",
                    "type": "array",
                    "description": "Error message parameters",
                    "example": "",
                    "itemType": "object",
                    "customType": "object[]",
                    "schema": []
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/ErrorResponse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "401",
        "description": "Unauthorized",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "403",
        "description": "Forbidden",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "500",
        "description": "Internal error",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "BXBSirDNYEeqzIHedfgBw",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url 'https://api.b.preview.loyaltyservices.io/api/v3/coupon-requests?activateCoupons=boolean&useCoupons=boolean&async=boolean' \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"offerCode\": \"Offer12345\",\n     \"name\": \"\",\n     \"expirationType\": \"Rolling\",\n     \"useTypeCode\": \"Single\",\n     \"couponRequestType\": \"Bulk\",\n     \"couponCount\": 1,\n     \"attributes\": [\n     {\n     \"name\": \"site_tier\",\n     \"value\": 123\n     }\n     ]\n     }'"
        },
        {
          "id": "TP4gIhJxxcbIB5NTu8rR9",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.b.preview.loyaltyservices.io/api/v3/coupon-requests?activateCoupons=boolean&useCoupons=boolean&async=boolean\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"offerCode\": \"Offer12345\",\n   \"name\": \"\",\n   \"expirationType\": \"Rolling\",\n   \"useTypeCode\": \"Single\",\n   \"couponRequestType\": \"Bulk\",\n   \"couponCount\": 1,\n   \"attributes\": [\n      {\n         \"name\": \"site_tier\",\n         \"value\": 123\n      }\n   ]\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "EExbOv1LT36hPGMPP_32o",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.b.preview.loyaltyservices.io/api/v3/coupon-requests?activateCoupons=boolean&useCoupons=boolean&async=boolean\"\n\npayload = json.dumps({\n   \"offerCode\": \"Offer12345\",\n   \"name\": \"\",\n   \"expirationType\": \"Rolling\",\n   \"useTypeCode\": \"Single\",\n   \"couponRequestType\": \"Bulk\",\n   \"couponCount\": 1,\n   \"attributes\": [\n      {\n         \"name\": \"site_tier\",\n         \"value\": 123\n      }\n   ]\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        },
        {
          "id": "X-dsuch7bVBGpxELuJy-y",
          "language": "java",
          "label": "Java",
          "code": "OkHttpClient client = new OkHttpClient().newBuilder()\n   .build();\nMediaType mediaType = MediaType.parse(\"application/json\");\nRequestBody body = RequestBody.create(mediaType, \"{\\n  \\\"offerCode\\\": \\\"Offer12345\\\",\\n  \\\"name\\\": \\\"\\\",\\n  \\\"expirationType\\\": \\\"Rolling\\\",\\n  \\\"useTypeCode\\\": \\\"Single\\\",\\n  \\\"couponRequestType\\\": \\\"Bulk\\\",\\n  \\\"couponCount\\\": 1,\\n  \\\"attributes\\\": [\\n    {\\n      \\\"name\\\": \\\"site_tier\\\",\\n      \\\"value\\\": 123\\n    }\\n  ]\\n}\");\nRequest request = new Request.Builder()\n   .url(\"https://api.b.preview.loyaltyservices.io/api/v3/coupon-requests?activateCoupons=boolean&useCoupons=boolean&async=boolean\")\n   .method(\"POST\", body)\n   .addHeader(\"accept\", \"application/json\")\n   .addHeader(\"content-type\", \"application/json\")\n   .build();\nResponse response = client.newCall(request).execute();"
        }
      ],
      "selectedLanguageId": "BXBSirDNYEeqzIHedfgBw"
    },
    "results": {
      "languages": [
        {
          "id": "1QGpIWy9ukw8czwIkNUTn",
          "language": "200",
          "code": "// Success\n[\n  {\n    \"couponId\": 147258369,\n    \"couponRequestId\": 147258370,\n    \"offer\": {\n      \"offerId\": 147258369,\n      \"offerTypeCode\": \"Discount\",\n      \"code\": \"ALON2020\",\n      \"name\": \"Free night\",\n      \"description\": \"Award double points\",\n      \"featureVersion\": 2,\n      \"statusCode\": \"Enabled\",\n      \"startDateTime\": \"\",\n      \"endDateTime\": \"\",\n      \"offerAttributes\": [\n        {\n          \"offerAttributeId\": 147258369,\n          \"attribute\": {\n            \"attributeId\": 147258369,\n            \"typeCode\": \"Validation\",\n            \"statusCode\": \"Enabled\",\n            \"name\": \"AccountNumber\",\n            \"description\": \"Account Number\",\n            \"dataTypeCode\": \"open\"\n          },\n          \"defaultValue\": \"Standard\",\n          \"requireOnUse\": true,\n          \"requireOnHold\": true,\n          \"includeOnResponse\": false,\n          \"attributeTypeCode\": \"Validation\",\n          \"operatorCode\": \"EQ\",\n          \"operand\": \"GI\",\n          \"smartGroupId\": 147258369\n        }\n      ],\n      \"benefits\": {\n        \"tierCode\": \"Gold\",\n        \"futureTierCode\": \"Platinum\",\n        \"bonusCode\": \"STAY_BONUS\",\n        \"redemption\": {\n          \"ruleCode\": \"ITEM1\",\n          \"quantity\": 1\n        }\n      }\n    },\n    \"code\": \"ZPVWTAROW2OQ\",\n    \"statusCode\": \"Activated\",\n    \"startDate\": \"\",\n    \"endDate\": \"\",\n    \"useTypeCode\": \"Single\",\n    \"useLimit\": 1,\n    \"currentUse\": 1,\n    \"couponUses\": [\n      {\n        \"useDateTime\": \"\",\n        \"statusCode\": \"Used\",\n        \"channelCode\": \"System\",\n        \"alias\": \"\",\n        \"useCount\": 1,\n        \"couponUseAttributes\": [\n          {\n            \"couponUseAttributeId\": 147258369,\n            \"attribute\": {\n              \"attributeId\": 147258369,\n              \"typeCode\": \"Validation\",\n              \"statusCode\": \"Enabled\",\n              \"name\": \"AccountNumber\",\n              \"description\": \"Account Number\",\n              \"dataTypeCode\": \"open\"\n            },\n            \"value\": \"Standard\"\n          }\n        ]\n      }\n    ],\n    \"couponAttributes\": [\n      {\n        \"couponAttributeId\": 147258369,\n        \"attribute\": {\n          \"attributeId\": 147258369,\n          \"typeCode\": \"Validation\",\n          \"statusCode\": \"Enabled\",\n          \"name\": \"AccountNumber\",\n          \"description\": \"Account Number\",\n          \"dataTypeCode\": \"open\"\n        },\n        \"value\": \"2021-12-31T12:00:00\",\n        \"requireOnUse\": true,\n        \"requireOnHold\": false\n      }\n    ]\n  }\n]"
        },
        {
          "id": "b-UY7GKbpZTDb4QlnmNPY",
          "language": "202",
          "code": "// Accepted\n{\n  \"asyncTaskId\": \"\",\n  \"taskTypeCode\": \"PlatformAPI\",\n  \"taskCode\": \"enrollMember\",\n  \"requestDate\": \"\",\n  \"requestData\": {},\n  \"statusCode\": \"\",\n  \"responseDate\": \"\",\n  \"responseData\": {},\n  \"fileName\": \"\",\n  \"lineNumber\": 0,\n  \"fileData\": \"\"\n}"
        },
        {
          "id": "gk5YcqijZjO9fw-iiuEFb",
          "language": "400",
          "code": "// Bad request\n{\n  \"errors\": [\n    {\n      \"code\": \"\",\n      \"fieldName\": \"\",\n      \"message\": \"\",\n      \"messageParameters\": [\n        {}\n      ]\n    }\n  ]\n}"
        },
        {
          "id": "ajG1WckKwpFCUBNdgbbrs",
          "language": "401",
          "code": "// Unauthorized\n"
        },
        {
          "id": "PD67gMVIdc4w189psAlWl",
          "language": "403",
          "code": "// Forbidden\n"
        },
        {
          "id": "lmpCgN84QyaZsA3kkNozm",
          "language": "500",
          "code": "// Internal error\n"
        }
      ],
      "selectedLanguageId": "1QGpIWy9ukw8czwIkNUTn"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}