> For the complete documentation index, see [llms.txt](https://developer.convergegate.com/legacy/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.convergegate.com/legacy/card-server-to-server/api-commands/702-request-cancel-authorization.md).

# 702 – Request Cancel Authorization

## 702 Request Data description:

| NODE        | INCLUDE IN CHECKSUM (IN THIS ORDER) | REQUIRED | DATA TYPE          | DESCRIPTION                                                                                                                                                                                                                                               |
| ----------- | ----------------------------------- | -------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| apiUser     | YES (1)                             | YES      | Character max 50.  | The API user assigned by the Gateway to the merchant. Can be obtained from the website inside your merchant account.                                                                                                                                      |
| apiPassword | YES (2)                             | YES      | Character max 50.  | The API password assigned by Gateway to the merchant. Can be obtained from the website inside your merchant account.                                                                                                                                      |
| apiCmd      | YES (3)                             | YES      | 702                | 3 digit numeric transaction code must be 702                                                                                                                                                                                                              |
| gatetransid | YES (4)                             | YES      | Character max 50.  | Unique gateway internal transaction id, received by the merchant in the 850 Notification of the originating transaction.                                                                                                                                  |
| checksum    |                                     | YES      | Character no limit | SHA-1 calculated using the fields specified by the transaction plus the API key assigned by gateway to the merchant. This field must be calculated using the fields marked as “Include in checksum” (in the order indicated) plus the API key at the end. |

## 702 Response Data description

| NODE         | REQUIRED | DATA TYPE          | DESCRIPTION                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ------------ | -------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| result       | YES      | Character          | Result indicates the result of the transaction. CANCELED: Cancel has been completed PENDING: Request for Cancel has been accepted but not yet processed. After the Cancel has been processed, the results will be sent in the 850 Notification that will be sent from the system server to the merchant server. ERROR: means error detected in the request, no processing takes place, and transaction was not accepted by the system. No record for the transaction has been created. Note: Do NOT ASSUME the pending request will result in CANCELED as it could also result in ERROR. |
| gatetransid  | YES      | Character max 50.  | Unique gateway internal transaction id refers to Authorized transaction for which the Capture has been requested.                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| errorcode    | YES      | Character 3        | Error Code of the transaction or 000 if no error condition found.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| errormessage | YES      | Character max 100  | Full description of the error.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| description  | OPT      | Character no limit | Optional details of the transaction except in the case of DECLINED and then the reason for the decline. May be null.                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |

{% tabs %}
{% tab title="CURL" %}

702 Request Sample

```
  <?xmlversion="1.0" encoding="utf-8" ?>
	<transaction>
		<apiUser> </apiUser>
		<apiPassword> </apiPassword>
		<apiCmd> </apiCmd>
		<gatetransid> </gatetransid>
		<checksum> </checksum>		
	</transaction> 
							  
```

The response to a 702 - Request Cancel Authorization is a plain xml un-encoded that contains the following data:

```

	<?xmlversion="1.0" encoding="utf-8" ?>
	<transaction>
		<result> </result>
		<gatetransid> </gatetransid>
		<errorcode> </errorcode>
		<errormessage> </errormessage>
		<description> </description>
	</transaction> 
```

{% endtab %}

{% tab title="PHP" %}
702 Request Sample

```
  require_once 'autoload.php';

use Omnipay\GPNDataEurope\GPNGateway;
set_time_limit(0);

$gpnGateway = new GPNGateway();
$gpnGateway->setApiKey('APIKEY');
$gpnGateway->setApiPassword('APIPASS');
$gpnGateway->setApiUser('APIUSER');
$gpnGateway->setMode(GPNGateway::PROD_MODE);
$gpnGateway->setPROD('https://txtest.txpmnts.com/api/transaction/');


$params = [

	'gatewayTransactionId' => '2FB757FB-C83D-2852-E8FB-DDB2CE1046DF',
];

try {
	// Cancel Authorization 702
	$response = $gpnGateway->cancel($params)->send();
	printf("%s-%s\n", $response->getCode(), $response->getMessage());
	
echo 'GPN Ref. No : '; print_r($response->getData()->getrefer());
echo 'Description : '; print_r($response->getData()->getmessage());
echo 'Merchant Transaction ID : '; print_r($response->getData()->getmerchantTransId());
echo 'Status : '; print_r($response->getData()->getstatus());
echo 'Status Code : '; print_r($response->getData()->getstatusCode());
echo 'Gateway Transaction ID : '; print_r($response->getData()->gettransId());

} catch (Exception $exc) {
	print_r($exc->getCode(), $exc->getMessage());
}
```

{% endtab %}
{% endtabs %}


---

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developer.convergegate.com/legacy/card-server-to-server/api-commands/702-request-cancel-authorization.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
