Skip to content

Refund an order

Request

Onward is requesting a refund of products for the specified Order in your platform. The onward_refundable object identifies the record that triggered the refund (for example, a Claim).

Security
api_key
Path
shopOrderIdstringrequired

Your ID for the Order

Example:18282
Headers
Content-Typestringrequired

Content-Type must be application/json

Example:application/json
Acceptstringrequired

Accept must be application/json

Example:application/json
Bodyapplication/json
shop_order_idstringrequired

Your ID for the Order this refund relates to

Example:"18282"
onward_refundableobjectrequired

Record that triggered this refund

line_itemsArray of objectsrequired
curl -i -X POST \
  https://api.your-store.com/onward/orders/18282/refund \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: YOUR_API_KEY_HERE' \
  -d '{
    "shop_order_id": "18282",
    "onward_refundable": {
      "id": "456001",
      "type": "Claim"
    },
    "line_items": [
      {
        "to_issue_amount": {
          "currency": "USD",
          "cents": 1099
        },
        "to_issue_amount_presentment": {
          "currency": "CAD",
          "cents": 1525
        },
        "shop_line_item_id": "91827",
        "quantity_to_issue": 1
      }
    ]
  }'

Responses

Order refunded successfully

Bodyapplication/json
shop_refund_idstringrequired

Your ID for the refund

Example:"123456"
Response
{ "shop_refund_id": "123456" }