added

2019-10 Adding Adjustments to Sales

What's new in the API?

A sale can now contains an adjustments field. It allows to modify the price based on different adjustments (like a discount for example).

Sale with service fee example

{
	"id": "sale1",
	"total_price": 21,
	"line_items": [
		{
			"id": "line-item-1",
			"product_id": "product-1",
			"price_total": 20,
			"quantity": 1
		}
	],
	"payments": [
		{
			"payment_type_id": "credit-card",
			"name": "Credit Card",
			"amount": 21
		}
	],
	"adjustments": [
		{
			"type": "NON_CASH_FEE",
			"name": "Non-cash Fee",
			"value": 1
		}
	]
}

line items total prices + adjustment value = total price

20 + 1 = $21

Who's affected by this change?

Everyone is affected by the change as the adjustments field appears in the sales return.

If you are summing up line items from the API to obtain the sale total, this will not be accurate anymore.
You need to sum up adjustments as well. Otherwise, you will observe a mismatch with the sale total.

If I'm affected, what do I need to do?

The adjustments field is added in the sale response when a new sale or a return is done.
It contains an array of all the adjustments applied to the sale. You need to read this new field with its content.
See the adjustment model in the documentation.