> 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/2.-sale-rollback.md).

# 2. Sale/Rollback

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

You only need to send a request to the address provided above. You can use the 'Base Address' as desired for both the test environment and the production 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 Sale Rollback** service, you must include the '**apikeyprivate**' and '**apiclientprivate**' parameters in the 'Header' section of your request.

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

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

<table><thead><tr><th width="206">Parameter</th><th width="123.33333333333331">Type</th><th width="146">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 needs to 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="229.5546875">Parameter</th><th width="104.33333333333331">Type</th><th width="139">Compulsory</th><th>Description</th></tr></thead><tbody><tr><td><pre><code>PaymentRequestId
</code></pre></td><td>Guid</td><td>Yes</td><td>The identification information returned by Paywall at the time of the sales order.</td></tr></tbody></table>

**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>Returns the information in the details of the service.</td></tr><tr><td>ErrorCode</td><td>int</td><td>Error code. Returns the value '0' if the transaction is successful.</td></tr><tr><td>Succeeded</td><td>bool</td><td>Returns a true or false value. Returns 'true' if the transaction is <mark style="color:green;">successful</mark>.</td></tr><tr><td>Failed</td><td>bool</td><td>Returns a true or false value. Returns 'true' if the transaction is <mark style="color:red;">unsuccessful</mark>.</td></tr><tr><td>Message</td><td>string</td><td>If the transaction is erroneous, this is the message related to the error. It provides language support based on the locale parameter.</td></tr><tr><td>ClientMessage</td><td>string</td><td>Returns the fixed values of the Paywall error codes. You can perform mapping.</td></tr></tbody></table>

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

```json5
{
    "Result": {
        "PaymentRequestId": "fb9c4719-945d-45b9-9f9c-fd79d8e4af85",
        "PaymentRequestActivityId": "3653663e-6237-42b3-8255-3951959c3fe1",
        "PaymentRequestActivityTypeId": 1,
        "PaymentStatus": 12
    },
    "Failed": false,
    "Message": null,
    "ClientMessage": null,
    "Succeeded": true
}
```

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

<table><thead><tr><th width="263">Parameter</th><th width="139.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td><pre><code>PaymentRequestId
</code></pre></td><td>Guid</td><td>The identity information of the Async payment in Paywall. It <strong>should 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>The transaction type of the last Async payment.</p><p><br>See: <a href="/pages/r4byguUuzDCdaFZE5hOM">Payment Type</a></p></td></tr><tr><td><pre><code>PaymentStatus
</code></pre></td><td>int</td><td>The last status of the Async payment.<br><br>See: <a href="/pages/xRrVHeb3yeYB9gbKcgUS">Payment Status</a></td></tr></tbody></table>
