Here is the case: Let's say I am a retailer selling apples. One apple - one dollar. I sell two apples today - 2$. The customer comes back tomorrow, returns one of the apples. I do a refund. So I still have earned 1$. Customer comes the day after tomorrow and returns the other apple. I do a refund. 0$ profit.
This is what I have done with an old purchase. But when I make a request to get the order details I receive total for order 100? Why is it 100?
Here is the json:
{
"href": "https://www.clover.com/v3/merchants/NJSN3NEHPQDD0/orders/RTZPKNNX0Y3JP",
"id": "RTZPKNNX0Y3JP",
"currency": "USD",
"employee": {
"id": "BC88DMKKDNJG8"
},
"total": 100,
"taxRemoved": false,
"isVat": false,
"state": "locked",
"manualTransaction": false,
"groupLineItems": true,
"testMode": false,
"payType": "FULL",
"createdTime": 1459241189000,
"clientCreatedTime": 1459241189000,
"modifiedTime": 1466673034000,
"lineItems": {
"elements": [
{
"id": "N10E22KJKFN5W",
"orderRef": {
"id": "RTZPKNNX0Y3JP"
},
"item": {
"id": "74N2V63P4T3MG"
},
"name": "Apple",
"alternateName": "",
"price": 100,
"printed": false,
"createdTime": 1459241189000,
"orderClientCreatedTime": 1459241189000,
"exchanged": false,
"refunded": true,
"isRevenue": true
},
{
"id": "RWJ5NE2K3GE8J",
"orderRef": {
"id": "RTZPKNNX0Y3JP"
},
"item": {
"id": "74N2V63P4T3MG"
},
"name": "Apple",
"alternateName": "",
"price": 100,
"printed": false,
"createdTime": 1459241190000,
"orderClientCreatedTime": 1459241189000,
"exchanged": false,
"refunded": true,
"isRevenue": true
}
]
},
"payments": {
"elements": [
{
"id": "RAXJFM04WAJ6P",
"order": {
"id": "RTZPKNNX0Y3JP"
},
"device": {
"id": "d2ef4c13-31be-44ac-99d4-480a492264fb"
},
"tender": {
"href": "https://www.clover.com/v3/merchants/NJSN3NEHPQDD0/tenders/HZFN8P7QEXAMJ",
"id": "HZFN8P7QEXAMJ"
},
"amount": 200,
"taxAmount": 0,
"cashTendered": 200,
"employee": {
"id": "BC88DMKKDNJG8"
},
"createdTime": 1459241343000,
"clientCreatedTime": 1459241342000,
"modifiedTime": 1459241343000,
"result": "SUCCESS"
}
]
},
"refunds": {
"elements": [
{
"id": "Q6657EPXW8KH0",
"orderRef": {
"id": "RTZPKNNX0Y3JP"
},
"device": {
"id": "d2ef4c13-31be-44ac-99d4-480a492264fb"
},
"amount": 100,
"taxAmount": 0,
"createdTime": 1466583149000,
"clientCreatedTime": 1466583149000,
"payment": {
"id": "RAXJFM04WAJ6P"
},
"employee": {
"id": "BC88DMKKDNJG8"
}
},
{
"id": "JDNCBVKVSTF42",
"orderRef": {
"id": "RTZPKNNX0Y3JP"
},
"device": {
"id": "d2ef4c13-31be-44ac-99d4-480a492264fb"
},
"amount": 100,
"taxAmount": 0,
"createdTime": 1466673034000,
"clientCreatedTime": 1466673034000,
"payment": {
"id": "RAXJFM04WAJ6P"
},
"employee": {
"id": "BC88DMKKDNJG8"
}
}
]
},
"device": {
"id": "d2ef4c13-31be-44ac-99d4-480a492264fb"
}
}