question

galin-kostadinov avatar image
galin-kostadinov asked galin-kostadinov answered

How to determine which item has been refunded

I need to get all sold items in time interval. So in this case I have to get all payments and refunds.

I tested to refund order using

POST https://scl-sandbox.dev.clover.com/v1/orders/{orderId}/returns

and this one refunds the whole order.

So when I GET list of refunds https://sandbox.dev.clover.com/v3/merchants/{ {merchant_Id}}/refunds?expand=lineItems.item or a refund with expanded lineItems then the list is empty. Is this normal and is this list going to be populated some time?

Also when I get returned order with expanded lineItems then "refunded": false and "refund": null. Are this flags going to be populated with the right values and when?

Unfortunately I can't test returning only one item, because receive an error:

curl --request POST \
--url https://scl-sandbox.dev.clover.com/v1/orders/{orderId}/returns \
--header 'Accept: application/json' \
--header 'Authorization: Bearer xxx' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"inventory_id": "xxx",
"quantity": 1,
"type": "shipping"
}
]
}
'

{
"message": "400 Bad Request",
"error": {
"code": "processing_error",
"message": "Cannot return this amount to card."
}
}

So the only way is to be checked the "paymentState" of the Order and if "REFUNDED" to be get the lineItems from the order, not from Refund object?


Thanks!

REST API
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
galin-kostadinov avatar image
galin-kostadinov answered

Any suggestions?

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community