Next Commerce
Orders

Orders Refund Create

Refund an existing order.

POST
/orders/{number}/refund/

Authorization

oauth2 orders:write
AuthorizationBearer <token>

Generate an Access Token through Settings > API Access for single store access or use the Authorization Code flow with your partner App Client ID. Use required permission scopes for API endpoint access. Example Authorization: Bearer 123

In: header

Scope: orders:write

Path Parameters

number*Order number

Header Parameters

X-29next-API-Version*"2023-02-10"
Default"2023-02-10"

Value in

  • "2023-02-10"

Request Body

Response Body

application/json

curl -X POST "https://example.com/orders/string/refund/" \  -H "X-29next-API-Version: 2023-02-10" \  -H "Content-Type: application/json" \  -d '{    "amount": "string"  }'
{  "attribution": {    "affiliate": "string",    "agent": {      "email": "user@example.com",      "first_name": "string",      "id": 0,      "last_name": "string"    },    "funnel": "string",    "gclid": "string",    "metadata": null,    "subaffiliate1": "string",    "subaffiliate2": "string",    "subaffiliate3": "string",    "subaffiliate4": "string",    "subaffiliate5": "string",    "utm_campaign": "string",    "utm_content": "string",    "utm_medium": "string",    "utm_source": "string",    "utm_term": "string"  },  "billing_address": {    "country": "string",    "first_name": "string",    "id": 0,    "last_name": "string",    "line1": "string",    "line2": "string",    "line3": "string",    "line4": "string",    "phone_number": "string",    "postcode": "string",    "state": "string"  },  "created_at": "2019-08-24T14:15:22Z",  "currency": "string",  "date_placed": "2019-08-24T14:15:22Z",  "display_taxes": "string",  "fulfillment_status": "not_required",  "fulfillments": [    {      "carrier": "string",      "date_created": "2019-08-24T14:15:22Z",      "delivered_at": "2019-08-24T14:15:22Z",      "delivery_status": null,      "id": 0,      "last_event_date": "2019-08-24T14:15:22Z",      "lines": "string",      "processing_at": "2019-08-24T14:15:22Z",      "reference": "string",      "requires_shipping": true,      "status": "string",      "tracking_code": "string",      "tracking_link": "string"    }  ],  "is_test": true,  "lines": [    {      "created_at": "2019-08-24T14:15:22Z",      "id": 0,      "is_gift_card": true,      "is_upsell": true,      "metadata": null,      "price_currency": "string",      "price_excl_tax": "string",      "price_excl_tax_excl_discounts": "string",      "price_incl_tax": "string",      "price_incl_tax_excl_discounts": "string",      "product": {        "categories": [          {            "id": 0,            "name": "string",            "slug": "string"          }        ],        "id": 0,        "images": [          {            "attachment": "string",            "caption": "string",            "display_order": 0,            "file_name": "string",            "id": 0,            "src": "http://example.com"          }        ],        "title": "string",        "upc": "string",        "url": "http://example.com"      },      "properties": [        {          "key": "string",          "value": null        }      ],      "quantity": 0,      "stockrecord": {        "id": 0,        "low_stock_threshold": 0,        "num_allocated": -2147483648,        "num_in_stock": -2147483648,        "partner_sku": "string",        "price": "string",        "price_currency": "string",        "price_retail": "string"      },      "tax_lines": [        {          "amount": "string",          "currency": "string",          "rate": 0.1,          "report_values": {            "amount": "string",            "currency": "string"          },          "source": "string",          "tax_id": 0,          "tax_title": "string"        }      ],      "total_cost": "string",      "unit_cost": "string",      "updated_at": "2019-08-24T14:15:22Z"    }  ],  "metadata": null,  "number": "string",  "offer_discounts": [    {      "amount": "string",      "description": "string",      "name": "string"    }  ],  "order_status_url": "http://example.com",  "original_shipping_excl_tax": "string",  "original_shipping_incl_tax": "string",  "original_total_excl_tax": "string",  "original_total_incl_tax": "string",  "payment_status": "pending",  "refunds": [    {      "adjustments": [        {          "amount_excl_tax": "string",          "amount_incl_tax": "string",          "id": 0,          "report_values": {            "amount_excl_tax": "string",            "amount_incl_tax": "string",            "currency": "string"          },          "type": "refund_shipping"        }      ],      "created_at": "2019-08-24T14:15:22Z",      "id": 0,      "note": "string",      "order_number": "string",      "refund_line_items": [        {          "amount_excl_tax": "string",          "amount_incl_tax": "string",          "id": 0,          "line_item_id": 0,          "location_id": 0,          "quantity": 0,          "report_values": {            "amount_excl_tax": "string",            "amount_incl_tax": "string",            "currency": "string"          },          "restock_type": "cancel"        }      ],      "report_values": {        "currency": "string",        "total_refund_amount": "string",        "total_return_excl_tax": "string",        "total_return_incl_tax": "string"      },      "total_refund_amount": "string",      "total_return_excl_tax": "string",      "total_return_incl_tax": "string",      "transactions": [        {          "amount": "string",          "auth_code": "string",          "currency": "string",          "date_created": "2019-08-24T14:15:22Z",          "external_id": "string",          "id": 0,          "is_disputed": true,          "is_external": true,          "is_initial_retry": true,          "is_test": true,          "network_transaction_id": "string",          "parent_id": 0,          "payment_details": {            "bankcard_first_six": "string",            "bankcard_last_four": "string",            "card_token": "string",            "gateway": {              "id": 0,              "is_next_payments": true,              "name": "string",              "type": "string"            },            "is_3ds": true,            "optimized_3ds": true,            "paypal_vault_id": "string",            "sca_flow": "string"          },          "payment_method": "string",          "report_values": {            "amount": "string",            "currency": "string"          },          "response_code": 0,          "statement_descriptor": "string",          "status": "succeeded",          "type": "string"        }      ],      "user_id": 0    }  ],  "report_values": {    "currency": "string",    "original_shipping_excl_tax": "string",    "original_shipping_incl_tax": "string",    "original_total_excl_tax": "string",    "original_total_incl_tax": "string",    "shipping_excl_tax": "string",    "shipping_incl_tax": "string",    "total_cost": "string",    "total_excl_tax": "string",    "total_incl_tax": "string"  },  "shipping_address": {    "country": "string",    "first_name": "string",    "id": 0,    "last_name": "string",    "line1": "string",    "line2": "string",    "line3": "string",    "line4": "string",    "notes": "string",    "phone_number": "string",    "postcode": "string",    "state": "string"  },  "shipping_code": "string",  "shipping_excl_tax": "string",  "shipping_incl_tax": "string",  "shipping_method": "string",  "shipping_tax": "string",  "shipping_tax_lines": [    {      "amount": "string",      "currency": "string",      "rate": 0.1,      "report_values": {        "amount": "string",        "currency": "string"      },      "source": "string",      "tax_id": 0,      "tax_title": "string"    }  ],  "source": "string",  "status": "string",  "subscription_lifecycle": "string",  "subscriptions": [    {      "billing_cycle": 0,      "id": 0    }  ],  "supports_post_purchase_upsells": true,  "tags": [    "string"  ],  "tax_lines": [    {      "amount": "string",      "currency": "string",      "id": 0,      "rate": 0.1,      "report_values": {        "amount": "string",        "currency": "string"      },      "source": "string",      "tax_title": "string"    }  ],  "total_cost": "string",  "total_excl_tax": "string",  "total_incl_tax": "string",  "total_tax": "string",  "transactions": [    {      "amount": "string",      "auth_code": "string",      "currency": "string",      "date_created": "2019-08-24T14:15:22Z",      "external_id": "string",      "id": 0,      "is_disputed": true,      "is_external": true,      "is_initial_retry": true,      "is_test": true,      "network_transaction_id": "string",      "parent_id": 0,      "payment_details": {        "bankcard_first_six": "string",        "bankcard_last_four": "string",        "card_token": "string",        "gateway": {          "id": 0,          "is_next_payments": true,          "name": "string",          "type": "string"        },        "is_3ds": true,        "optimized_3ds": true,        "paypal_vault_id": "string",        "sca_flow": "string"      },      "payment_method": "string",      "report_values": {        "amount": "string",        "currency": "string"      },      "response_code": 0,      "statement_descriptor": "string",      "status": "succeeded",      "type": "string"    }  ],  "updated_at": "2019-08-24T14:15:22Z",  "user": {    "accepts_marketing": true,    "email": "user@example.com",    "first_name": "string",    "id": 0,    "ip": "string",    "language": "string",    "last_name": "string",    "phone_number": "string",    "user_agent": "string"  },  "voucher_discounts": [    {      "amount": "string",      "description": "string",      "name": "string",      "voucher": {        "code": "string",        "end_datetime": "2019-08-24T14:15:22Z",        "name": "string",        "start_datetime": "2019-08-24T14:15:22Z"      }    }  ]}