You can apply custom surcharges or tips to the order total through our custom discount API.
The setup process and request format are the same (see: set up custom discount, request for discount and response
The only difference is in response to this request.
{
"surcharges": [
{
"id": "paypal",
"value": 1.5,
"type": "PERCENT",
"description": "+1.5% for PayPal payments",
"taxable": true
},
{
"id": "gift_wrap",
"value": 5,
"type": "ABSOLUTE",
"description": "+$5 for gift wrap",
"taxable": false
}
]
}
An array of JSON data of type 'CustomSurcharges' with the following fields:
CustomSurcharges
Name | Type | Description |
---|---|---|
value | number | Discount amount |
type | number | Discount type: ABSOLUTE or PERCENT . Default is ABSOLUTE |
description | string | Surcharge description. Is displayed to customers on the cart page and in order details |
taxable | boolean | Determines if store taxes should be applied to the surcharge. |