Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

shopify api refund and cancel

shopify api refund and cancel

a120715
Visitor
1 0 0

i want to cancel and refund order using python when Im refunding iget this response 
POST https://xxxxxxxtest.myshopify.com/xxxx/api/2022-07/orders/xxxxxx/cancel.json
POST https://xxxxxxxtest...

rder is canceling succesful but Payment Status is paid and no refunded: its my code 

order = shopify.Order.find(order_id)
order.cancel()
order.save()
refund = shopify.Refund({
"note": "Refund for cancelled order",
"order_id": order.id,
"amount": order.total_price,
"shipping": {
"full_refund": True
},
"refund_line_items": [
{
"line_item_id": order.line_items[0].id,
"quantity": order.line_items[0].quantity,
"location_id": None,
"restock_type": "no_restock"
}
]
})
refund.save() 

Replies 0 (0)