PurchaseRefund object and at least one PurchaseOrderItem. Required: PurchaseRefund.supplier_id; each item requires item, unit_price, and quantity. Set PurchaseRefund.subscription_id to the id of the purchase invoice being refunded to link the refund to its source invoice; omit it to create a standalone refund. currency_code, the refund number, store, branch, and totals are assigned automatically when omitted. Send ?send=draft to save as a draft (otherwise the refund is marked received). Requires the Inventory plugin and the Add New Purchase Orders permission.curl --location --globoff 'https://.daftra.com/api2/purchase_refunds.json?send=undefined' \
--header 'Accept: application/json' \
--header 'apikey: ' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"PurchaseRefund": {
"supplier_id": 42,
"subscription_id": 1001,
"currency_code": "USD",
"date": "2024-01-15"
},
"PurchaseOrderItem": [
{
"item": "Widget",
"unit_price": 10,
"quantity": 5,
"product_id": 101
}
]
}'{
"code": 202,
"result": "successful",
"id": 2415
}