- Introduction
- Authentication
- Errors
- Change Logs
- Promotion
- Loyalty
- Wallet
- PIM
- Merchant
- How to
Calculate
Production
Production
POST
https://api.b2b.retter.io/5p1hp1d2t/CALL/LoyaltyAPI/calculate/{B2B_LOYALTY_PROJECT_ID}
Loyalty
Last modified:2024-10-17 13:11:38
Request
Authorization
Add parameter in header
x-api-key
Example:
x-api-key: ********************
Path Params
B2B_LOYALTY_PROJECT_ID
string
required
Header Params
x-api-key
string
optional
Body Params application/json
usePoint
number
optional
pointCurrency
string
optional
storeId
string
optional
storeName
string
optional
cart
object
required
subOrders
array [object {3}]
required
items
array [object {3}]
required
user
object
required
userId
string
required
Example
{
"usePoint": 0,
"pointCurrency": "string",
"storeId": "string",
"storeName": "string",
"cart": {
"subOrders": [
{
"id": "string",
"subOrderId": "string",
"price": 0
}
],
"items": [
{
"id": "string",
"qty": 0,
"totalPrice": 0
}
]
},
"user": {
"userId": "string"
}
}
Request samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.b2b.retter.io/5p1hp1d2t/CALL/LoyaltyAPI/calculate/' \
--header 'Content-Type: application/json' \
--header 'x-api-key;' \
--data-raw ''
Responses
🟢200OK
application/json
Body
cart
object
optional
subOrders
array [object {3}]
optional
items
array [object {6}]
optional
userBalance
integer
optional
totalPriceAfterPointUsed
integer
optional
totalUsablePoints
integer
optional
totalUsablePointAsMoney
integer
optional
totalPriceToPay
integer
optional
calculationTime
integer
optional
Example
{
"cart": {
"subOrders": [
{
"id": "string",
"subOrderId": "string",
"price": 0
}
],
"items": [
{
"id": "string",
"qty": 0,
"totalPrice": 0,
"totalUsablePoints": 0,
"totalUsablePointAsMoney": 0,
"totalPriceAfterPointUsed": 0
}
],
"userBalance": 0,
"totalPriceAfterPointUsed": 0,
"totalUsablePoints": 0,
"totalUsablePointAsMoney": 0,
"totalPriceToPay": 0
},
"calculationTime": 0
}
🟠400Bad Request
🟠403Forbidden
🟠404Record Not Found
Modified at 2024-10-17 13:11:38