---
title: "Refund Cart Order"
method: POST
path: "/cart/orders/{order_id}/refund"
tags: ["cart", "Orders"]
---

# Refund Cart Order

`POST /cart/orders/{order_id}/refund`

Refunds an order with the specified line items and amount.

## Path parameters

- `order_id` string, required

## Headers

- `x-trackstar-api-key` string, required
- `x-trackstar-access-token` string, required

## Request body

- union
  - object
    - `reason` string — The reason for the refund.
    - `line_items` RefundOrderLineItem[], required — The line items to refund.
      - `line_item_id` string, required — The ID of the order line item to refund.
      - `quantity` integer — The number of units to refund.
      - `amount` number — The dollar amount to refund for this line item.
  - object
    - `reason` string — The reason for the refund.
    - `provider_id` string — The payment provider to refund through. Required when multiple refund methods are available.
    - `line_items` BigCommerceRefundOrderLineItem[], required — The line items to refund.
      - `line_item_id` string, required — The order_product_id of the line item to refund.
      - `quantity` integer, required — The number of units to refund.
  - object
    - `reason` 'BUYER_CANCEL' | 'SELLER_CANCEL' | 'ITEM_NOT_RECEIVED' | 'BUYER_RETURN', required — The reason for the refund.
    - `line_items` EBayRefundOrderLineItem[], required — The line items to refund.
      - `line_item_id` string, required — The ID of the order line item to refund.
      - `amount` number, required — The dollar amount to refund for this line item.
  - object
    - `reason` string — The reason for the refund.
    - `line_items` RefundOrderLineItem[], required — The line items to refund.
      - `line_item_id` string, required — The ID of the order line item to refund.
      - `quantity` integer — The number of units to refund.
      - `amount` number — The dollar amount to refund for this line item.
  - object
    - `reason` string — The reason for the refund.
    - `line_items` WooCommerceRefundOrderLineItem[], required — The line items to refund.
      - `line_item_id` string, required — The ID of the order line item to refund.
      - `amount` number, required — The dollar amount to refund for this line item.

## Response `200`

Successful response

- CartRefundOrderOrderResponse
  - `data` CartOrderApiItemSchema
    - `id` string, required — The unique ID of the order.
    - `order_number` string, required — The order number assigned by the platform. Defaults to order ID.
    - `created_date` string, date-time, required — The date the order was created.
    - `updated_date` string, date-time, required — The date the order was last updated.
    - `status` 'open' | 'confirmed' | 'processing' | 'partially_fulfilled' | 'fulfilled' | 'exception' | 'cancelled' | 'backordered' | 'other', required — The status of the order. See the [order information](info) for more details.
    - `raw_status` string, nullable, required — The raw status (if available) returned directly from the platform.
    - `requested_shipping_method` string, nullable, required — The type of shipping method requested by the customer.
    - `shipping_method_id` string, nullable, required — The ID of the actual shipping method.
    - `shipping_method_name` string, nullable, required — The name of the actual shipping method.
    - `carrier_id` string, nullable, required — The ID of the carrier used to ship the order.
    - `carrier_name` string, nullable, required — The name of the carrier used to ship the order.
    - `invoice_currency_code` string, required — The currency used for this order. If not provided explicitly, defaults to USD.
    - `total_price` number, nullable, required — The total price a customer paid for the order.
    - `total_tax` number, nullable, required — The total tax on the order.
    - `total_discount` number, nullable, required — The total amount discounted from the order.
    - `total_shipping` number, nullable, required — The total shipping cost for the order incurred by the customer.
    - `ship_to_address` ShipToAddress, required
      - `full_name` string, nullable, required
      - `company` string, nullable, required
      - `address1` string, nullable, required
      - `address2` string, nullable, required
      - `address3` string, nullable, required
      - `city` string, nullable, required
      - `state` string, nullable, required
      - `postal_code` string, nullable, required
      - `country` string, nullable, required
      - `phone_number` string, nullable, required
      - `email_address` string, nullable, required
    - `bill_to_address` BillToAddress, required
      - `full_name` string, nullable, required
      - `address1` string, nullable, required
      - `address2` string, nullable, required
      - `address3` string, nullable, required
      - `city` string, nullable, required
      - `state` string, nullable, required
      - `postal_code` string, nullable, required
      - `country` string, nullable, required
    - `earliest_ship_date` string, date-time, nullable, required — The earliest date the order can be shipped.
    - `latest_ship_date` string, date-time, nullable, required — The latest date the order can be shipped.
    - `line_items` CartOrderLineItem[], required — List of the products included in the order.
      - `line_item_id` string, required — The ID of the line item.
      - `product_id` string, required — The ID of the product. Can be passed into the [Cart Product](/api-reference/cart-api/products/get-item) endpoint for more details.
      - `product_sku` string, nullable, required
      - `parent_product_id` string, nullable, required — The ID of the product's parent.
      - `parent_product_sku` string, nullable, required
      - `quantity` integer, required
      - `unit_price` number, nullable, required — The price of the product in the currency specified by `invoice_currency_code`.
      - `discount` number, nullable, required — The unit amount discounted from the product for this order. This is the amount of discount per unit of the product.
      - `tax` number, nullable, required — The unit amount of tax on the product for this order. This is the amount of tax per unit of the product
      - `warehouse_id` string, nullable, required — The warehouse this line item should ship from. Can be passed into the [Warehouse](/api-reference/cart-api/warehouses/get-item) endpoint for more details.
    - `shipping_groups` CartOrderShippingGroup[], required — Sets of line items that will be fulfilled together from the same locations. Only applies in Shopify, as fulfillmentOrders.
      - `shipping_group_id` string, required — The ID of the shipping_group.
      - `created_date` string, date-time, required — The date the shipping_group was created.
      - `updated_date` string, date-time, required — The date the shipping_group was last updated.
      - `raw_status` string, nullable, required — The raw status (if available) of the shipping group returned directly from the integration.
      - `status` 'open' | 'shipped' | 'delivered' | 'cancelled' | 'exception' | 'on_hold' | 'other', nullable, required — The status of the shipping group.
      - `warehouse_id` string, required — The ID of the warehouse that the shipping group will send from. Subject to change.
      - `line_items` CartOrderShipmentGroupLineItem[], required — List of the products in the shipping group.
        - `line_item_id` string, required — The ID of the line item in the shipping group.
        - `product_id` string, required — The ID of the product.
        - `product_sku` string, nullable, required
        - `parent_product_id` string, nullable, required — The ID of the product's parent.
        - `quantity` integer, required
    - `shipments` CartOrderShipment[], required — List of the shipments sent out to the customer.
      - `shipment_id` string, required — The ID of the shipment.
      - `raw_status` string, nullable, required — The raw status (if available) of the shipment returned directly from the integration.
      - `status` 'open' | 'shipped' | 'delivered' | 'cancelled' | 'exception' | 'on_hold' | 'other', nullable, required — The status of the shipment.
      - `warehouse_id` string, nullable, required — The warehouse the shipment was shipped from. Can be passed into the [Warehouse](/api-reference/cart-api/warehouses/get-item) endpoint for more details.
      - `shipping_method_id` string, nullable, required — The ID of the shipping method used for the shipment.
      - `shipping_method_name` string, nullable, required — The name of the shipping method used for the shipment.
      - `carrier_id` string, nullable, required — The ID of the carrier used to ship the shipment.
      - `carrier_name` string, nullable, required — The name of the carrier used to ship the shipment.
      - `tracking_number` string, nullable, required — The tracking number for the shipment.
      - `tracking_url` string, nullable, required — The URL for the tracking number.
      - `line_items` CartOrderShipmentLineItem[], required — List of the products listed in the shipment.
        - `shipment_line_item_id` string, required — The ID of the line item in the shipment.
        - `product_id` string, required — The ID of the product.
        - `product_sku` string, nullable, required
        - `parent_product_id` string, nullable, required — The ID of the product's parent.
        - `parent_product_sku` string, nullable, required
        - `quantity` integer, required
      - `shipping_groups` string[], required — List of the shipping groups included in the shipment. Only applies in Shopify, as fulfillmentOrders.
      - `ship_from_address` ShipFromAddress, required
        - `address1` string, nullable, required
        - `address2` string, nullable, required
        - `address3` string, nullable, required
        - `city` string, nullable, required
        - `state` string, nullable, required
        - `postal_code` string, nullable, required
        - `country` string, nullable, required
      - `created_date` string, date-time, nullable, required — The date the shipment was created.
      - `updated_date` string, date-time, nullable, required — The date the shipment was last updated.
    - `tags` string[], required — A list of tags associated with the order.
    - `external_system_url` string, nullable, required — URL link to the order in the external system (WMS/Freight etc).
    - `trackstar_tags` unknown[], nullable, required — A list of custom tags associated with the resource. A tag can be either a string or a dictionary with one key-value pair.
      - unknown
    - `additional_fields` object, required — Integration-specific fields
    - `trackstar_created_date` string, date-time, required
    - `trackstar_updated_date` string, date-time, required
  - `id` string, required — The ID of the object that has been created or modified
  - `unused_fields` string[], required — Unused fields

## Other responses

- `404` — Not found
- `422` — Validation error

---

[API](https://skmtc.net/trackstarhq/apis/trackstar-api.md) · [All operations](https://skmtc.net/trackstarhq/apis/trackstar-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/trackstarhq/trackstar-api/versions/4bc5c6e1a8bf/schema)
