> For the complete documentation index, see [llms.txt](https://developer.paywall.one/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.paywall.one/payment-orchestration-integration-document/physical-pos/6.-payment/sync/4.-cancel-rollback.md).

# 4. Cancel/Rollback

<mark style="color:green;">`POST`</mark> `{{Base Address}}/api/payment/sync/cancel/rollback`

You only need to send a request to the address provided above. You can use the 'Base Address' as needed for both the Test environment and the Live environment.

{% hint style="warning" %}
You cannot revoke your cancel commands within the first 5 seconds.
{% endhint %}

{% hint style="warning" %}
Cancel commands triggered on the device cannot be revoked. **In order for cancel commands to be revoked, they must not have been received by the device.**
{% endhint %}

{% hint style="info" %}
Important: **To use the Sync Cancel Revoke** service, you must include the **'apikeyprivate'** and **'apiclientprivate'** parameters in the 'Header' field.

\
[<mark style="color:green;">**PhysicalAPI Address**</mark>](/payment-orchestration-integration-document/environment.md)
{% endhint %}

**The header information that must be sent to the service is as follows:**

<table><thead><tr><th width="243">Parameter</th><th width="106.33333333333331">Type</th><th width="151">Compulsory</th><th>Description</th></tr></thead><tbody><tr><td>apikeyprivate</td><td>string</td><td>Yes</td><td>The Private Key obtained from the merchant panel.</td></tr><tr><td>apiclientprivate</td><td>string</td><td>Yes</td><td>The Private Client obtained from the merchant panel.</td></tr></tbody></table>

**The body information that must be sent to the service is as follows:**

{% tabs %}
{% tab title="JSON" %}

```json
{
    "PaymentRequestId": "cc67bd38-ed83-4031-8be7-3ed4b80b7042"
}
```

{% endtab %}
{% endtabs %}

<table><thead><tr><th width="268">Parameter</th><th width="98.33333333333331">Type</th><th width="131.515625">Compulsory</th><th>Description</th></tr></thead><tbody><tr><td><pre><code>PaymentRequestId
</code></pre></td><td>Guid</td><td>Yes</td><td>It is the identity information returned from Paywall at the moment of the sale order.</td></tr></tbody></table>

**The response returned from the service:**

<table><thead><tr><th width="182">Parameter</th><th width="107.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td>Result</td><td>object</td><td>It returns the details of the service.</td></tr><tr><td>ErrorCode</td><td>int</td><td>Error code. If the transaction is successful, it returns a value of '0'.</td></tr><tr><td>Succeeded</td><td>bool</td><td>It returns a true or false value. If the transaction is <mark style="color:green;">successful</mark>, it returns a value of 'true'.</td></tr><tr><td>Failed</td><td>bool</td><td>It returns a true or false value. If the transaction <mark style="color:red;">fails</mark>, it returns a value of 'true'.</td></tr><tr><td>Message</td><td>string</td><td>If the transaction is incorrect, this is the error message specified, and it provides language support based on the locale parameter.</td></tr><tr><td>ClientMessage</td><td>string</td><td>It returns the fixed values of Paywall error codes. You can perform mapping.</td></tr></tbody></table>

{% tabs %}
{% tab title="JSON" %}
{% code overflow="wrap" lineNumbers="true" %}

```json5
{
    "result": {
        "paymentRequestId": "72ec8714-d116-4306-8881-38a43c485da9",
        "paymentRequestActivityId": "3a7deace-d437-4d3f-8ef8-1cba82f18e8f",
        "paymentRequestActivityTypeId": 2,
        "paymentStatus": 4
    },
    "failed": false,
    "message": null,
    "clientMessage": null,
    "succeeded": true
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

<table><thead><tr><th width="319">Parameter</th><th width="97.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td><pre><code>PaymentRequestId
</code></pre></td><td>Guid</td><td>It is the identity information of the Async payment in Paywall. It <strong>must be stored.</strong></td></tr><tr><td><pre><code>PaymentRequestActivityId
</code></pre></td><td>Guid</td><td>It is the identity information of the last transaction of the Async payment.</td></tr><tr><td><pre><code>PaymentRequestActivityTypeId
</code></pre></td><td>int</td><td><p>It is the transaction type of the last Async payment.</p><p><br>Bkz: <a href="/pages/1xYupwNBhCGkf5K8pF0S">Payment Type</a></p></td></tr><tr><td><pre><code>PaymentStatus
</code></pre></td><td>int</td><td>It is the last status of the Async payment.<br><br>Bkz: <a href="/pages/J3yOjFSwZlEKFz4zXQa7">Payment Status</a></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developer.paywall.one/payment-orchestration-integration-document/physical-pos/6.-payment/sync/4.-cancel-rollback.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
