# Posting Transaction

Create an HTML form wherever you would like your ‘Pay’ button to appear and then set the form’s method to POST and the action attribute to [*https://pay.qoop.ng/payexpress*](https://pay.qoop.ng/payexpress)

Create a submit button in the form and a few hidden fields through which you would assign transaction values you wish to post. See Fields and values for the required fields and a few optional ones.

| Field               | Description                                                                                                                                        | Type    |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| amount              | Transaction amount  E.g., 2500.00 for 2,500.00                                                                                                     | float   |
| site\_redirect\_url | URL of the page on your web site/portal user is to be redirected to after payment. Ensure you it has either http\:// or https\://                  | URL     |
| txn\_ref            | Transaction Reference Number. This Reference Number must be generated by your web site/portal and a unique value must be sent for each transaction | string  |
| hash                | A Hashed value of selected combined parameters.                                                                                                    | string  |
| cust\_name          | Customer's fullname                                                                                                                                |         |
| partner\_id         | This is your username on the QOOP Dashboard                                                                                                        |         |
| live\_api\_key      | This key can be found in your QOOP Dashboard profile.                                                                                              | string  |
| order\_id           | The unique ID for the order/transaction being sent. This must be visible to the customer on the merchant website                                   | integer |

**Sample request**

```markup
<form action="https://pay.qoop.ng/payexpress" method="post" >
	<input type="hidden" name="amount" value="2500.00" />
	<input type="hidden" name="site_redirect_url" value="https://storeurl/wc-api/wc_plugin_qpay_Gateway/" />
	<input type="hidden" name="txn_ref" value="5af4392212b9b" />
	<input type="hidden" name="hash" value="d8f8f0d4d12350a4b52d9716" />
	<input type="hidden" name="cust_name" value="Simon Kolawole" />
	<input type="hidden" name="partner_id" value="hofstede" />
	<input type="hidden" name="live_api_key" value="D2Q0KWkIE332Xx39FyB3bv" />
	<input type="hidden" name="order_id" value="15665" />
</form>   
```

###

## How to process the response

The following are the parameters returned by QOOP for real-time transactions. Note that QOOP will perform a `GET` request to the **site\_redirect\_url** provided in the request to QOOP.

`https://site_redirect_url/?`\
`txnRef=5af4392212b9b`\
`&PaymentReference=238477494594`\
`&Amount=2500.00`\
`&err=false`\
`&ResponseCode=00`\
`&ResponseDescription=Success`

| Param               | Description                                                                                                                  | Type    |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ------- |
| txnRef              | The transaction Reference initially generated & sent by the merchant site will be sent back with this variable.              | string  |
| PaymentReference    | A reference number that uniquely identifies all transactions that go through the QOOP payment gateway.                       | string  |
| Amount              | Transaction amount  E.g., 2500.00 for 2,500.00                                                                               | float   |
| err                 | **Default:** false. If the PayExpress experienced error, it will return true                                                 | boolean |
| ResponseCode        | <p>00 = payment successful</p><p>10 = payment failed: insufficient amount in wallet<br>11 = payment failed: other</p><p></p> | string  |
| ResponseDescription | success or fail                                                                                                              | string  |

## How to validate a transaction

## Get Transaction

<mark style="color:blue;">`GET`</mark> `https://pay.qoop.ng/gettransaction`

This endpoint is to validate/get a transaction

#### Query Parameters

| Name           | Type   | Description                                     |
| -------------- | ------ | ----------------------------------------------- |
| live\_api\_key | string | This key can be found in your QOOP Dashboard    |
| order\_id      | string | Order ID initially used to generate transaction |

{% tabs %}
{% tab title="200 Validated Response" %}

```javascript
{
  "ResponseCode": "00",
  "Amount": 20000,
  "ResponseDescription": "Success"
}Other response codes are Other
```

{% endtab %}
{% endtabs %}

Other response codes are:

| Response Code | Response Description                                |
| ------------- | --------------------------------------------------- |
| 02            | More than one transaction with same Order ID #XXXX. |
| 03            | Transaction #XXXX does not exist.                   |
| 04            | Invalid API Key.                                    |
| 05            | Missing API Key.                                    |
| 06            | Order ID unknown.                                   |


---

# 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.qoop.ng/merchant-integration/posting-transaction.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.
