> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Refund

> Retrieve details of a specific refund

<Note>
  This endpoint retrieves detailed information about a specific refund, including its current status, timeline, and associated transactions.
</Note>

## Authentication

This endpoint requires a valid API key with `refunds:read` permissions.

```bash theme={null}
Authorization: Bearer YOUR_API_KEY
```

## Path Parameters

<ParamField path="id" type="string" required>
  The unique identifier of the refund
</ParamField>

### Response

Returns the refund object if found.

<RequestExample>
  ```bash cURL theme={null}
  curl --location 'https://api.stateset.com/v1/refunds/refund_0901f083-aa1c-43c5-af5c-0a9d2fc64e30' \
  --header 'Authorization: Bearer YOUR_API_KEY'
  ```

  ```javascript Node.js theme={null}
  const refund = await stateset.refunds.retrieve(
    'refund_0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
  );
  ```

  ```python Python theme={null}
  refund = stateset.refunds.retrieve(
    'refund_0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
  )
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "id": "refund_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
    "object": "refund",
    "order_id": "order_123456",
    "customer_id": "cust_abc123",
    "type": "partial",
    "status": "completed",
    "reason": "product_damaged",
    "reason_details": "Item arrived with scratches on the surface",
    "items": [
      {
        "line_item_id": "li_abc123",
        "product_id": "prod_123",
        "product_name": "Wireless Headphones",
        "sku": "WH-001",
        "quantity": 1,
        "refund_amount": 4999,
        "restock": false,
        "restock_status": "not_restocking",
        "images": [
          "https://refunds.stateset.com/images/refund_0901f083_damage_1.jpg"
        ]
      }
    ],
    "amounts": {
      "subtotal": 4999,
      "tax": 450,
      "shipping": 0,
      "adjustment": 0,
      "total": 5449,
      "currency": "USD"
    },
    "payment_method": {
      "type": "original_payment",
      "payment_id": "pay_xyz789",
      "last4": "4242",
      "brand": "visa"
    },
    "payment_status": "completed",
    "transaction_id": "txn_refund_456789",
    "processing": {
      "auto_approved": true,
      "approved_at": "2024-01-20T13:30:00Z",
      "approved_by": "system",
      "completed_at": "2024-01-23T13:30:00Z"
    },
    "shipping": {
      "return_required": false,
      "return_label_id": null,
      "return_tracking": null
    },
    "timeline": [
      {
        "status": "created",
        "timestamp": "2024-01-20T13:30:00Z",
        "actor": "customer",
        "note": "Refund requested by customer"
      },
      {
        "status": "approved",
        "timestamp": "2024-01-20T13:30:01Z",
        "actor": "system",
        "note": "Auto-approved per return policy"
      },
      {
        "status": "processing",
        "timestamp": "2024-01-20T13:30:02Z",
        "actor": "system",
        "note": "Payment refund initiated"
      },
      {
        "status": "completed",
        "timestamp": "2024-01-23T13:30:00Z",
        "actor": "system",
        "note": "Refund processed successfully"
      }
    ],
    "created_at": "2024-01-20T13:30:00Z",
    "updated_at": "2024-01-23T13:30:00Z",
    "notes": "Customer contacted support about damage during shipping",
    "metadata": {
      "support_ticket_id": "ticket_789",
      "quality_issue_logged": true
    }
  }
  ```
</ResponseExample>
