# 6. Cancel Provision

## Cancel Provision

<mark style="color:green;">`POST`</mark> `{{Base Adres}}/api/paywall/apm/provision/cancel`

{% hint style="info" %}
**Important:** To use the APM Payment Cancel Provision service, you must include the **apikeypublic** and **apiclientpublic** parameters in the **Header** section.\
\
[<mark style="color:green;">**PaymentAPI Address**</mark>](https://developer.paywall.one/payment-orchestration-integration-document/environment)
{% endhint %}

**The header parameters that must be sent to the service are as follows:**

<table><thead><tr><th width="221">Parameter</th><th width="117.63671875">Type</th><th width="174.14453125">Compulsory</th><th width="403">Description</th></tr></thead><tbody><tr><td>apikeypublic</td><td>string</td><td>Yes</td><td>The Public Key obtained from the merchant panel.</td></tr><tr><td>apiclientpublic</td><td>string</td><td>Yes</td><td>The Public Client obtained from the merchant panel.</td></tr></tbody></table>

**The (BODY) parameters that must be sent to the service are as follows:**

<table><thead><tr><th width="225">Parameter</th><th width="107">Type</th><th width="164.67578125">Compulsory</th><th width="336">Description</th></tr></thead><tbody><tr><td>UniqueCode</td><td>string</td><td>Yes</td><td>This is the <strong>UniqueCode</strong> parameter related to the APM payment. It is included in the response returned by the API at the time of creation.</td></tr></tbody></table>

**The parameters returned by the service are as follows:**

<table><thead><tr><th width="189">Parameter</th><th width="100.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td>ErrorCode</td><td>int</td><td>Error code. Returns a value of '0' if the operation is successful.</td></tr><tr><td>Result</td><td>bool</td><td>Returns a value of <strong>true</strong> or <strong>false</strong>. If the operation is successful, it returns <strong>true</strong>.</td></tr><tr><td>Message</td><td>string</td><td>If the operation fails, this is the error message provided. It supports language localization based on the <strong>locale</strong> parameter.</td></tr><tr><td>Body</td><td>object</td><td>If the operation fails, this is the detailed object describing the error.</td></tr></tbody></table>

```json
{
    "ErrorCodeType": 1,
    "ErrorMessage": null,
    "ErrorCode": 0,
    "Result": true,
    "Message": "",
    "Body": {
        "ApmKey": "Masterpass_IFrame",
        "ApmConnectionId": 2003,
        "ApmTransactionId": 14211,
        "UniqueCode": "487f16f4-c678-40de-9b53-bd34855863e2",
        "MerchantUniqueCode": "7250512c-cbb4-41a4-9fea-374d11081075",
        "Amount": 8.00,
        "ProviderDummyResponse": {
            "ErrorCode": 0,
            "Body": {
                "acquirerRetrievalNumber": null,
                "authCode": "24564913",
                "orderId": "487f16f4c67840de9b53bd34855863e2",
                "icaNumber": null,
                "terminalGroupId": "78516638760698041272198",
                "terminalGroupName": null,
                "amount": null,
                "currencyCode": "TRY",
                "accountKey": "905437845114",
                "transactionDate": null,
                "retrievalReferenceNumber": "200007756435",
                "paymentRetrievalReferenceNumber": "200007756433",
                "pointRefundResponse": null,
                "responseCode": "00",
                "description": null,
                "ResponseDescription": null,
                "OrderStatus": null,
                "OrderDate": null
            },
            "HttpCode": 200
        }
    }
}
```
