POST
/
v1
/
discounts
curl --request POST \
  --url https://vanilla-dev02-loyalty.fabric.zone/api/v1/discounts \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "profileId": "67460e74-02e3-11e8-b443-00163e990bdb",
  "entityReference": "Company_Club",
  "transactionTimestamp": "2020-02-08 09:30:26",
  "taxAmount": 1,
  "grossAmount": 6,
  "netAmount": 5,
  "transactionItems": [
    {
      "grossAmount": 6,
      "taxAmount": 1,
      "netAmount": 5,
      "categories": [
        "Proteins",
        "Adults"
      ],
      "itemName": "Whey",
      "itemPrice": 5,
      "itemQuantity": 1,
      "SKU": "123456"
    }
  ]
}'
{
  "status": 200,
  "message": "Created",
  "errors": {},
  "data": [
    {
      "grossAmount": 6,
      "taxAmount": 1,
      "netAmount": 4,
      "discounts": [
        {
          "type": "tier",
          "description": "20.0% discount from tier rule.",
          "value": 1,
          "id": 23,
          "ruleName": "tier-discount-rule",
          "discountPercentage": 20,
          "discountAmount": 1
        }
      ],
      "transactionItems": [
        {
          "SKU": "123456",
          "discounts": []
        }
      ],
      "miscellaneous": []
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
profileId
string
required

Profile ID of member

entityReference
string
required

External reference of the store where the transaction occurred

Minimum length: 1
transactionTimestamp
string
required

Transaction timestamp (UTC format)

taxAmount
number
required

Tax amount

grossAmount
number
required

Gross amount of the transaction (before discount)

netAmount
number
required

Net amount of the transaction (after discount).

transactionItems
object[]

Response

200
application/json
Ok

Response of the Discounts API

status
integer

Status of the call

message
string
default:
Exception message

Message corresponding to the call

errors
object

Error details, if applicable

data
object[]