# Take back a cancellation

> Page: https://docs.plotwork.dev/api/post-user-billing-resume. Index of every page: https://docs.plotwork.dev/llms.txt

Undoes a cancellation made earlier in the period, so the subscription renews.

`POST /user/billing/resume`

## TL;DR

| Question | Answer |
|---|---|
| What does it do? | Take back a cancellation. |
| What does it take? | Nothing. |
| What does it return? | Status 200 with a body of type [`BillingState`](https://docs.plotwork.dev/api/schemas.md#billingstate). |
| What can go wrong? | `401` not signed in; `403` the request came from an origin that may not make changes; `409` there is no paid plan, or it is not set to end; `429` too many requests; `502` stripe could not complete the request; `503` billing is not set up on this server. Every failure uses the one error envelope. |

## What it does

Undoes a cancellation made earlier in the period, so the subscription renews. 409 when there is no paid plan or it is not set to end.

## Responses

| Status | Meaning | Body |
|---|---|---|
| 200 | The account's plan after the change. | [`BillingState`](https://docs.plotwork.dev/api/schemas.md#billingstate) |
| 401 | Not signed in. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 403 | The request came from an origin that may not make changes. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 409 | There is no paid plan, or it is not set to end. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 429 | Too many requests. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 502 | Stripe could not complete the request. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 503 | Billing is not set up on this server. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |

## Response body

A 200 answer has the type [`BillingState`](https://docs.plotwork.dev/api/schemas.md#billingstate).

| Field | Type | Required | Description |
|---|---|---|---|
| `plan` | `"free" \| "pro"` | yes | The plan the account gets right now. It is the free plan whenever the subscription is not paying, whatever plan was bought. |
| `status` | `string` | yes | Stripe's status for the subscription (`active`, `trialing`, `past_due`, `canceled`, `unpaid`, `incomplete`, and so on), or `none` when the account never started one. |
| `currentPeriodEnd` | `integer \| null` | yes | When the period paid for ends, in milliseconds since the epoch, or null when there is no subscription. |
| `cancelAtPeriodEnd` | `boolean` | yes | True while the subscription is scheduled to end at the close of the period already paid for. |
| `hasCustomer` | `boolean` | yes | True once the account has billing details at Stripe, which is when the billing portal can be opened. |

## See also

| Doc | Why |
|---|---|
| [API reference](https://docs.plotwork.dev/api/reference.md) | Every endpoint, and the error envelope |
| [Schemas](https://docs.plotwork.dev/api/schemas.md) | Every request and response type |
| [Tool reference](https://docs.plotwork.dev/mcp/tools.md) | The operations as callable tools |
