Charge application
Charge application allows to add a additional value (amount or pencertage) in the order or in the line item. There will be specific examples next in this document.
Loan Deduction
Loan in credit granted to the customer to consume products. The customer pays back their loan by having a percentage of their discount not applied. In MX this loan deduction is called Fomento.
To set the Loan deduction the structure below should be sent in the payload:
{
"vendorAccountIds": [
"1234567",
"4567123",
"789785"
],
"charges": [
{
"vendorChargeId": "CHARGE-01",
"type": "LOAN_DEDUCTION",
"conditions": {
"paymentMethod": "CASH"
},
"output": {
"scope": "LINE_ITEM",
"applyTo": "DISCOUNT_AMOUNT",
"type": "AMOUNT",
"value": 3.45,
"vendorItemIds": [
"SKU001",
"SKU002"
]
}
}
]
}
NOTE: The Loan deduction will only be applied if there is a discount amount.
Overprice
When the order match a specific condition, the customer will pay an additional fee on per vendorItemId basis with the structure below be sent in the payload.
{
"vendorAccountIds": [
"1234567",
"4567123",
"789785"
],
"charges": [
{
"vendorChargeId": "CHARGE-01",
"type": "OVERPRICE",
"conditions": {
"paymentMethod": "CREDIT"
},
"output": {
"scope": "LINE_ITEM",
"applyTo": "BASE_PRICE",
"type": "AMOUNT",
"value": 3.45,
"vendorItemIds": [
"SKU001",
"SKU002"
]
}
}
]
}
When the order match a specific condition, the customer will pay an additional fee on alcoholic products with the structure below be sent in the payload.
{
"vendorAccountIds": [
"1234567",
"4567123",
"789785"
],
"charges": [
{
"vendorChargeId": "CHARGE-01",
"type": "OVERPRICE",
"conditions": {
"paymentMethod": "CREDIT",
"productAttributes": {
"isAlcoholic": false
}
},
"output": {
"scope": "LINE_ITEM",
"applyTo": "BASE_PRICE",
"type": "PERCENT",
"value": 1.25
}
}
]
}
PS: Charge payment method should be the same of the simulation.
Boleto
In Brazil the customer can pay through something called boleto (bank slip), which means they may have 1, 7, or 14 additional days to pay after their order gets
delivered. Associated with that extra time there is an charge percentage in the order total.
To set a Boleto the structure below should be sent in the payload:
{
"accounts": [
"1234567"
],
"charges": [
{
"vendorChargeId": "CHARGE-01",
"type": "PAYMENT_MEHTOD_FEE",
"conditions": {
"orderTotal": {
"maximumValue": 5000.45
},
"paymentMethod": "BANK_SLIP",
"paymentTerms": [1,2,3,4,5,6,7,8,9,10]
},
"output": {
"scope": "ORDER",
"applyTo": "TOTAL",
"type": "PERCENT",
"value": 123.45
}
}
]
}
The overprice can also be scaled:
{
"accounts": [
"1234567",
"4567123",
"789785"
],
"charges": [
{
"vendorChargeId": "CHARGE-01",
"type": "PAYMENT_METHOD_FEE",
"conditions": {
"dependsOnChargeIds": [
"ID01",
"ID02"
],
"orderTotal": {
"maximumValue": 5000.45
},
"paymentMethod": "BANK_SLIP",
"scaledFrom": "ORDER_TOTAL",
"paymentTerms": [1,2,3,4,5,6,7,8,9,10]
},
"output": {
"scope": "ORDER",
"applyTo": "TOTAL",
"type": "PERCENT",
"ranges": [
{
"index": 1,
"from": 200,
"value": 3.45
},
{
"index": 2,
"from": 400,
"value": 1.98
}
]
}
}
]
}
Delivery Date Fee
“Regular” delivery dates are dates in which the user can order freely.
“Non-Regular” delivery dates are dates in which the user must pay a fee unless they hit a unique delivery “ORDER minimum” value.
To set a Delivery Date Fee, the structure below should be sent in the payload:
{
"vendorChargeId": "CHARGE-01",
"type": "DELIVERY_DATE_FEE",
"conditions": {
"alternativeDeliveryDate": true,
"paymentMethod": "CREDIT", // (OPTIONAL) BANK_SLIP, CREDIT, CASH
"orderTotal": {
"maximumValue": 123.45
}
},
"output": {
"scope": "ORDEM",
"applyTo": "TOTAL",
"type": "AMOUNT",
"value": 123.45
}
}
Charge Deletion
The charge deletion is a resource available in the cart calculation relay, it is accessed in the same endpoint as the charge, passing the json informing which accounts and charges are being needed to have the charge deletion done.
For this exclusion the payload should be passing the following data by the example bellow:
Load Limits
Check the limit per request below: