# Mobile/Server-to-Server API

## Get Payment Link

<mark style="color:green;">`POST`</mark> `https://pay.voguepay.com`

This endpoint returns a payment URL. Visiting or redirecting users to this URL brings up VoguePay Payment Page that can be used for completing the transaction based on the parameters supplied. See Response in 'Response' Tab below.

#### Query Parameters

| Name                                              | Type   | Description                                                                                                                                                                                                      |
| ------------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| p<mark style="color:red;">\*</mark>               | string | Required for payment link generation. Value must be 'linkToken'                                                                                                                                                  |
| v\_merchant\_id<mark style="color:red;">\*</mark> | string | Merchant ID                                                                                                                                                                                                      |
| memo<mark style="color:red;">\*</mark>            | string | Transaction Memo/Description                                                                                                                                                                                     |
| total<mark style="color:red;">\*</mark>           | string | Total amount                                                                                                                                                                                                     |
| email<mark style="color:red;">\*</mark>           | string | Merchant's Email Address                                                                                                                                                                                         |
| merchant\_ref                                     | string | Merchant Reference - A Value Provided by Merchant to be returned with the confirmation results from the confirmation API. It could be used to store any data to be retrieved with the transaction details later. |
| notify\_url                                       | string | URL to send payment notification to                                                                                                                                                                              |
| success\_url                                      | string | URL to send buyers to if payment is successful                                                                                                                                                                   |
| fail\_url                                         | string | URL to send buyers to when payment fails                                                                                                                                                                         |
| developer\_code                                   | string | A code unique to every developer. Using this code earns  the developer a commission on every successful transaction made through any selected integration methods.                                               |
| cur<mark style="color:red;">\*</mark>             | string | 3 letters currency code in which transaction would be carried out. e.g NGN, USD                                                                                                                                  |
| referral\_url<mark style="color:red;">\*</mark>   | String | URL where payment was initiated                                                                                                                                                                                  |

{% tabs %}
{% tab title="200 Payment Link Generated" %}

```
https://checkout.voguepay.com/?data=%7B%22_amount%22%3A1000%2C%22_callback%22%3A%7B%22_webhook%22%3A%22https%3A%2F%2Fexample.com%2Fnotification.php%22%7D%2C%22_created%22%3A%222021-08-16+12%3A54%3A46%22%2C%22_currency%22%3A%22NGN%22%2C%22_customer%22%3A%7B%22tokenize%22%3Afalse%2C%22email%22%3A%22ajayishegs%40gmail.com%22%2C%22phone%22%3A%22%22%2C%22address%22%3A%22%5Bobject+Object%5D%22%2C%22name%22%3A%22%22%7D%2C%22_ip%22%3A%2254.74.141.25%22%2C%22_items%22%3A%5B%7B%22name%22%3A%22Payment%22%2C%22description%22%3A%22Payment%22%2C%22amount%22%3A%221000%22%7D%5D%2C%22_live%22%3Afalse%2C%22_merchantCurrency%22%3A%22NGN%22%2C%22_parameters%22%3A%7B%7D%2C%22_paymentStatus%22%3A%22Awaiting+Payment%22%2C%22_reference%22%3A%22ref123%22%2C%22_schedule%22%3A%7B%7D%2C%22_status%22%3A%22Open%22%2C%22_uid%22%3A%22fcf56897fece41c5899742fa39e6d61d%22%7D&merchantId=sandbox_760e43f202878f651659820234cad9&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJqdGlfNjExYTYwMTY5ZjRkYTkuODg5NDc4MzgiLCJpYXQiOjE2MjkxMTg0ODYsImlzcyI6IjVmM2NmNTQ0NDFkMmVjMDYyYzUxMzQ2NSIsIk9yZ1VuaXRJZCI6IjVmMzkzYmUxOTZmOGNmN2YyZDRjMzE5NiIsIlJlZmVyZW5jZUlkIjoiZmNmNTY4OTdmZWNlNDFjNTg5OTc0MmZhMzllNmQ2MWQiLCJQYXlsb2FkIjp7Ik9yZGVyRGV0YWlscyI6eyJPcmRlck51bWJlciI6Imp3dE9yZGVyXzYxMWE2MDE2OWY0ZTIwLjE2MDI3NzU0IiwiQW1vdW50IjoxMDAwLCJDdXJyZW5jeUNvZGUiOiJOR04ifX0sIk9iamVjdGlmeVBheWxvYWQiOiJ0cnVlIiwiZXhwIjoxNjI5MTE5Mzg2fQ.lP1EVI3HNmR0u3srDqfKUOSlfCMZu9WgGwk53OY3B4c&refererUrl=
```

{% endtab %}
{% endtabs %}

For failed requests, one of the following is returned:

| Response                                                                                                                | Implication              |
| ----------------------------------------------------------------------------------------------------------------------- | ------------------------ |
| ​<https://checkout.voguepay.com/?error=Customer+object+not+provided.&merchantId=demo&refererUrl=>​                      | Email not provided       |
| ​<https://checkout.voguepay.com/?error=No+merchant+uid+provided.&merchantId=&refererUrl=>​                              | Merchant ID not provided |
| ​<https://checkout.voguepay.com/?error=Name+of+order+item+not+provided+in+order+object.&merchantId=demo&refererUrl=>​   | Memo not provided        |
| ​<https://checkout.voguepay.com/?error=Amount+of+order+item+not+provided+in+order+object.&merchantId=demo&refererUrl=>​ | Total not provided       |

[Next](https://mooseize-tech.gitbook.io/docs/simple-html-form)
