---
title: "Update a payment request"
method: PATCH
path: "/poslink/v2/payment-requests/{payment-request-id}"
tags: ["Payment Requests"]
---

# Update a payment request

`PATCH /poslink/v2/payment-requests/{payment-request-id}`

## Request

- Base URL: `https://api.teya.com`
- URL: `https://api.teya.com/poslink/v2/payment-requests/{payment-request-id}`
- Auth: OAuth 2
  - Authorization code: `https://id.teya.com/oauth/v2/oauth-authorize`
  - Token URL: `https://id.teya.com/oauth/v2/oauth-token`
- TypeScript: <https://skmtc.dev/teya/apis/poslink-api/docs/poslink/v2/payment-requests/:payment-request-id/patch.ts> (a function with typed inputs; its response is checked against the schema)

This API call is used to request the cancellation of a payment request by setting its status to `CANCELLING`.

**This call is a request to cancel, not a confirmation** that the payment was cancelled. A successful (`200`) response means the cancellation request has been accepted and the payment request has moved to `CANCELLING` — it does not mean the payment has been cancelled.

Whether the payment is actually cancelled depends on how far the terminal has progressed:

- If the terminal has not yet started processing the payment, the terminal cancels the payment request and its status becomes `CANCELLED` with a status reason of `CANCELLED_BY_EPOS`.
- If the terminal has already started processing the payment, the cancellation cannot be applied and the payment continues to its final status (`SUCCESSFUL` or `FAILED`), which overrides `CANCELLING`.

To confirm the outcome, keep following the payment request’s status updates until it reaches a final state. The payment is only cancelled when the status is `CANCELLED`; a final state of `SUCCESSFUL` or `FAILED` means the cancellation did not take effect.

**Required Scopes (one of the following):**

- `payment_requests` (returned via the register API: `POST /poslink/v1/epos/register`)
- `default_access` (deprecated, will be removed in the future; included for backward compatibility with existing integrations)

## Path parameters

- `payment-request-id` string, uuid, required

## Request body

- NewCancelPaymentRequest
  - `status` 'CANCELLING', required: The status to update the payment request to

## Response `200`

Cancellation request accepted. The payment request has moved to `CANCELLING`; this does not confirm the payment was cancelled. Follow the status updates until a final state (`CANCELLED`, `SUCCESSFUL`, or `FAILED`) to determine the outcome.

- CancelPaymentRequestResponse
  - `payment_request_id` string, uuid: The ID assigned to the payment request
  - `status` 'CANCELLING' | 'CANCELLED': The current status of the request. Note that this cannot be NEW
  - `updated_at` string: The date and time the payment request was last updated (ISO 8601 format)

## Other responses

- `400`: Bad request
- `401`: Lacks valid authentication credentials for the requested resource
- `403`: The server understands the request but refuses to authorize it
- `408`: Request timeout
- `415`: Unsupported Media Type
- `429`: Too many requests in a given amount of time
- `500`: Internal Server Error

---

[API](https://skmtc.dev/teya/apis/poslink-api.md) - [All operations](https://skmtc.dev/teya/apis/poslink-api/llms.txt) - [OpenAPI document](https://skmtc.dev/teya/apis/poslink-api/revisions/cc7c1bd11e93?raw)
