younifyd
Menu

Create Order Refund

This API helps you to create a new order refund.

POST/orders/{orderId}/refunds

Use it in a workflow

  1. Add a step and choose the WooCommerce connector.
  2. Pick the Create Order Refund action (under Orders).
  3. Fill in the fields below, then reference the result from later steps as {{createOrderRefund.response.data}}.

Request

Path parameters

orderIdintegerrequired

ID of order for refund to create

Request body

Enter the body as JSON in the step's Body field.

idinteger

Refund ID. read-only

reasonstring

Refund reason.

totalstring

Refund total.

date_createdstring (date-time)

The date the refund was created, in the site's timezone. read-only

date_created_gmtstring (date-time)

The date the refund was created, as GMT. read-only

amountstring

Refund amount.

api_refundboolean

When true, the payment gateway API is used to generate the refund.

line_itemsarray<object>

List of line items data.

idinteger

Item ID.

namestring

Product name.

product_idinteger

Product ID.

variation_idinteger

Variation ID, if applicable.

quantityinteger

Quantity ordered.

tax_classstring

Tax class of product.

subtotalstring

Line subtotal (before discounts).

subtotal_taxstring

Line subtotal tax (before discounts).

totalstring

Line total (after discounts).

total_taxstring

Line total tax (after discounts).

taxesarray<object>3 fields

Line taxes.

meta_dataarray<object>5 fields

Meta data.

skustring

Product SKU.

pricenumber (float)

Product price.

refunded_byinteger

User ID of user who created the refund. read-only

refunded_paymentboolean

If the refund was created via the API. read-only

meta_dataarray<object>

Meta data.

idinteger

Meta ID.

keystring

Meta key.

valueobject

Meta value.

display_keystring

Meta key for UI display.

display_valueobject

Meta value for UI display.

json
{
  "id": 0,
  "reason": "string",
  "total": "string",
  "date_created": "2025-01-01T00:00:00Z",
  "date_created_gmt": "2025-01-01T00:00:00Z",
  "amount": "string",
  "api_refund": false,
  "line_items": [
    {
      "id": 0,
      "name": "string",
      "product_id": 0,
      "variation_id": 0,
      "quantity": 0,
      "tax_class": "string",
      "subtotal": "string",
      "subtotal_tax": "string",
      "total": "string",
      "total_tax": "string",
      "taxes": [
        {
          "id": 0,
          "total": "string",
          "subtotal": "string"
        }
      ],
      "meta_data": [
        {
          "id": 0,
          "key": "string",
          "value": {},
          "display_key": "string",
          "display_value": {}
        }
      ]
    }
  ],
  "refunded_by": 0,
  "refunded_payment": false,
  "meta_data": [
    {
      "id": 0,
      "key": "string",
      "value": {},
      "display_key": "string",
      "display_value": {}
    }
  ]
}

Response

Returns 201 with an object. Read it in later steps with {{createOrderRefund.response.data.<field>}}.

idinteger

Refund ID. read-only

reasonstring

Refund reason.

totalstring

Refund total.

date_createdstring (date-time)

The date the refund was created, in the site's timezone. read-only

date_created_gmtstring (date-time)

The date the refund was created, as GMT. read-only

amountstring

Refund amount.

api_refundboolean

When true, the payment gateway API is used to generate the refund.

line_itemsarray<object>

List of line items data.

idinteger

Item ID.

namestring

Product name.

product_idinteger

Product ID.

variation_idinteger

Variation ID, if applicable.

quantityinteger

Quantity ordered.

tax_classstring

Tax class of product.

subtotalstring

Line subtotal (before discounts).

subtotal_taxstring

Line subtotal tax (before discounts).

totalstring

Line total (after discounts).

total_taxstring

Line total tax (after discounts).

taxesarray<object>3 fields

Line taxes.

meta_dataarray<object>5 fields

Meta data.

skustring

Product SKU.

pricenumber (float)

Product price.

refunded_byinteger

User ID of user who created the refund. read-only

refunded_paymentboolean

If the refund was created via the API. read-only

meta_dataarray<object>

Meta data.

idinteger

Meta ID.

keystring

Meta key.

valueobject

Meta value.

display_keystring

Meta key for UI display.

display_valueobject

Meta value for UI display.

json
{
  "id": 0,
  "reason": "string",
  "total": "string",
  "date_created": "2025-01-01T00:00:00Z",
  "date_created_gmt": "2025-01-01T00:00:00Z",
  "amount": "string",
  "api_refund": false,
  "line_items": [
    {
      "id": 0,
      "name": "string",
      "product_id": 0,
      "variation_id": 0,
      "quantity": 0,
      "tax_class": "string",
      "subtotal": "string",
      "subtotal_tax": "string",
      "total": "string",
      "total_tax": "string",
      "taxes": [
        {
          "id": 0,
          "total": "string",
          "subtotal": "string"
        }
      ],
      "meta_data": [
        {
          "id": 0,
          "key": "string",
          "value": {},
          "display_key": "string",
          "display_value": {}
        }
      ]
    }
  ],
  "refunded_by": 0,
  "refunded_payment": false,
  "meta_data": [
    {
      "id": 0,
      "key": "string",
      "value": {},
      "display_key": "string",
      "display_value": {}
    }
  ]
}

Need more? See the WooCommerce guide for connection setup and behaviour shared by every action.