The upper levels set the name and the theme. The Payments section adds a block
under the menu and removes the page outline. One page brings the outline back with its own note and
turns on the footer.
---
noindex: true
---
# Cancel a payment
You can cancel a payment in the `pending` status until the customer pays it.
A paid payment cannot be canceled: create a refund for it instead.
## Request
```bash {title="Request"}
curl -X POST https://api.acme-pay.example/v1/payments/pay_2Hk81/cancel \
-u "$ACME_TEST_KEY:"
```
## Response
The payment moves to the `canceled` status, and the payment page stops
opening.
## Limits
You can cancel a payment within 24 hours after it is created. After that it
is canceled automatically.
How it works
Upper levels. The site’s docara.json sets the theme, and the shared
section.json of the demo section sets the name “Acme Pay” and the header
sections. That is why the Payments section and page files do not have them.
Section.section.json puts its own block under the menu and turns
off the page outline ("outline": {"enabled": false}) for every page in the section.
Page."$reset": true in the outline region drops what came from the
section, and the page sets the right column again: the outline and its
own note. The page turns on the footer only for itself.
Without $reset, the page fields would merge with the section fields. With a reset, the region
is fully described in page.json, and you do not need to remember what came from above.