Skip to content

Commit

Permalink
Merge branch 'feature/PrivateCancelAll' into 'main'
Browse files Browse the repository at this point in the history
feat(http-trade-v4): Add new endpoint for cancel all user orders

See merge request whitebit_exchange/api-docs!157
  • Loading branch information
whitebit-robot committed Nov 20, 2023
2 parents b7ee057 + ba2ba44 commit 07c84b9
Showing 1 changed file with 114 additions and 0 deletions.
114 changes: 114 additions & 0 deletions pages/private/http-trade-v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- [Create stop-limit order](#create-stop-limit-order)
- [Create stop-market order](#create-stop-market-order)
- [Cancel order](#cancel-order)
- [Cancel all orders](#cancel-all-orders)
- [Query unexecuted(active) orders](#query-unexecutedactive-orders)
- [Query executed order history](#query-executed-order-history)
- [Query executed order deals](#query-executed-order-deals)
Expand Down Expand Up @@ -1757,6 +1758,119 @@ Error codes:

---

### Cancel all orders

```
[POST] /api/v4/order/cancel/all
```

Cancel existing [order](./../glossary.md#orders)

❗ Rate limit 10000 requests/10 sec.

**Response is cached for:**
NONE

**Parameters:**

| Name | Type | Mandatory | Description |
| ----- | --------- | -------------------------------------------------------------- | ---|
| market | String | **No** | Available [market](./../glossary.md#market). Example: BTC_USDT |
| type | Array | **No** | Order types value. Example: "spot", "margin", "futures" |


**Request BODY raw:**

```json
{
"market": "BTC_USDT",
"type": [
"Margin",
"Futures",
"Spot"
]
}
```

**Response:**

Available statuses:

- `Status 200`
- `Status 400 if inner validation failed`
- `Status 422 if validation failed`
- `Status 503 if service temporary unavailable`

```json
[]
```

<details>
<summary><b>Errors:</b></summary>

Error codes:

- `30` - default validation error code
- `31` - market validation failed


```json
{
"code": 31,
"message": "Validation failed",
"errors": {
"market": ["Market is not available."]
}
}
```

```json
{
"code": 30,
"message": "Validation failed",
"errors": {
"type": ["The type must be an array."]
}
}
```

```json
{
"code": 30,
"message": "Validation failed",
"errors": {
"market": [
"Market field should be a string.",
"Market field format is invalid."
]
}
}
```

```json
{
"code": 2,
"message": "Inner validation failed",
"errors": {
"orderId": ["Unexecuted order was not found."]
}
}
```

```json
{
"code": 1,
"message": "Inner validation failed",
"errors": {
"amount": ["Invalid argument."]
}
}
```

</details>

---

### Query unexecuted(active) orders

```
Expand Down

0 comments on commit 07c84b9

Please sign in to comment.