# Resume a standing order

`POST /businesses/{bid}/standing-orders/{id}/resume`

Requires the `documents` scope.

Continues a `paused` or `failed` order, or one that is `stuck`. Charging starts from the NEXT `dayOfMonth`: a charge that was missed, refused or lost is never taken by this (ask for it with a payment link).

## Path parameters

| Name | Type | | Description |
|---|---|---|---|
| `bid` | string | **required** | Business id, from `POST /businesses`. |
| `id` | string | **required** | Standing order id. |

## Response

`200`: `{ "ok": true, … }`

| Field | Type | | Description |
|---|---|---|---|
| `ok` | boolean | **required** |  |
| `standingOrder` | StandingOrder | **required** | A standing order on a card (הוראת קבע בכרטיס אשראי): the customer is charged `amount` every month on `dayOfMonth`, on the business's own terminal. Opening one charges nothing: the customer opens `url`, types his own card and agrees to the terms himself, and the consent is recorded as he gave it. Every charge is a payment request (`GET .../standing-orders/{id}/charges`) that issues its receipt like a paid link. The card is kept as the card company's token, sealed, and is shown by its last four digits only. |

Errors: `401`, `403`, `404`, `409`, `422`, `429`. Every failure answers `{ "error", "reason", "hint", "param", "doc_url", "retryable", "request_id" }`: branch on `reason`, and read `hint` for what to change (https://docs.billos.co.il/errors.md).

## Examples

### cURL

```bash
curl -X POST "$BASE/businesses/$BID/standing-orders/$DOC_ID/resume" \
  -H "X-Api-Key: $KEY"
```
### Node

```node
const res = await fetch(`${BASE}/businesses/${BID}/standing-orders/${DOC_ID}/resume`, {
  method: 'POST',
  headers: {
    'X-Api-Key': KEY,
  },
})
const data = await res.json()
if (!data.ok) throw new Error(data.reason)
```
### Python

```python
import requests
res = requests.post(
    f"{BASE}/businesses/{BID}/standing-orders/{DOC_ID}/resume",
    headers={"X-Api-Key": KEY},
)
data = res.json()
```
### PHP

```php
$ch = curl_init("$BASE/businesses/$BID/standing-orders/$DOC_ID/resume");
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => ["X-Api-Key: $KEY"],
]);
$data = json_decode(curl_exec($ch), true);
```
### C#

```csharp
using System.Text.Json;

using var http = new HttpClient();
using var req = new HttpRequestMessage(HttpMethod.Post, $"{BASE}/businesses/{BID}/standing-orders/{DOC_ID}/resume");
req.Headers.Add("X-Api-Key", KEY);
using var res = await http.SendAsync(req);
var data = JsonDocument.Parse(await res.Content.ReadAsStringAsync()).RootElement;
```