> ## 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.

# Exchange Order

> This endpoint exchanges an order.

### Body

<ParamField body="order_id" type="string">
  The ID provided in the data tab may be used to identify the order
</ParamField>

### Response

<ResponseField name="id" type="string">
  The ID provided in the data tab may be used to identify the order
</ResponseField>

<ResponseField name="object" type="string">
  The object type
</ResponseField>

<ResponseField name="success" type="number">
  Indicates whether the call was successful. true if successful, false if not.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request POST 'https://api.stateset.com/v1/orders/:id/exchange' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Token <token>' \
  --data-raw '{
      "id": "e0901f083-aa1c-43c5-af5c-0a9d2fc64e30"
  }'
  ```

  ```graphQL GraphQL theme={null}
        mutation orderExchangeMutation {
          orderExchange(id: "${orderId}") {
            order {
              id,
              status
            }
            userErrors {
              field
              message
            }
          }
        }
      `;
  ```

  ```js Node.js theme={null}
  const orders = await stateset.orders.exchange({
    '0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
  });
  ```

  ```python Python theme={null}
  orders = stateset.orders.exchange({
    '0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
  })
  ```

  ```ruby Ruby theme={null}
  orders = Stateset::Order.exchange({
    '0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
  })
  ```

  ```go Go theme={null}
  orders, err := stateset.Orders.exchange({
    '0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
  })
  ```

  ```java Java theme={null}
  Order orders = stateset.Orders.exchange({
    '0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
  });
  ```

  ```php PHP theme={null}
  $orders = $stateset->orders->exchange({
    '0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
  });
  ```

  ```csharp C# theme={null}
  var orders = await stateset.Orders.Exchange({
    '0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
  });
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "id": "e0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
    "object": "order",
    "exchanged": true
  }
  ```
</ResponseExample>
