> For the complete documentation index, see [llms.txt](https://docs.finpay.id/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.finpay.id/finpay-pg/after-payment/cancel-order.md).

# Cancel Order

The Cancel Order API is used to cancel a previously generated transaction that has not yet been paid by the customer. The purpose of this API is to prevent payment from being made on transactions that are no longer valid or intended. This API is typically used in scenarios such as:

* The customer cancels the order before completing the payment.
* The customer wishes to change the selected payment method.
* The merchant decides not to proceed with the transaction for specific reasons.

Once the cancellation is successfully executed, the transaction status will be updated to cancelled and it can no longer be paid.

| Environment | Method | URL                                                                                                                          |
| ----------- | ------ | ---------------------------------------------------------------------------------------------------------------------------- |
| Development | GET    | [https://devo.finnet.co.id/pg/payment/card/cancel/{orderId}](https://devo.finnet.co.id/pg/payment/card/cancel/%7BorderId%7D) |
| Production  | GET    | [https://live.finnet.co.id/pg/payment/card/cancel/{orderId}](https://live.finnet.co.id/pg/payment/card/cancel/%7BorderId%7D) |

### Data Request <a href="#data-request" id="data-request"></a>

| No | Name  | Type                                            | Mandatory | Min Length | Max Length | Description     |
| -- | ----- | ----------------------------------------------- | --------- | ---------- | ---------- | --------------- |
| 1  | order | [Object](/appendix/json-object/order-object.md) | M         | 1          | 12         | Detail of Order |

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

```
{
    "order": {
        "id": "FK002502070000196",
        "amount": "22000"
    }
}
```

### Data Response <a href="#data-response" id="data-response"></a>

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

```
{
    "responseCode": "2000000",
    "responseMessage": "Request has been processed successfully",
    "processingTime": 0.24898290634155273,
    "traceId": "93a76615-a2c2-44fd-9dd3-1c0a22a6fe23"
}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.finpay.id/finpay-pg/after-payment/cancel-order.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
