> Index of every page: https://docs.merchantservicedepot.com/llms.txt

# Cancel scheduled collection


`POST /v1/invoices/{invoice_id}/cancel_schedule`

Leaves the invoice open but stops it collecting itself.

Auth: a secret key with the `invoices.schedule` permission. Returns `200` with Invoice.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `invoiceId` | path | string | Yes | The invoice id in the request path. |

## Request

**curl**

```curl
curl -X POST "https://payments-api-sandbox.merchantservicedepot.com/v1/invoices/{invoice_id}/cancel_schedule" \
  -H "Authorization: Bearer $MYELA_API_KEY"
```

**Node**

```node
const res = await fetch("https://payments-api-sandbox.merchantservicedepot.com/v1/invoices/{invoice_id}/cancel_schedule", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MYELA_API_KEY}`,
  },
});

if (!res.ok) {
  const { error } = await res.json();
  // Branch on error.code — never on error.message.
  throw new Error(error.code);
}
const data = await res.json();
```

**Python**

```python
import os
import requests

res = requests.post(
    "https://payments-api-sandbox.merchantservicedepot.com/v1/invoices/{invoice_id}/cancel_schedule",
    headers={
        "Authorization": f"Bearer {os.environ['MYELA_API_KEY']}",
    },
)

if not res.ok:
    # Branch on error["code"] — never on error["message"].
    raise RuntimeError(res.json()["error"]["code"])
data = res.json()
```

## Response

| Field | Type | Description |
| --- | --- | --- |
| `id` | string | Unique invoice identifier. |
| `object` | "invoice" | Stable resource discriminator. |
| `status` | string | Current invoice state. |
| `invoiceNumber` | string | Your invoice's own number: a per-account sequence behind a prefix you choose. Unique within your account, and yours to quote to a customer — it is not the processor's reference, nor the number on the payment that settles it. |
| `customerId` | string | Customer receiving the invoice. |
| `amount` | integer | Invoice total in minor units. On an itemized invoice this is the computed sum — lines, plus tax, less discount — not a figure set independently of them. |
| `amountPaid` | integer | Amount paid in minor units: `amount` once paid, 0 while open. On a partly paid invoice (`overdue`, or `void` after it), what the first partial payment still holds, net of refunds; check `/attempts` for any later one. Read paid from `status`, not this figure. |
| `currency` | string | Three-letter currency code. |
| `description` | string | Free-text memo, the same field the create call takes as description. Absent when the invoice carries none. |
| `items` | array | The billed lines, in the order they were sent, with amounts in minor units. Absent on an invoice created from a total alone — an amount-only invoice has no lines to report, and none are invented for it. |
| `amountTax` | integer | Tax added to the line total, in minor units. Absent when the invoice carried none, which is not the same as zero. |
| `amountDiscount` | integer | Discount subtracted from the line total, in minor units. Absent when the invoice carried none. |
| `billTo` | object | Who the invoice was addressed to, copied from the customer's default billing address when the invoice was issued. A snapshot, not a live link — a customer who moves house does not rewrite invoices already sent. Absent on a draft, which has not been issued. |
| `paymentTerms` | string | How dueAt was arrived at: due_on_receipt, net_7, net_15, net_30, net_60, or custom when the date was named directly. Absent on invoices issued before terms existed. |
| `issuedAt` | string | When the invoice was issued, which is not when it was created — a draft written on Monday and sent on Friday is issued Friday. Terms count from here. Absent while it is still a draft. |
| `url` | string | Where the customer pays this invoice, on a Myela-hosted page. Present once the invoice has been sent from the portal or by an auto-send recurring invoice; one only created and scheduled through /v1 has none. |
| `pdfUrl` | string | The invoice as a PDF, fronted by your business name. Fetch it with the same API key; it is not a public link. |
| `dueAt` | string | ISO 8601 due timestamp. |
| `collection` | object | Scheduled collection details, when configured. |
| `createdAt` | string | ISO 8601 creation timestamp. |
| `pendingConfirmation` | object | Present only while a charge on this invoice is unresolved. Automatic collection is suspended and the named payment must be reconciled before it resumes. Voiding is refused (409, `details.code` `PAYMENT_PENDING_CONFIRMATION`) until it clears, and still afterwards if the named payment resolved as authorized but never captured. |

```json
{
  "id": "inv_01JEXAMPLE",
  "object": "invoice",
  "status": "open",
  "invoiceNumber": "INV-000123",
  "customerId": "cus_01JEXAMPLE",
  "amount": 147375,
  "amountPaid": 0,
  "currency": "USD",
  "description": "Consulting, August",
  "items": [
    {
      "description": "Consulting, August",
      "quantity": 20,
      "unitAmount": 7500,
      "amount": 150000
    }
  ],
  "amountTax": 12375,
  "amountDiscount": 15000,
  "billTo": {
    "name": "Augusta King",
    "company": "Analytical Engines Ltd",
    "line1": "12 St James Square",
    "city": "London",
    "postalCode": "SW1Y 4LE",
    "country": "GB"
  },
  "paymentTerms": "net_30",
  "issuedAt": "2026-08-19T10:00:00.000Z",
  "url": "https://example.com/pay/8Kd2mQ",
  "pdfUrl": "https://payments-api-sandbox.merchantservicedepot.com/v1/invoices/inv_01JEXAMPLE/pdf",
  "dueAt": "2026-09-01T00:00:00.000Z",
  "collection": {
    "collectAt": "2026-09-01T09:00:00.000Z",
    "attemptCount": 0
  },
  "createdAt": "2026-08-10T20:49:51.653Z",
  "pendingConfirmation": {
    "paymentId": "pay_01JEXAMPLE",
    "since": "2026-09-14T18:04:11.000Z"
  }
}
```

Source: https://docs.merchantservicedepot.com/api-reference/cancel-scheduled-collection/
