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

Example:

"67460e74-02e3-11e8-b443-00163e990bdb"

entityReference
string
required

External reference of the store where the transaction occurred

Minimum length: 1
Example:

"Company_Club"

transactionTimestamp
string
required

Transaction timestamp (UTC format)

Example:

"2020-02-08 09:30:26"

taxAmount
number
required

Tax amount

Example:

1

grossAmount
number
required

Gross amount of the transaction (before discount)

Example:

6

netAmount
number
required

Net amount of the transaction (after discount).

Example:

5

transactionItems
object[]

Item details

Response

200
application/json
Ok

Response of the Discounts API

status
integer

Status of the call

Example:

200

message
string
default:Exception message

Message corresponding to the call

Example:

"Created"

errors
object

Error details, if applicable

Example:
{}
data
object[]