Coupon Service

Coupon Service Api

This is the documentation for version v1.0 of the API. Last update on Jul 2, 2021.

Base URL
https://api.emporix.io/coupon

Generatecoupon

Creates a coupon-code with the naming-convention of the tenant

Creates a coupon-code with the naming-convention of the tenant. Creates the coupon with the coupon-service and returns the just created coupon-code.

Headers
  • authorization Required / string

    Bearer token

Body
  • code string

    e.g.: WINTER-SALE, 10OFF (read-only)

  • name string

    Localized name

  • description string

    Localized coupon description

  • discountType Required /

    'PERCENT' for relative values or 'ABSOLUTE' for float values, referring to a specific currency.

    Values are PERCENT and ABSOLUTE.

  • discountPercentage number

    A discount percentage within the range [0.00, 100.00]. Required if type is 'PERCENT'.

    Minimum value is 0, maximum value is 100.

  • discountAbsolute object

    Defines an amount in a specific currency

    • amount number

      The total amount in the specified currency.

      Minimum value is 0. Default value is 0.

    • currency string

      ISO 4217 currency code, e.g.: USD, EUR, CHF

      Default value is USD.

  • allowAnonymous boolean

    Can the coupon be redeemed by anonymous user

  • maxRedemptions number

    Maximum number of redemptions; -1 designates 'unlimited' (seller-only)

    Default value is -1.

  • maxRedemptionsPerCustomer number

    Maximum number of redemptions per customer; -1 designates 'unlimited'. Cannot be specified for coupons which can be redeemed by anonymous users.

    Default value is -1.

  • restrictions object
    • validFor array[string]

      A list of customer identifiers, which can redeem the coupon. Cannot be specified for coupons which can be redeemed by anonymous users.

    • validFrom string(date-time)

      Must be provided in ISO 8601 format (http://www.iso.org/iso/home/standards/iso8601.htm), e.g. '2015-01-31T23:59:59.999Z'

    • validUntil string(date-time)

      Must be provided in ISO 8601 format (http://www.iso.org/iso/home/standards/iso8601.htm), e.g. '2015-01-31T23:59:59.999Z'

    • minOrderValue object

      Defines an amount in a specific currency

      • amount number

        The total amount in the specified currency.

        Minimum value is 0. Default value is 0.

      • currency string

        ISO 4217 currency code, e.g.: USD, EUR, CHF

        Default value is USD.

  • issuedTo string

    The Id of the customer who originally received the coupon (seller-only).

  • redemptionCount number

    The number of times a specific coupon has been redeemed. Read-only, set through server. (seller-only)

  • status Required /

    Current status of the coupon (read-only). 'INACTIVE': the coupon is only valid in the future; 'VALID': can be used; 'EXPIRED': the coupon validity period has expired; 'USED': the maximum number of redemptions for the coupon has been reached.

    Values are INACTIVE, VALID, EXPIRED, and USED.

  • links array[object]

    Hypermedia reference to coupon actions (read-only, customer-only)

    • rel Required / string

      Link relation type

    • title Required / string

      Link title

    • href Required / string

      Target URI of the link

    • type Required / string

      A content type of the referenced resource

  • deleted boolean

    Flag to mark a coupon as deleted (a.k.a. Soft delete). It is a read-only and seller-only attribute

Responses
  • 201 object
    • code string

      e.g.: WINTER-SALE, 10OFF (read-only)

    • name string

      Localized name

    • description string

      Localized coupon description

    • discountType Required /

      'PERCENT' for relative values or 'ABSOLUTE' for float values, referring to a specific currency.

      Values are PERCENT and ABSOLUTE.

    • discountPercentage number

      A discount percentage within the range [0.00, 100.00]. Required if type is 'PERCENT'.

      Minimum value is 0, maximum value is 100.

    • discountAbsolute object

      Defines an amount in a specific currency

      • amount number

        The total amount in the specified currency.

        Minimum value is 0. Default value is 0.

      • currency string

        ISO 4217 currency code, e.g.: USD, EUR, CHF

        Default value is USD.

    • allowAnonymous boolean

      Can the coupon be redeemed by anonymous user

    • maxRedemptions number

      Maximum number of redemptions; -1 designates 'unlimited' (seller-only)

      Default value is -1.

    • maxRedemptionsPerCustomer number

      Maximum number of redemptions per customer; -1 designates 'unlimited'. Cannot be specified for coupons which can be redeemed by anonymous users.

      Default value is -1.

    • restrictions object
      • validFor array[string]

        A list of customer identifiers, which can redeem the coupon. Cannot be specified for coupons which can be redeemed by anonymous users.

      • validFrom string(date-time)

        Must be provided in ISO 8601 format (http://www.iso.org/iso/home/standards/iso8601.htm), e.g. '2015-01-31T23:59:59.999Z'

      • validUntil string(date-time)

        Must be provided in ISO 8601 format (http://www.iso.org/iso/home/standards/iso8601.htm), e.g. '2015-01-31T23:59:59.999Z'

      • minOrderValue object

        Defines an amount in a specific currency

        • amount number

          The total amount in the specified currency.

          Minimum value is 0. Default value is 0.

        • currency string

          ISO 4217 currency code, e.g.: USD, EUR, CHF

          Default value is USD.

    • issuedTo string

      The Id of the customer who originally received the coupon (seller-only).

    • redemptionCount number

      The number of times a specific coupon has been redeemed. Read-only, set through server. (seller-only)

    • status Required /

      Current status of the coupon (read-only). 'INACTIVE': the coupon is only valid in the future; 'VALID': can be used; 'EXPIRED': the coupon validity period has expired; 'USED': the maximum number of redemptions for the coupon has been reached.

      Values are INACTIVE, VALID, EXPIRED, and USED.

    • links array[object]

      Hypermedia reference to coupon actions (read-only, customer-only)

      • rel Required / string

        Link relation type

      • title Required / string

        Link title

      • href Required / string

        Target URI of the link

      • type Required / string

        A content type of the referenced resource

    • deleted boolean

      Flag to mark a coupon as deleted (a.k.a. Soft delete). It is a read-only and seller-only attribute

  • 400 object

    Request syntactically incorrect. Any details will be provided within the response payload.

    • status Required / integer

      original HTTP error code, should be consistent with the response HTTP code

      Minimum value is 100, maximum value is 599.

    • type Required / string

      classification of the error type, lower case with underscore eg validation_failure

    • message string

      descriptive error message for debugging

    • moreInfo string(uri)

      link to documentation to investigate further and finding support

    • details array[object]

      list of problems causing this error

      • field string

        a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific

      • type Required / string

        classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.

      • message string

        descriptive error detail message for debugging

      • moreInfo string(uri)

        link to documentation to investigate further and finding support for error detail

POST /generateCoupon
$ curl \
 -X POST https://api.emporix.io/coupon/generateCoupon \
 -H "Content-Type: application/json" \
 -H "authorization: string" \
 -d '{"allowAnonymous":true,"code":"EEDNKZ","deleted":false,"description":"A referral Coupon","discountAbsolute":{"amount":8,"currency":"EUR"},"discountType":"ABSOLUTE","issuedTo":"C6074177705","maxRedemptions":-1,"maxRedemptionsPerCustomer":-1,"name":"John Doe","redemptionCount":0,"restrictions":{"validFor":[]},"status":"VALID"}'
Request payload example
# Headers
authorization: string

# Payload
{
  "allowAnonymous": true,
  "code": "EEDNKZ",
  "deleted": false,
  "description": "A referral Coupon",
  "discountAbsolute": {
    "amount": 8,
    "currency": "EUR"
  },
  "discountType": "ABSOLUTE",
  "issuedTo": "C6074177705",
  "maxRedemptions": -1,
  "maxRedemptionsPerCustomer": -1,
  "name": "John Doe",
  "redemptionCount": 0,
  "restrictions": {
    "validFor": []
  },
  "status": "VALID"
}
Response example (201)
{
  "allowAnonymous": true,
  "code": "EDTT1",
  "deleted": false,
  "description": "A referral Coupon",
  "discountAbsolute": {
    "amount": 8,
    "currency": "EUR"
  },
  "discountType": "ABSOLUTE",
  "issuedTo": "C6074177705",
  "maxRedemptions": -1,
  "maxRedemptionsPerCustomer": -1,
  "name": "John Doe",
  "redemptionCount": 0,
  "restrictions": {
    "validFor": []
  },
  "status": "VALID"
}
Response example (400)
{
  "status": 400,
  "message": "There are validation problems, see details section for more information",
  "moreInfo": "",
  "type": "validation_violation",
  "details": [
    {
      "field": "tenant",
      "message": "size must be between 2 and 16",
      "type": "invalid_header"
    }
  ]
}

Referralcouponcode

Gets the referral Coupon Code of the Customer

Gets the referral Coupon Code of the Customer. Creates the CouponCode if it does not yet exist and saves it at the customer.

Headers
  • authorization Required / string

    Bearer token

Responses
  • 200 object
    • code string

      e.g.: WINTER-SALE, 10OFF (read-only)

    • name string

      Localized name

    • description string

      Localized coupon description

    • discountType Required /

      'PERCENT' for relative values or 'ABSOLUTE' for float values, referring to a specific currency.

      Values are PERCENT and ABSOLUTE.

    • discountPercentage number

      A discount percentage within the range [0.00, 100.00]. Required if type is 'PERCENT'.

      Minimum value is 0, maximum value is 100.

    • discountAbsolute object

      Defines an amount in a specific currency

      • amount number

        The total amount in the specified currency.

        Minimum value is 0. Default value is 0.

      • currency string

        ISO 4217 currency code, e.g.: USD, EUR, CHF

        Default value is USD.

    • allowAnonymous boolean

      Can the coupon be redeemed by anonymous user

    • maxRedemptions number

      Maximum number of redemptions; -1 designates 'unlimited' (seller-only)

      Default value is -1.

    • maxRedemptionsPerCustomer number

      Maximum number of redemptions per customer; -1 designates 'unlimited'. Cannot be specified for coupons which can be redeemed by anonymous users.

      Default value is -1.

    • restrictions object
      • validFor array[string]

        A list of customer identifiers, which can redeem the coupon. Cannot be specified for coupons which can be redeemed by anonymous users.

      • validFrom string(date-time)

        Must be provided in ISO 8601 format (http://www.iso.org/iso/home/standards/iso8601.htm), e.g. '2015-01-31T23:59:59.999Z'

      • validUntil string(date-time)

        Must be provided in ISO 8601 format (http://www.iso.org/iso/home/standards/iso8601.htm), e.g. '2015-01-31T23:59:59.999Z'

      • minOrderValue object

        Defines an amount in a specific currency

        • amount number

          The total amount in the specified currency.

          Minimum value is 0. Default value is 0.

        • currency string

          ISO 4217 currency code, e.g.: USD, EUR, CHF

          Default value is USD.

    • issuedTo string

      The Id of the customer who originally received the coupon (seller-only).

    • redemptionCount number

      The number of times a specific coupon has been redeemed. Read-only, set through server. (seller-only)

    • status Required /

      Current status of the coupon (read-only). 'INACTIVE': the coupon is only valid in the future; 'VALID': can be used; 'EXPIRED': the coupon validity period has expired; 'USED': the maximum number of redemptions for the coupon has been reached.

      Values are INACTIVE, VALID, EXPIRED, and USED.

    • links array[object]

      Hypermedia reference to coupon actions (read-only, customer-only)

      • rel Required / string

        Link relation type

      • title Required / string

        Link title

      • href Required / string

        Target URI of the link

      • type Required / string

        A content type of the referenced resource

    • deleted boolean

      Flag to mark a coupon as deleted (a.k.a. Soft delete). It is a read-only and seller-only attribute

  • 204

    No content if there is no referral coupon

  • 400 object

    Request syntactically incorrect. Any details will be provided within the response payload.

    • status Required / integer

      original HTTP error code, should be consistent with the response HTTP code

      Minimum value is 100, maximum value is 599.

    • type Required / string

      classification of the error type, lower case with underscore eg validation_failure

    • message string

      descriptive error message for debugging

    • moreInfo string(uri)

      link to documentation to investigate further and finding support

    • details array[object]

      list of problems causing this error

      • field string

        a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific

      • type Required / string

        classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.

      • message string

        descriptive error detail message for debugging

      • moreInfo string(uri)

        link to documentation to investigate further and finding support for error detail

GET /ReferralCouponCode/{customerId}
$ curl \
 -X GET https://api.emporix.io/coupon/ReferralCouponCode/{customerId} \
 -H "authorization: string"
Response example (200)
{
  "allowAnonymous": true,
  "code": "EEDNKZ",
  "deleted": false,
  "description": "A referral Coupon",
  "discountAbsolute": {
    "amount": 8,
    "currency": "EUR"
  },
  "discountType": "ABSOLUTE",
  "issuedTo": "C6074177705",
  "maxRedemptions": -1,
  "maxRedemptionsPerCustomer": -1,
  "name": "John Doe",
  "redemptionCount": 0,
  "restrictions": {
    "validFor": []
  },
  "status": "VALID"
}
Response example (400)
{
  "status": 400,
  "message": "There are validation problems, see details section for more information",
  "moreInfo": "",
  "type": "validation_violation",
  "details": [
    {
      "field": "tenant",
      "message": "size must be between 2 and 16",
      "type": "invalid_header"
    }
  ]
}

Creates the private Coupon Code of the Customer

Creates the private Coupon Code of the Customer.

Headers
  • authorization Required / string

    Bearer token

Responses
  • 201 object
    • code string

      e.g.: WINTER-SALE, 10OFF (read-only)

    • name string

      Localized name

    • description string

      Localized coupon description

    • discountType Required /

      'PERCENT' for relative values or 'ABSOLUTE' for float values, referring to a specific currency.

      Values are PERCENT and ABSOLUTE.

    • discountPercentage number

      A discount percentage within the range [0.00, 100.00]. Required if type is 'PERCENT'.

      Minimum value is 0, maximum value is 100.

    • discountAbsolute object

      Defines an amount in a specific currency

      • amount number

        The total amount in the specified currency.

        Minimum value is 0. Default value is 0.

      • currency string

        ISO 4217 currency code, e.g.: USD, EUR, CHF

        Default value is USD.

    • allowAnonymous boolean

      Can the coupon be redeemed by anonymous user

    • maxRedemptions number

      Maximum number of redemptions; -1 designates 'unlimited' (seller-only)

      Default value is -1.

    • maxRedemptionsPerCustomer number

      Maximum number of redemptions per customer; -1 designates 'unlimited'. Cannot be specified for coupons which can be redeemed by anonymous users.

      Default value is -1.

    • restrictions object
      • validFor array[string]

        A list of customer identifiers, which can redeem the coupon. Cannot be specified for coupons which can be redeemed by anonymous users.

      • validFrom string(date-time)

        Must be provided in ISO 8601 format (http://www.iso.org/iso/home/standards/iso8601.htm), e.g. '2015-01-31T23:59:59.999Z'

      • validUntil string(date-time)

        Must be provided in ISO 8601 format (http://www.iso.org/iso/home/standards/iso8601.htm), e.g. '2015-01-31T23:59:59.999Z'

      • minOrderValue object

        Defines an amount in a specific currency

        • amount number

          The total amount in the specified currency.

          Minimum value is 0. Default value is 0.

        • currency string

          ISO 4217 currency code, e.g.: USD, EUR, CHF

          Default value is USD.

    • issuedTo string

      The Id of the customer who originally received the coupon (seller-only).

    • redemptionCount number

      The number of times a specific coupon has been redeemed. Read-only, set through server. (seller-only)

    • status Required /

      Current status of the coupon (read-only). 'INACTIVE': the coupon is only valid in the future; 'VALID': can be used; 'EXPIRED': the coupon validity period has expired; 'USED': the maximum number of redemptions for the coupon has been reached.

      Values are INACTIVE, VALID, EXPIRED, and USED.

    • links array[object]

      Hypermedia reference to coupon actions (read-only, customer-only)

      • rel Required / string

        Link relation type

      • title Required / string

        Link title

      • href Required / string

        Target URI of the link

      • type Required / string

        A content type of the referenced resource

    • deleted boolean

      Flag to mark a coupon as deleted (a.k.a. Soft delete). It is a read-only and seller-only attribute

  • 400 object

    Request syntactically incorrect. Any details will be provided within the response payload.

    • status Required / integer

      original HTTP error code, should be consistent with the response HTTP code

      Minimum value is 100, maximum value is 599.

    • type Required / string

      classification of the error type, lower case with underscore eg validation_failure

    • message string

      descriptive error message for debugging

    • moreInfo string(uri)

      link to documentation to investigate further and finding support

    • details array[object]

      list of problems causing this error

      • field string

        a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific

      • type Required / string

        classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.

      • message string

        descriptive error detail message for debugging

      • moreInfo string(uri)

        link to documentation to investigate further and finding support for error detail

POST /ReferralCouponCode/{customerId}
$ curl \
 -X POST https://api.emporix.io/coupon/ReferralCouponCode/{customerId} \
 -H "authorization: string"
Response example (201)
{
  "allowAnonymous": true,
  "code": "EEDNKZ",
  "description": "A referral Coupon",
  "discountAbsolute": {
    "amount": 8,
    "currency": "EUR"
  },
  "discountType": "ABSOLUTE",
  "issuedTo": "C6074177705",
  "name": "John Doe",
  "restrictions": {},
  "status": "VALID"
}
Response example (400)
{
  "status": 400,
  "message": "There are validation problems, see details section for more information",
  "moreInfo": "",
  "type": "validation_violation",
  "details": [
    {
      "field": "tenant",
      "message": "size must be between 2 and 16",
      "type": "invalid_header"
    }
  ]
}

Rewardpointscoupon

Creaetes a referral coupon-code with the naming-convention of the tenant

Creaetes a referral coupon-code with the naming-convention of the tenant. Creates the coupon with the coupon-service and returns the just created coupon-code.

Headers
  • authorization Required / string

    Bearer token

Body
  • id string
  • type string
  • name string
  • description string
  • points Required / integer
  • pointsAfterCoupon integer
  • coupon Required / object

    Coupons describe voucher alike commerce capabilities.

    • code string

      e.g.: WINTER-SALE, 10OFF (read-only)

    • name string

      Localized name

    • description string

      Localized coupon description

    • discountType Required /

      'PERCENT' for relative values or 'ABSOLUTE' for float values, referring to a specific currency.

      Values are PERCENT and ABSOLUTE.

    • discountPercentage number

      A discount percentage within the range [0.00, 100.00]. Required if type is 'PERCENT'.

      Minimum value is 0, maximum value is 100.

    • discountAbsolute object

      Defines an amount in a specific currency

      • amount number

        The total amount in the specified currency.

        Minimum value is 0. Default value is 0.

      • currency string

        ISO 4217 currency code, e.g.: USD, EUR, CHF

        Default value is USD.

    • allowAnonymous boolean

      Can the coupon be redeemed by anonymous user

    • maxRedemptions number

      Maximum number of redemptions; -1 designates 'unlimited' (seller-only)

      Default value is -1.

    • maxRedemptionsPerCustomer number

      Maximum number of redemptions per customer; -1 designates 'unlimited'. Cannot be specified for coupons which can be redeemed by anonymous users.

      Default value is -1.

    • restrictions object
      • validFor array[string]

        A list of customer identifiers, which can redeem the coupon. Cannot be specified for coupons which can be redeemed by anonymous users.

      • validFrom string(date-time)

        Must be provided in ISO 8601 format (http://www.iso.org/iso/home/standards/iso8601.htm), e.g. '2015-01-31T23:59:59.999Z'

      • validUntil string(date-time)

        Must be provided in ISO 8601 format (http://www.iso.org/iso/home/standards/iso8601.htm), e.g. '2015-01-31T23:59:59.999Z'

      • minOrderValue object

        Defines an amount in a specific currency

        • amount number

          The total amount in the specified currency.

          Minimum value is 0. Default value is 0.

        • currency string

          ISO 4217 currency code, e.g.: USD, EUR, CHF

          Default value is USD.

    • issuedTo string

      The Id of the customer who originally received the coupon (seller-only).

    • redemptionCount number

      The number of times a specific coupon has been redeemed. Read-only, set through server. (seller-only)

    • status Required /

      Current status of the coupon (read-only). 'INACTIVE': the coupon is only valid in the future; 'VALID': can be used; 'EXPIRED': the coupon validity period has expired; 'USED': the maximum number of redemptions for the coupon has been reached.

      Values are INACTIVE, VALID, EXPIRED, and USED.

    • links array[object]

      Hypermedia reference to coupon actions (read-only, customer-only)

      • rel Required / string

        Link relation type

      • title Required / string

        Link title

      • href Required / string

        Target URI of the link

      • type Required / string

        A content type of the referenced resource

    • deleted boolean

      Flag to mark a coupon as deleted (a.k.a. Soft delete). It is a read-only and seller-only attribute

  • validInYears integer
Responses
  • 201 object
    • code string

      e.g.: WINTER-SALE, 10OFF (read-only)

    • name string

      Localized name

    • description string

      Localized coupon description

    • discountType Required /

      'PERCENT' for relative values or 'ABSOLUTE' for float values, referring to a specific currency.

      Values are PERCENT and ABSOLUTE.

    • discountPercentage number

      A discount percentage within the range [0.00, 100.00]. Required if type is 'PERCENT'.

      Minimum value is 0, maximum value is 100.

    • discountAbsolute object

      Defines an amount in a specific currency

      • amount number

        The total amount in the specified currency.

        Minimum value is 0. Default value is 0.

      • currency string

        ISO 4217 currency code, e.g.: USD, EUR, CHF

        Default value is USD.

    • allowAnonymous boolean

      Can the coupon be redeemed by anonymous user

    • maxRedemptions number

      Maximum number of redemptions; -1 designates 'unlimited' (seller-only)

      Default value is -1.

    • maxRedemptionsPerCustomer number

      Maximum number of redemptions per customer; -1 designates 'unlimited'. Cannot be specified for coupons which can be redeemed by anonymous users.

      Default value is -1.

    • restrictions object
      • validFor array[string]

        A list of customer identifiers, which can redeem the coupon. Cannot be specified for coupons which can be redeemed by anonymous users.

      • validFrom string(date-time)

        Must be provided in ISO 8601 format (http://www.iso.org/iso/home/standards/iso8601.htm), e.g. '2015-01-31T23:59:59.999Z'

      • validUntil string(date-time)

        Must be provided in ISO 8601 format (http://www.iso.org/iso/home/standards/iso8601.htm), e.g. '2015-01-31T23:59:59.999Z'

      • minOrderValue object

        Defines an amount in a specific currency

        • amount number

          The total amount in the specified currency.

          Minimum value is 0. Default value is 0.

        • currency string

          ISO 4217 currency code, e.g.: USD, EUR, CHF

          Default value is USD.

    • issuedTo string

      The Id of the customer who originally received the coupon (seller-only).

    • redemptionCount number

      The number of times a specific coupon has been redeemed. Read-only, set through server. (seller-only)

    • status Required /

      Current status of the coupon (read-only). 'INACTIVE': the coupon is only valid in the future; 'VALID': can be used; 'EXPIRED': the coupon validity period has expired; 'USED': the maximum number of redemptions for the coupon has been reached.

      Values are INACTIVE, VALID, EXPIRED, and USED.

    • links array[object]

      Hypermedia reference to coupon actions (read-only, customer-only)

      • rel Required / string

        Link relation type

      • title Required / string

        Link title

      • href Required / string

        Target URI of the link

      • type Required / string

        A content type of the referenced resource

    • deleted boolean

      Flag to mark a coupon as deleted (a.k.a. Soft delete). It is a read-only and seller-only attribute

  • 400 object

    Request syntactically incorrect. Any details will be provided within the response payload.

    • status Required / integer

      original HTTP error code, should be consistent with the response HTTP code

      Minimum value is 100, maximum value is 599.

    • type Required / string

      classification of the error type, lower case with underscore eg validation_failure

    • message string

      descriptive error message for debugging

    • moreInfo string(uri)

      link to documentation to investigate further and finding support

    • details array[object]

      list of problems causing this error

      • field string

        a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific

      • type Required / string

        classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.

      • message string

        descriptive error detail message for debugging

      • moreInfo string(uri)

        link to documentation to investigate further and finding support for error detail

POST /RewardpointsCoupon/generateCoupon
$ curl \
 -X POST https://api.emporix.io/coupon/RewardpointsCoupon/generateCoupon \
 -H "Content-Type: application/json" \
 -H "authorization: string" \
 -d '{"id":"F6074134505","type":"string","name":"string","description":"string","points":10,"pointsAfterCoupon":5,"coupon":{"allowAnonymous":true,"code":"EEDNKZ","deleted":false,"description":"A referral Coupon","discountAbsolute":{"amount":8,"currency":"EUR"},"discountType":"ABSOLUTE","issuedTo":"C6074177705","maxRedemptions":-1,"maxRedemptionsPerCustomer":-1,"name":"Empfehlungsgutschein julio gomez","redemptionCount":0,"restrictions":{"validFor":[]},"status":"VALID"}}'
Request payload example
# Headers
authorization: string

# Payload
{
  "id": "F6074134505",
  "type": "string",
  "name": "string",
  "description": "string",
  "points": 10,
  "pointsAfterCoupon": 5,
  "coupon": {
    "allowAnonymous": true,
    "code": "EEDNKZ",
    "deleted": false,
    "description": "A referral Coupon",
    "discountAbsolute": {
      "amount": 8,
      "currency": "EUR"
    },
    "discountType": "ABSOLUTE",
    "issuedTo": "C6074177705",
    "maxRedemptions": -1,
    "maxRedemptionsPerCustomer": -1,
    "name": "Empfehlungsgutschein julio gomez",
    "redemptionCount": 0,
    "restrictions": {
      "validFor": []
    },
    "status": "VALID"
  }
}
Response example (201)
{
  "allowAnonymous": true,
  "code": "TEDW50",
  "deleted": false,
  "description": "A referral Coupon",
  "discountAbsolute": {
    "amount": 8,
    "currency": "EUR"
  },
  "discountType": "ABSOLUTE",
  "issuedTo": "C6074177705",
  "maxRedemptions": -1,
  "maxRedemptionsPerCustomer": -1,
  "name": "John Doe",
  "redemptionCount": 0,
  "restrictions": {
    "validFor": []
  },
  "status": "VALID"
}
Response example (400)
{
  "status": 400,
  "message": "There are validation problems, see details section for more information",
  "moreInfo": "",
  "type": "validation_violation",
  "details": [
    {
      "field": "tenant",
      "message": "size must be between 2 and 16",
      "type": "invalid_header"
    }
  ]
}