Development discussions around Shopify APIs
Hi
I'm going round in circles trying to get the refund api working.
I can get a result from the calculate refund api, but when I try issue a refund, I get the following error
refund=Required parameter missing or invalid
From comparing my json against the example one, it's identical.
These are not live transactions. We're still integrating in the test environment. I don't know if that makes a difference.
This is my json sent to
POST https://flyflot.myshopify.com/admin/orders/3355105991/refunds.json ;
{
"refund": {
"restock": false,
"note": "Refund issued from cancel",
"shipping": {
"full_refund": true
},
"refund_line_items": [{
"line_item_id": 5878395911,
"quantity": 1
}],
"transactions": [{
"parent_id": 3591917895,
"amount": 30.98,
"kind": "refund",
"gateway": "shopify_payments"
}]
}
}
this is the shopify example from https://help.shopify.com/api/reference/refund#create
{
"refund": {
"restock": true,
"note": "wrong size",
"shipping": {
"full_refund": true
},
"refund_line_items": [{
"line_item_id": 518995019,
"quantity": 1
}],
"transactions": [{
"parent_id": 801038806,
"amount": 199.65,
"kind": "refund",
"gateway": "bogus"
}]
}
}
I am having problems with the refund API also, and my json looks just like yours. I keep getting a BadRequest status code from the HTTP response.
@gonor_alex wrote:Has anyone solved this problem? I have the same issue
From the documentation
Apps are required to specify a restock_type and a location_id on the refund_line_item.
User | RANK |
---|---|
56 | |
11 | |
5 | |
5 | |
5 |
Thanks to all Community members that participated in our inaugural 2 week AMA on the new E...
By Jacqui Mar 10, 2023Upskill and stand out with the new Shopify Foundations Certification program
By SarahF_Shopify Mar 6, 2023One of the key components to running a successful online business is having clear and co...
By Ollie Mar 6, 2023