# Payment Cancel

This API service is providing direct debit payment cancellation, the partner can perform cancellation service once the payment process is successful.

### Technical Specification <a href="#technical-specification" id="technical-specification"></a>

```
Service Code: 57
```

| Environment | Method | URL                                               |
| ----------- | ------ | ------------------------------------------------- |
| Development | POST   | <https://snapstag.finnet.co.id/v1.0/debit/cancel> |
| Production  | POST   | <https://snap.finnet.co.id/v1.0/debit/cancel>     |

### Body Request <a href="#body-request" id="body-request"></a>

| No | Name                       | Type   | Mandatory | Min Length | Max Length | Description                                                |
| -- | -------------------------- | ------ | --------- | ---------- | ---------- | ---------------------------------------------------------- |
| 1  | originalPartnerReferenceNo | String | M         | 1          | 64         | Transaction identifier on service consumer system          |
| 2  | originalReferenceNo        | String | M         | 1          | 64         | Original transaction identifier on service provider system |

#### Sample Request <a href="#sample-request" id="sample-request"></a>

```
{
  "originalPartnerReferenceNo": "78912343452347892",
  "originalReferenceNo": "78912343452347891"
}
```

### Body Response <a href="#body-response" id="body-response"></a>

| No | Name                       | Type                                                              | Mandatory | Min Length | Max Length | Description                                                       |
| -- | -------------------------- | ----------------------------------------------------------------- | --------- | ---------- | ---------- | ----------------------------------------------------------------- |
| 1  | responseCode               | [Enum](/api-reference/appendix/enumeration/response-code-list.md) | M         | 1          | 7          | BI SNAP Response Code.                                            |
| 2  | responseMessage            | String                                                            | M         | 1          | 150        | BI SNAP Response Message.                                         |
| 3  | originalReferenceNo        | String                                                            | O         | 1          | 64         | Transaction identifier/reference generated by PJP AIS Selain Bank |
| 4  | originalPartnerReferenceNo | String                                                            | O         | 1          | 64         | Transaction identifier on service consumer system                 |
| 5  | cancelTime                 | String                                                            | O         | 1          | 25         | Cancellation time                                                 |

#### Sample Response <a href="#sample-response" id="sample-response"></a>

```
{
  "responseCode": "2005700",
  "responseMessage": "Request has been processed successfully",
  "cancelTime": "2022-11-30T08:48:49Z",
  "originalPartnerReferenceNo": "78912343452347892",
  "originalReferenceNo": "2210070000001"
}
```

### Response Code & Message <a href="#response-code--message" id="response-code--message"></a>

The table below lists response codes and messages for the Payment Cancel API.

| No | HTTP Code | Code    | Message (Indonesian)            |
| -- | --------- | ------- | ------------------------------- |
| 1  | 200       | 2005700 | Successful                      |
| 2  | 400       | 4005700 | Bad request                     |
| 3  | 400       | 4005701 | Invalid field format {field}    |
| 4  | 400       | 4005702 | Invalid mandatory field {field} |
| 5  | 401       | 4015701 | Invalid token (B2B)             |
| 6  | 401       | 4015700 | Unauthorised. \[Reason]         |
| 7  | 403       | 4035701 | Feature not allowed             |
| 8  | 403       | 4035704 | Activity count limit exceeded   |
| 9  | 404       | 4045708 | Invalid merchant                |
| 10 | 500       | 5005700 | General error                   |
| 11 | 504       | 5045700 | Timeout                         |


---

# Agent Instructions: 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:

```
GET https://docs.finpay.id/api-reference/finpay-money/linkage/direct-debit/payment-cancel.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
