# Order Cancel API
## Overview
Through this interface you can cancel order
The API access is over HTTPS, and accessed from the `https://www.lipapay.com/api/CancelOrderController.htm`
## Interface content
### Send Message Endpoint
#### Product ENV
```
https://www.lipapay.com/api/CancelOrderController.htm
```
#### Sandbox ENV
```
api url: http://www.lipapay.net/api/CancelOrderController.htm
merchant url: http://www.lipapay.net
merchant id: test
password:1234567890
key: Gw416RCMO8tD5MSUg5dok5uQGvR3rPpx
```
### Request Method
HTTP POST
### Request Parameters
| Field Name | Type | Required | Description |
| --------------- | ------ | ------ | ---------------------------------------- |
| merchantId | string | Y| It's created by LipaPay. Please contact via info@lipapay.com |
| signType| string | Y| Sign type (e.g. MD5)|
| sign| string | Y| The signed content is obtained by signing algorithm |
| merchantOrderNo | string | Y| The merchant platform order number, It must be unique |
| amount | string | Y| The amount of transaction (unit cent) |
## Response
Judge the errorCode value.The cancellation of the order is successful if errorCode is "00000" . You must see the status.
### Response Data Type
application/json
### Response Parameters
| Field Name | Type | Required | Description|
| --------------- | ------ | ------ | ---------------------- |
| status| string | Y | Order cancellation status |
| signType| string | Y | Sign type |
| errorCode | string | Y | Cancel response code|
| errorMsg| string | Y | Cancel response message |
| sign| string | N | The signed content is obtained by signing algorithm |
| merchantId | string | N | It's created by LipaPay |
| merchantOrderNo| string | N | The merchant platform order number, It must be unique |
| orderAmount| string | N | The amount of transaction (unit cent) |
Examples:
```
Successfull response
{
"errorCode": "00000",
"errorMsg": "SUCCESS",
"status": "SUCCESS",
"signType": "MD5"
}
Fail response
{
"errorCode": "100001",
"errorMsg": "System Error",
"status": "FAIL",
"signType": "MD5"
}
{
"orderAmount":"100"
"merchantId":"2016051112014649173090"
"errorCode": "300903",
"errorMsg": "Merchant No exists",
"signType": "MD5",
"merchantOrderNo":"YYN16F52F7UHIU",
"status": "FAIL"
}
```
## Signature rule
1.In accordance with the ASCII sort, add the encrypted key after the sorted content.
Example:
```
amount=100&merchantId=2016051112014649173095&merchantOrderNo=0RJH8D4VAP6BOMMX&signType=MD5He4AXjdOmq1G2YH3RKVSS4kqU5VFa4aK
```
Signed content is:
```
2f9d72ff509f8f3a4809e784b61e2caf
```
## Error code
| Error Code | Description|
| --------- | ------------------------------ |
| 00000| Successful cancellation of order |
| 300101| Order dosen't exists |
| 300903| Merchant dosen't exists |
| 201001| Validate sign is error |