# Global Solutions API

### Terms and Definitions <a href="#terms-and-definitions" id="terms-and-definitions"></a>

* System — Global Solutions payment gateway.
* Merchant — Global Solutions client who works with the System.
* API — application program interface for interacting with the system, located at [https://api.global-solutions.io](https://api.global-solutions.io/)
* Back Office — merchant's back office in the system, located at [https://dashboard.global-solutions.io](https://dashboard.global-solutions.io/)
* Card — a bank card of Visa, MasterCard or MIR systems.&#x20;
* Acquirer — a settlement bank.&#x20;
* Issuer — a bank that issued a card.&#x20;
* Cardholder — an owner of a card issued by a bank.&#x20;
* Widget — payment form, provided by the system to enter card data by a holder and perform a further authorization.&#x20;
* 3-D Secure — protocol to verify a holder by the issuer.&#x20;

### Transaction types

The system involves three types of operations: payment, refund, and payout. In the first case, money is transferred from holder's account to the merchant, in the second - vice versa. A merchant performs a refund if a buyer wants to return goods, and it is always associated with a payment transaction, which amount returns to a holder. It is possible to refund a whole payment amount or it's part only. Money usually comes back to a holder’s card the same day, but sometimes (it depends on an issuer) it can take up to 3 days. Payout operation is used to transfer the funds from the merchant account to the Cardholder's account. The payout is possible only when the initial payment with a Card was done using the System.

### Payment Methods

* Via payment form — **widget**. Add a script that opens a secure payment form (iframe) to enter card data.&#x20;
* Via **API** by a card’s cryptogram. Add a checkout to your web site which collects card data from any web site’s form, encrypts and creates a cryptogram for a secured transmission through an interserver interaction.&#x20;
* Via **redirect**. User gets redirect to a payment page hosted on our servers.

### 3-D Secure

3-D Secure is a common name of Verified By Visa and MasterCard Secure Code programs from Visa and MasterCard's respectively. In general, such program shall authenticate a cardholder (that is to protect against an unauthorized card usage) by an issuer before a payment. Actually, it looks as follows: a cardholder specifies card data. Then the issuer’s web site opens, where a cardholder has to enter a password or a secret code (usually, the code is sent in a SMS message). If the code is correct, a payment will be successful. Otherwise, it will be rejected.

During the payment process, 3-D Secure appears not on all cards, but only on those, Issuers supporting this technology. Certainly, payments without 3-D Secure are a less secure option.

## Payment via Redirect

In Payment Redirect method the user gets redirected to the payment page, hosted by the System. After the user has entered his/her bank card data, the user then gets redirected back to the merchant site.

The Payment Redirect link is located in the Back Office and can be used in the following way:

```http
https://api.global-solutions.io/payments/redirect/pbid_2kajhh9oqhmpwjqgd529rg?
    \ amount=10.50&
    \ description=Payment&
    \ currency=EUR&
    \ invoiceId=0001&
    \ accountId=account%40example.com&
    \ successUrl=https%3A%2F%2Fwww.example.com%2Fsuccess&
    \ failureUrl=https%3A%2F%2Fwww.example.com%2Ffailure&
    \ pendingUrl=https%3A%2F%2Fwww.example.com%2Fpending&
    \ cancelUrl=https%3A%2F%2Fwww.example.com%2Fcancel&
    \ locale=en_US
```

| Parameter   | Type   | Usage    | Description                                                                                                                                                                                                                                      |
| ----------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| amount      | Number | Required | Payment amount                                                                                                                                                                                                                                   |
| description | String | Required | Description of a payment purpose in text format                                                                                                                                                                                                  |
| currency    | String | Required | Payment currency                                                                                                                                                                                                                                 |
| invoiceId   | String | Optional | Order or Invoice number                                                                                                                                                                                                                          |
| accountId   | String | Optional | Payer's identifier. If specified, the payment token will be returned in the [Notification](https://apidocs.global-solutions.io/broken-reference) which can be used for payouts                                                                   |
| successUrl  | String | Required | URL the user gets redirected, after the successful charge transaction.                                                                                                                                                                           |
| failureUrl  | String | Required | URL the user gets redirected, after the charge transaction has failed.                                                                                                                                                                           |
| pendingUrl  | String | Required | URL the user gets redirected when the charge transaction status cannot be immediately returned. The merchant should expect to receive the end status of the transaction in [Notification](https://apidocs.global-solutions.io/broken-reference). |
| cancelUrl   | String | Required | URL the user gets redirected, after the payment was cancelled by the user.                                                                                                                                                                       |
| locale      | String | Optional | Payment form language. The default language is English when the parameter is not specified.                                                                                                                                                      |

{% hint style="info" %}
All query parameters passed to the redirect url (incl. description, accountId, successUrl, failureUrl, pendingUrl) should be URL encoded.
{% endhint %}

## Payment Widget

Payment widget is a pop-up form to enter card data and payer’s email address. The widget automatically defines a payment system type: Visa, MasterCard, Maestro or MIR, and an emitting bank of a card and corresponding logos. The form is optimized for use in any browsers and mobile devices. There is an iframe opens within a widget which guarantees a security of card data sending and does not require a certification for merchant's usage.

### Widget Installation

To install a widget, you need to add a script on a web site to the head section:

```markup
<script src="https://widget.global-solutions.io/assets/js/payment.js"></script>
```

Define a function for charge method calling for payment form to display

```javascript
var gsPay = new GSPay();

		pay = function () {
			gsPay.charge({
					publicId: 'pbid_2kajhh9oqhmpwjqgd529rg',  //id of site (see your merchant account page)
					amount: 68.54, 
					currency: 'EUR', 
					invoiceId: '9264', // order number (optional)
					description: 'Product purchasing example',
					accountId: 'foo@bar.com' // payer identification (optional)
				},
				function (options) {
					// after payment success
					console.log('payment success');
				},
				function (reason, options) { 
					// after payment failure
					console.log('payment failed');
				});

			return gsPay;
		};
```

Call the function when some event is emitted, for example click on the «Pay» button:

```javascript
$('#checkout').click(pay);
```

Or use a link to call the payment method:

```markup
<a href="javascript:" onclick="pay()">Pay</a><br/>
```

### Parameters

| Parameter   | Type    | Usage    | Description                                                                                        |
| ----------- | ------- | -------- | -------------------------------------------------------------------------------------------------- |
| publicId    | String  | Required | A merchant identifier, located in Back Office                                                      |
| description | String  | Required | Description of a payment purpose in text format                                                    |
| amount      | Numeric | Required | Payment amount                                                                                     |
| currency    | String  | Required | Payment currency                                                                                   |
| invoiceId   | String  | Optional | Order or Invoice number                                                                            |
| accountId   | String  | Optional | Payer's identifier. If specified, the payment token will be returned which can be used for payouts |
| locale      | String  | Optional | Payment widget's language. The default language is English when the parameter is not specified.    |

You can define the form behaviour for successful or unsuccessful payment using the following parameters:

| Parameter | Type     | Usage    | Description                                                   |
| --------- | -------- | -------- | ------------------------------------------------------------- |
| onSuccess | Function | Optional | Function will be called after successful payment completion   |
| onFail    | Function | Optional | Function will be called after unsuccessful payment completion |

### Locale

You can specify you language locale when the payment widget is created. The following locales are supported right now:

| Locale | Language                           |
| ------ | ---------------------------------- |
| en\_US | English language. Used by default. |
| ru\_RU | Russian                            |

## API

**API** is an application program interface to interact with Merchant's system.

Interface works on api.global-solutions.com and provides functionality for making a payment, refunding, and payouts.

{% hint style="warning" %}
Parameters are sent by POST method in a request body in JSON format. Use *application/json* Content-Type for data transfer.
{% endhint %}

The system returns a response in JSON format which includes at least two parameters: **success** and **message**:

```javascript
{ "Success": false, "Message": "Invalid Amount value" }
```

### Requests Authentication

For authentication **HTTP Basic Auth** is used which is sending a login and a password in a header of HTTP request. **Public ID** serves as a login and **API Secret** serves as a password. Both of these values you can get in the back office.

{% hint style="warning" %}
If a request does not contain a header with authentication data, or incorrect data is sent, the system returns 401 HTTP status - Unauthorized.
{% endhint %}

### Duplicate Requests Protection

**invoiceId** parameter is used to identify the uniqueness of the request sent from the Merchant to the System. That means you can send several requests to the system with the same **invoiceId** identifier, and only one request will be processed. The following requests with the same invoiceId will be Declined. Thus the protection against network errors is implemented which can lead to creation of duplicate records and actions. The time interval when the System considers the received invoiceId is duplicate can be configured individually per Merchant.&#x20;

{% hint style="info" %}
Duplicate Requests Protection by invoiceId is disabled by default. Refer to you Account Manager in case the Protection has to be activated.
{% endhint %}

## Test

<mark style="color:green;">`POST`</mark> `https://api.global-solutions.io/test`&#x20;

The method to test the interaction with the API.

#### Headers

| Name          | Type   | Description               |
| ------------- | ------ | ------------------------- |
| Authorization | string | HTTP Basic authentication |
| Content-Type  | string | application/json          |

{% tabs %}
{% tab title="200 The method returns a request status." %}

```javascript
{"success": true, "message": "Test message success"}
```

{% endtab %}
{% endtabs %}

## Payment

<mark style="color:green;">`POST`</mark> `https://api.global-solutions.io/payments/charge/card` &#x20;

The method to request a payment with Card data supplied. This method is used when the Card data is collected on the merchant's side.&#x20;

#### Headers

| Name            | Type   | Description               |
| --------------- | ------ | ------------------------- |
| Authorization\* | string | HTTP Basic authentication |
| Content-Type\*  | string | application/json          |

#### Request Body

| Name               | Type   | Description                                                                                                                                                                       |
| ------------------ | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| publicId\*         | string | Merchant identifier. Located in the Back Office                                                                                                                                   |
| amount\*           | number | Payment amount                                                                                                                                                                    |
| currency\*         | string | Payment currency                                                                                                                                                                  |
| name\*             | string | Cardholder's name                                                                                                                                                                 |
| description\*      | string | Description                                                                                                                                                                       |
| card\*             | object | Card data of a payment. See the example below for the card data object structure.                                                                                                 |
| invoiceId          | string | Order or invoice number                                                                                                                                                           |
| accountId\*        | string | Payer's e-mail address. If specified, the payment token will be returned which can be used for Payouts                                                                            |
| ip\*               | string | Payer's IP address                                                                                                                                                                |
| successRedirectUrl | string | URL the user gets redirected to after the successful charge transaction. This parameter is used only when the integration supports "Redirect 3-DS" schema.                        |
| failureRedirectUrl | string | URL the user gets redirected to after the charge transaction has failed. This parameter is used only when  the integration supports "Redirect 3-DS" schema.                       |
| pendingRedirectUrl | string | URL the user gets redirected to when the end status of the transaction cannot be retrieved yet. This parameter is used only when the integration supports "Redirect 3-DS" schema. |

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

```javascript
{
    "success": true,
    "message": null,
    "model": {
        "transactionId": 524,
        "amount": 40.11,
        "currency": "EUR",
        "invoiceId": "9276334",
        "accountId": "john@doe.com",
        "description": "Payment for products",
        "name": "John Doe",
        "token": "8163-KS17-JV29-KF28",
        "statusCode": 4,
        "status": "Completed",
        "reasonCode": 0,
        "reason": "Approved"
    }
}
```

{% endtab %}
{% endtabs %}

#### Payment request example

```javascript
{
	"publicId": "pbid_2kajhh9oqhmpwjqgd529rg",
	"amount": 40.11,
	"currency": "EUR",
	"name": "John Doe",
	"invoiceId": "927829",
	"description": "Payment for products",
	"accountId": "john@doe.com",
	"card": {
		"publicId": "pbid_2kajhh9oqhmpwjqgd529rg",
		"pan": "4242424242424242",
		"cvv": "123",
		"expiryMonth": 12,
		"expiryYear": 2023
	},
	"browserData": {
		"colorDepth": "24",
 		"javaEnabled": "false",
		"screenHeight": "600",
		"screenWidth": "800",
		"language": "en_US",
		"acceptHeader": "text/html,application/xhtml+xml,application/xml",
		"timeZoneOffset": "+120",
 		"userAgent": "AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0"
	},
	"data": {
		"countryCode": "UK",
		"city": "London",
		"address": "Wall Street 15",
		"postcode": "12384",
		"phone": "441632960909",
		"state": "",
		"birthDate": "1980-04-25",
		"firstName": "John",
		"lastName": "Doe"
	}
}
```

#### Response: transaction success

```javascript
{
    "success": true,
    "message": null,
    "model": {
        "transactionId": 524,
        "amount": 40.11,
        "currency": "EUR",
        "invoiceId": "9276334",
        "accountId": "john@doe.com",
        "description": "Payment for products",
        "name": "John Doe",
        "token": "8163-KS17-JV29-KF28",
        "statusCode": 4,
        "status": "Completed",
        "reasonCode": 0,
        "reason": "Approved"
    }
}
```

#### Response: transaction failure

```javascript
{
    "success": false,
    "message": "Insufficient funds to process the transaction",
    "model": {
        "transactionId": 524,
        "amount": 2873.00,
        "currency": "EUR",
        "invoiceId": "9276334",
        "accountId": "john@doe.com",
        "description": "Payment",
        "name": "John Doe",
        "token": null,
        "statusCode": 99,
        "status": "Declined",
        "reasonCode": 5051,
        "reason": "Insufficient Funds"
    }
}
```

#### Response: 3-D Secure authentication redirect is required (Redirect 3-DS)

Payment response depends on the processing card. If the card participates in 3-D Secure, in Redirect 3-DS schema the response will contain a link, the user should be redirected to, to complete the 3-D Secure authentication.

```javascript
{
    "success": false,
    "message": "Requires 3DS authentication",
    "threeDsRedirectModel": {
        "url": "https://api.global-solutions.com/redirect/?link_reference=437b2e80220a11bc8b532f4e2aa8c471",
        "transactionId": 525,
        "statusCode": 1,
        "status": "AwaitingAuthentication"
    }
}
```

After completing the 3-D Secure verification, depending on the verification results, the user gets redirected either to **successRedirectUrl** or **failureRedirectUrl** or **pendingRedirectUrl** parameter value, supplied in the [Payment](https://apidocs.global-solutions.io/broken-reference) request.

#### Response: 3-D Secure authentication handling by merchant is required (Advanced 3-DS)

```javascript
{
    "success": false,
    "message": "Requires 3DS authentication",
    "threeDsModel": {
        "transactionId": 529,
        "method": "post",
        "paReq": "eNpdU8tymzAU3ecrvMumYz1AgD2yZnDsTpMZx06TRdudLK5skhiIgNjust/Tr+qXVMIm4DDDoHvuOdKZexB/2hqA2SOo2oC4Ggz4AspSbmCQJpPrSELAZKApSOyFkWYaY+brJAq0pzTQa6ewmlX8Hd4aRZDoKMIs8WXiK2/NvIAFDPwwoRrCkV6fFVbzDqZM80yQIR5SjtqybRcyE4xFPmUhoZiGhPkRRw5tGQswaiuzqgUsJNXb9PZeMBpYFUfnsuvvwNzOBKa4fTg6QR0lkzsQ84PcFa/AUVN1TZXXWWWOgmLrpS26dm1exbaqijFC+/1+CKddhrnZII5cs7WOPnvnq9oBZf+wQ5qIxSzed+/8uPj9QO6flb98iiccOUbHT2QF1hlhmODRgARj6o0Z46jBezPaOd/i35+/hH7x7ATOQMconJf4hBLqKH2kN43aGMjUUYxCN4626ghwKPIMrMbm+7HuGYZSCevPfT4m83kQ/ObbRcCqsnHls7V++fVAHoPlnb/9eVMuVz+m8fzrNN5MXOwN6cJHaoMiETkZSbvUOGr3t0e7v7i5A+h8CcQVR5cX5D/FxN2u",
        "acsUrl": "http://ascbank.redisecure.com/ascpage/cap?id=8276844",
        "statusCode": 1,
        "status": "AwaitingAuthentication"
    }
}
```

In the Advanced 3-DS schema, to complete 3-D Secure authentication, merchant needs to forward a payer to the address specified in the **acsUrl** parameter of the server's response with following parameters:

* MD — **transactionId** parameter from server response&#x20;
* PaReq — same parameter from server response&#x20;
* TermUrl — the address on your site for returning the payer once authentication successful

#### Form example

```markup
<form name="paymentForm" action="AcsUrl" method="POST">
    <input type="hidden" name="PaReq" value="eNpdU8tymzAU3ecrvMumYz1AgD2yZnDsTpMZx06TRdudLK5skhiIgNjust/Tr+qXVMIm4DDDoHvuOdKZexB/2hqA2SOo2oC4Ggz4AspSbmCQJpPrSELAZKApSOyFkWYaY+brJAq0pzTQa6ewmlX8Hd4aRZDoKMIs8WXiK2/NvIAFDPwwoRrCkV6fFVbzDqZM80yQIR5SjtqybRcyE4xFPmUhoZiGhPkRRw5tGQswaiuzqgUsJNXb9PZeMBpYFUfnsuvvwNzOBKa4fTg6QR0lkzsQ84PcFa/AUVN1TZXXWWWOgmLrpS26dm1exbaqijFC+/1+CKddhrnZII5cs7WOPnvnq9oBZf+wQ5qIxSzed+/8uPj9QO6flb98iiccOUbHT2QF1hlhmODRgARj6o0Z46jBezPaOd/i35+/hH7x7ATOQMconJf4hBLqKH2kN43aGMjUUYxCN4626ghwKPIMrMbm+7HuGYZSCevPfT4m83kQ/ObbRcCqsnHls7V++fVAHoPlnb/9eVMuVz+m8fzrNN5MXOwN6cJHaoMiETkZSbvUOGr3t0e7v7i5A+h8CcQVR5cX5D/FxN2u">
    <input type="hidden" name="MD" value="529">
    <input type="hidden" name="TermUrl" value="https://merchant.example.com/post3ds?orderId=82794">
</form>
<script>
    window.onload = submitForm;
    function submitForm() { paymentForm.submit(); }
</script>
```

{% hint style="info" %}
When authentication is done, payer will be returned to TermUrl with the MD and PaRes parameters passed in the POST method.
{% endhint %}

To complete the payment, use [post3ds](https://apidocs.global-solutions.io/broken-reference) method.

{% hint style="warning" %}
Please contact your Account Manager to clarify if Advanced 3-DS schema is available for your integration.
{% endhint %}

## Post 3-D Secure

<mark style="color:green;">`POST`</mark> `https://api.global-solutions.io/payments/post3ds` &#x20;

The method to validate payment's 3-D Secure authentication

#### Headers

| Name            | Type   | Description               |
| --------------- | ------ | ------------------------- |
| Authorization\* | string | HTTP Basic authentication |
| Content-Type\*  | string | application/json          |

#### Request Body

| Name            | Type    | Description          |
| --------------- | ------- | -------------------- |
| transactionId\* | integer | MD parameter value   |
| paRes\*         | string  | Received PaRes value |

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

```
{
    "success": true,
    "message": null,
    "model": {
        "transactionId": 524,
        "amount": 40.11,
        "currency": "EUR",
        "invoiceId": "9276334",
        "accountId": "john@doe.com",
        "description": "Payment for products",
        "name": "John Doe",
        "token": "8163-KS17-JV29-KF28",
        "statusCode": 4,
        "status": "Completed",
        "reasonCode": 0,
        "reason": "Approved"
    }
}
```

{% endtab %}
{% endtabs %}

The server will return either information about successful transaction or declined in response to correctly created request.

## Refund

<mark style="color:green;">`POST`</mark> `https://api.global-solutions.io/payments/refund`  &#x20;

The method to return the funds of a successfully completed charge operation

#### Headers

| Name            | Type   | Description               |
| --------------- | ------ | ------------------------- |
| Authorization\* | string | HTTP Basic authentication |
| Content-Type\*  | string | application/json          |

#### Request Body

| Name            | Type    | Description                                                                                                                                                        |
| --------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| transactionId\* | integer | Transaction ID of successfully completed charge transaction                                                                                                        |
| amount          | number  | Refund amount. If the amount is not provided, the transaction is refunded in full of the initial charge amount. The transaction can be refunded partially as well. |

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

```javascript
{
    "model": {
        "transactionId": 1039
    },
    "success": true,
    "message": null
}
```

{% endtab %}
{% endtabs %}

#### Request example

```javascript
{
    "transactionId": 524, 
    "amount": 13.34
}
```

## Payout via token

<mark style="color:green;">`POST`</mark> `https://api.global-solutions.io/payments/payout` &#x20;

The method to payout the funds to a Card by provided token

#### Headers

| Name            | Type   | Description               |
| --------------- | ------ | ------------------------- |
| Authorization\* | string | HTTP Basic authentication |
| Content-Type\*  | string | application/json          |

#### Request Body

| Name        | Type   | Description                                                                                                |
| ----------- | ------ | ---------------------------------------------------------------------------------------------------------- |
| token\*     | string | Token of the card. The token is received in response message after the successful Payment API method call. |
| amount\*    | number | Payout amount                                                                                              |
| accountId\* | string | Payer's e-mail address.                                                                                    |
| currency\*  | string | Payout currency                                                                                            |
| invoiceId   | string | Order or invoice number                                                                                    |

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

```javascript
{
    "success": true,
    "message": null,
    "model": {
        "transactionId": 2533,
        "amount": 12.30,
        "currency": "EUR",
        "invoiceId": null,
        "accountId": "john@doe.com",
        "name": "John Doe",
        "statusCode": 7,
        "status": "PayoutCompleted",
        "reasonCode": 0,
        "reason": "Approved"
    }
}
```

{% endtab %}
{% endtabs %}

#### Request example

```javascript
{
    "token": "8163-KS17-JV29-KF28",
    "amount": 12.30,
    "accountId": "john@doe.com",
    "currency": "EUR"
}
```

## Payout to card

<mark style="color:green;">`POST`</mark> `https://api.global-solutions.io/payments/payout/card` &#x20;

Payout method when the funds are transferred to the provided credit card

#### Headers

| Name            | Type   | Description               |
| --------------- | ------ | ------------------------- |
| Authorization\* | string | HTTP Basic authentication |
| Content-Type\*  | string | application/json          |

#### Request Body

| Name       | Type   | Description                      |
| ---------- | ------ | -------------------------------- |
| pan\*      | string | Card number                      |
| name\*     | string | Cardholder name                  |
| amount\*   | number | Payout amount                    |
| currency\* | string | Payout currency                  |
| invoiceId  | string | Order or invoice number          |
| data       | string | Payout recipient additional data |

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

```javascript
{
    "success": true,
    "message": null,
    "model": {
        "transactionId": 2533,
        "amount": 12.30,
        "currency": "EUR",
        "invoiceId": "11928485",
        "accountId": null,
        "name": "John Doe",
        "statusCode": 7,
        "status": "PayoutCompleted",
        "reasonCode": 0,
        "reason": "Approved"
    }
}
```

{% endtab %}
{% endtabs %}

#### Request example

```javascript
{
    "pan": "4242424242424242",
    "name": "John Doe",
    "amount": 12.30,
    "currency": "EUR",
    "invoiceId": "11928485",
    "data": {
        "phone": "+999389235",
        "address": "Wall street 65",
        "city": "New York",
        "countryCode": "US",
        "birthDate": "1980-11-25"
    }
}
```

## Status

<mark style="color:green;">`POST`</mark> `https://api.global-solutions.io/payments/status`&#x20;

Returns the current status of the requested transaction.

#### Headers

| Name            | Type   | Description               |
| --------------- | ------ | ------------------------- |
| Authorization\* | string | HTTP Basic authentication |
| Content-Type\*  | string | application/json          |

#### Request Body

| Name            | Type   | Description                           |
| --------------- | ------ | ------------------------------------- |
| transactionId\* | string | Transaction ID to check the status of |

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

```javascript
{
    "model": {
        "transactionId": 144221,
        "amount": 12.30,
        "currency": "EUR",
        "invoiceId": "11928485",
        "accountId": "john@doe.com",
        "name": "John Doe",
        "statusCode": 4,
        "status": "Completed",
        "reasonCode": 0,
        "reason": "Approved",
        "operationTypeCode": 1,
        "operationType": "Payment"
    },
    "success": true,
    "message": null
}
```

{% endtab %}
{% endtabs %}

#### Request example

```javascript
{
    "transactionId": 144221
}
```

## Status Invoice

<mark style="color:green;">`POST`</mark> `https://api.global-solutions.io/payments/status/invoice`&#x20;

Returns the current status of the requested transaction.

#### Headers

| Name                                            | Type   | Description               |
| ----------------------------------------------- | ------ | ------------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | HTTP Basic authentication |
| Content-Type<mark style="color:red;">\*</mark>  | string | application/json          |

#### Request Body

| Name                                        | Type   | Description                                   |
| ------------------------------------------- | ------ | --------------------------------------------- |
| invoiceId<mark style="color:red;">\*</mark> | string | Transaction Invoice ID to check the status of |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "success": true,
    "message": null,
    "transactions": [
        {
            "transactionId": 501166,
            "amount": 2.54,
            "currency": "EUR",
            "invoiceId": "1781",
            "accountId": "john@deer.com",
            "name": "John Deer",
            "statusCode": 4,
            "status": "Completed",
            "reasonCode": 0,
            "reason": "Approved",
            "operationTypeCode": 1,
            "operationType": "Payment"
        },
        {
            "transactionId": 501167,
            "amount": 2.54,
            "currency": "EUR",
            "invoiceId": "1781",
            "accountId": "john@deer.com",
            "name": "John Deer",
            "statusCode": 99,
            "status": "Declined",
            "reasonCode": 6002,
            "reason": "Duplicate invoice ID",
            "operationTypeCode": 1,
            "operationType": "Payment"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

#### Request example

```javascript
{
    "invoiceId": "1781"
}
```

## List

<mark style="color:green;">`POST`</mark> `https://api.global-solutions.io/payments/list`&#x20;

Returns the lists of all transactions for a day.

#### Headers

| Name            | Type   | Description               |
| --------------- | ------ | ------------------------- |
| Authorization\* | string | HTTP Basic authentication |
| Content-Type\*  | string | application/json          |

#### Request Body

| Name     | Type   | Description                                                                                                                                             |
| -------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| date\*   | string | Date when transactions were created in 'YYYY-MM-DD' format.                                                                                             |
| timezone | string | Transactions date timezone. See Timezones dictionary for available timezones. If timezone is not specified, the transactions are returned based on UTC. |

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

```javascript
{
    "success": true,
    "message": null,
    "transactions": [
        {
            "id": 16213,
            "statusId": 4,
            "status": "Completed",
            "currency": "USD",
            "amount": 65.77,
            "description": "Products Payment",
            "invoiceId": "132-33541-34",
            "accountId": "test@account.com",
            "created": 1606726879000,
            "operationTypeId": 1,
            "operationType": "Payment",
            "reasonId": 0,
            "reason": "Approved",
            "cardType": "Visa",
            "cardFirstSix": "411111",
            "cardLastFour": "1111",
            "completed": 1606726905000,
            "paymentTransactionId": null
        }
    ]
}
```

{% endtab %}
{% endtabs %}

#### Request example

```javascript
{"date":"2020-10-25", "timezone":"Europe/Moscow"}
```

## Link

<mark style="color:green;">`POST`</mark> `https://api.global-solutions.io/payments/link`&#x20;

The method is used to generate a payment link, where the user can be redirected to proceed with the payment. When the payment is requested, a payment link is generated and returned in the "link" field of the response.

#### Headers

| Name            | Type   | Description               |
| --------------- | ------ | ------------------------- |
| Authorization\* | string | HTTP Basic authentication |
| Content-Type\*  | string | application/json          |

#### Request Body

| Name          | Type   | Description                                                                                                       |
| ------------- | ------ | ----------------------------------------------------------------------------------------------------------------- |
| amount\*      | number | Payment amount                                                                                                    |
| currency\*    | string | Payment currency                                                                                                  |
| description\* | string | Payment description in text format                                                                                |
| invoiceId     | string | Order or invoice number                                                                                           |
| accountId\*   | string | Payer's identifier                                                                                                |
| successUrl    | string | The URL address the user gets redirected after  successful payment operation                                      |
| failureUrl    | string | The URL address the user gets redirected after the payment transaction has failed                                 |
| pendingUrl    | string | The URL address the user gets redirected when the payment processing is pending                                   |
| cancelUrl     | string | The URL address the user gets redirected when the payment has been cancelled by the user                          |
| locale        | string | Payment form language. English language is used by default when no locale specified                               |
| ip\*          | string | IP address of the payer.                                                                                          |
| data          | object | Additional data required for the payment processing. See request example for available fields in the data object. |

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

```javascript
{
    "success": true,
    "message": null,
    "model": {
        "transactionId": 356244,
        "amount": 10.66,
        "currency": "USD",
        "invoiceId": "990022",
        "accountId": "john@doe.com",
        "description": "Payment for products",
        "statusCode": 10,
        "status": "Created",
        "reasonCode": 0,
        "reason": "Approved"
    },
    "link": {
        "method": "get",
        "action": "https://checkout.global-solutions.com/?f8927-3928f-2398-3939"
    }
}
```

{% endtab %}
{% endtabs %}

#### Request example

```javascript
{
	"amount": 10.66,
	"currency": "USD",
	"description": "Payment for products",
	"invoiceId": "990022",
	"accountId": "john@doe.com",
	"successUrl": "https://example.com/success",
	"failureUrl": "https://example.com/failure",
        "pendingUrl": "https://example.com/pending",
        "cancelUrl": "https://example.com/cancel",
        "locale": "en_US", 
        "ip": "10.20.30.40",
        "data": {
                "personId": "4000878749933",
                "phone": "+73838247553",
                "address": "Wall Street 14-49",
                "city": "New York",
                "firstName": "John",
                "lastName": "Doe",
                "countryCode": "BR",
                "paymentTypeId": 1000
         }
}
```

## Balance

<mark style="color:blue;">`GET`</mark> `https://api.global-solutions.com/payments/balance`&#x20;

Returns the list of available accounts and balance. The balance is calculated taking into account the amount of successful payments, payouts, holds and fees.

#### Headers

| Name            | Type   | Description               |
| --------------- | ------ | ------------------------- |
| Authorization\* | string | HTTP Basic authentication |
| Content-Type\*  | string | application/json          |

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

```javascript
{
    "success": true,
    "message": null,
    "balances": [
        {
            "name": "The balance",
            "currencies": [
                {
                    "currency": "EUR",
                    "total": 14633.00,
                    "pending": 0.00,
                    "hold": 481.70,
                    "fee": 529.98,
                    "pendingFee": 0.00,
                    "available": 13621.32
                },
                {
                    "currency": "USD",
                    "total": 59483.00,
                    "pending": 503.00,
                    "hold": 3220.70,
                    "fee": 1003.98,
                    "pendingFee": 45.10,
                    "available": 54710.22
                },
            ]
        }
    ]
}
```

{% endtab %}
{% endtabs %}

#### Response fields description

| Parameter  | Type   | Description                                      |
| ---------- | ------ | ------------------------------------------------ |
| currency   | String | Balance currency                                 |
| total      | Number | Total funds amount on the balance                |
| pending    | Number | Funds that are reserved for ongoing transactions |
| hold       | Number | Funds on hold                                    |
| fee        | Number | Acquiring and other fees                         |
| pendingFee | Number | Funds that are reserved for ongoing fees         |
| available  | Number | Funds available for operations                   |

### Alternative Payment Methods

Alternative Payments Methods (APM) include non-card transactions. Good examples of Alternative Payments Methods are banklinks, kiosks, e-wallets, etc. See the list of available APMs below.

<table data-header-hidden><thead><tr><th>Method</th><th width="116">Type ID</th><th>Method</th><th width="135">Country</th><th>Request example</th></tr></thead><tbody><tr><td>Method</td><td>Type ID</td><td>Method</td><td>Country</td><td>Request example</td></tr><tr><td>APM Test Payment</td><td>1</td><td>Link</td><td></td><td></td></tr><tr><td>APM Test Payout</td><td>2</td><td>APM Payout</td><td></td><td></td></tr><tr><td>YooMoney (Yandex Money)</td><td>201</td><td>Link</td><td>Russia</td><td></td></tr><tr><td>WebMoney</td><td>501</td><td>Link</td><td>Russia</td><td></td></tr><tr><td>Banco Itau</td><td>1000</td><td>Link</td><td>Brazil</td><td></td></tr><tr><td>Santander Brasil</td><td>1001</td><td>Link</td><td>Brazil</td><td></td></tr><tr><td>Banco do Brasil</td><td>1002</td><td>Link</td><td>Brazil</td><td></td></tr><tr><td>Banrisul</td><td>1003</td><td>Link</td><td>Brazil</td><td></td></tr><tr><td>Bradesco Pague Facil</td><td>1004</td><td>Link</td><td>Brazil</td><td></td></tr><tr><td>Bradesco Pague Facil</td><td>1005</td><td>Link</td><td>Brazil</td><td></td></tr><tr><td>Caixa Econômica Federal</td><td>1006</td><td>Link</td><td>Brazil</td><td></td></tr><tr><td>Banco Itau Boleto</td><td>1007</td><td>Link</td><td>Brazil</td><td></td></tr><tr><td>UPI</td><td>2000</td><td>Link</td><td>India</td><td></td></tr><tr><td>Google Pay</td><td>2001</td><td>Link</td><td>India</td><td></td></tr><tr><td>JioMoney</td><td>2002</td><td>Link</td><td>India</td><td></td></tr><tr><td>Airtel Money Wallet</td><td>2003</td><td>Link</td><td>India</td><td></td></tr><tr><td>Reliance Jio Wallet</td><td>2004</td><td>Link</td><td>India</td><td></td></tr><tr><td>Freecharge Wallet</td><td>2005</td><td>Link</td><td>India</td><td></td></tr><tr><td>Phonepe Wallet</td><td>2006</td><td>Link</td><td>India</td><td></td></tr><tr><td>Amazon Wallet</td><td>2007</td><td>Link</td><td>India</td><td></td></tr><tr><td>Ola Money Wallet</td><td>2008</td><td>Link</td><td>India</td><td></td></tr><tr><td>Mobikwik Wallet</td><td>2009</td><td>Link</td><td>India</td><td></td></tr><tr><td>Bank Of Maharashtra</td><td>2010</td><td>Link</td><td>India</td><td></td></tr><tr><td>Central Bank Of India</td><td>2011</td><td>Link</td><td>India</td><td></td></tr><tr><td>Hdfc Bank</td><td>2012</td><td>Link</td><td>India</td><td></td></tr><tr><td>Canara Bank</td><td>2013</td><td>Link</td><td>India</td><td></td></tr><tr><td>Bank Of India</td><td>2014</td><td>Link</td><td>India</td><td></td></tr><tr><td>City Union Bank</td><td>2015</td><td>Link</td><td>India</td><td></td></tr><tr><td>Federal Bank</td><td>2016</td><td>Link</td><td>India</td><td></td></tr><tr><td>Icici Bank</td><td>2017</td><td>Link</td><td>India</td><td></td></tr><tr><td>Indian Bank</td><td>2018</td><td>Link</td><td>India</td><td></td></tr><tr><td>Indian Overseas Bank</td><td>2019</td><td>Link</td><td>India</td><td></td></tr><tr><td>Industrial Development Bank Of India</td><td>2020</td><td>Link</td><td>India</td><td></td></tr><tr><td>Indusind Bank</td><td>2021</td><td>Link</td><td>India</td><td></td></tr><tr><td>Jammu And Kashmir Bank</td><td>2022</td><td>Link</td><td>India</td><td></td></tr><tr><td>Karnataka Bank Ltd</td><td>2023</td><td>Link</td><td>India</td><td></td></tr><tr><td>Karur Vysya Bank</td><td>2024</td><td>Link</td><td>India</td><td></td></tr><tr><td>State Bank Of India</td><td>2025</td><td>Link</td><td>India</td><td></td></tr><tr><td>South Indian Bank</td><td>2026</td><td>Link</td><td>India</td><td></td></tr><tr><td>Kotak Bank</td><td>2027</td><td>Link</td><td>India</td><td></td></tr><tr><td>Union Bank Of India</td><td>2028</td><td>Link</td><td>India</td><td></td></tr><tr><td>Bank Of Baroda Retail Accounts</td><td>2029</td><td>Link</td><td>India</td><td></td></tr><tr><td>Yes Bank</td><td>2030</td><td>Link</td><td>India</td><td></td></tr><tr><td>Andhra Bank</td><td>2031</td><td>Link</td><td>India</td><td></td></tr><tr><td>Uco Bank</td><td>2032</td><td>Link</td><td>India</td><td></td></tr><tr><td>Catholic Syrian Bank</td><td>2033</td><td>Link</td><td>India</td><td></td></tr><tr><td>Allahabad Bank</td><td>2034</td><td>Link</td><td>India</td><td></td></tr><tr><td>Dhanalaxmi Bank Corporate</td><td>2035</td><td>Link</td><td>India</td><td></td></tr><tr><td>Laxmi Vilas Bank - Corporate Net Banking</td><td>2036</td><td>Link</td><td>India</td><td></td></tr><tr><td>Punjab National Bank</td><td>2037</td><td>Link</td><td>India</td><td></td></tr><tr><td>Standard Chartered Bank</td><td>2038</td><td>Link</td><td>India</td><td></td></tr><tr><td>Punjab And Sind Bank</td><td>2039</td><td>Link</td><td>India</td><td></td></tr><tr><td>Saraswat Cooperative Bank</td><td>2040</td><td>Link</td><td>India</td><td></td></tr><tr><td>VISA/MC/RuPay</td><td>2041</td><td>Link</td><td>Worldwide</td><td></td></tr><tr><td>Paytm, IN, Online</td><td>2042</td><td>Link</td><td>India</td><td></td></tr><tr><td>IDFC BANK</td><td>2053</td><td>Link / APM Payout</td><td>India</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>India Bank Selection</td><td>2060</td><td>Link</td><td>India</td><td></td></tr><tr><td>UPI QR</td><td>2080</td><td>Link</td><td>India</td><td></td></tr><tr><td>Axis Bank</td><td>2081</td><td>Link / APM Payout</td><td>India</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Bandhan Bank</td><td>2082</td><td>Link / APM Payout</td><td>India</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Bank Of Baroda</td><td>2083</td><td>Link / APM Payout</td><td>India</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Federal Bank LTD</td><td>2084</td><td>Link / APM Payout</td><td>India</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>IDBI Bank</td><td>2085</td><td>Link / APM Payout</td><td>India</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>India Post Payment Bank</td><td>2086</td><td>Link / APM Payout</td><td>India</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Jammu and Kashmir Bank Limited</td><td>2087</td><td>Link / APM Payout</td><td>India</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Karnataka Bank Limited</td><td>2088</td><td>Link / APM Payout</td><td>India</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Lakshmi Vilas Bank</td><td>2090</td><td>Link / APM Payout</td><td>India</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>PAYTM Payments Bank LTD</td><td>2091</td><td>Link / APM Payout</td><td>India</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Ujjivan Small Finance Bank</td><td>2092</td><td>Link / APM Payout</td><td>India</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>UPI Payouts</td><td>3020</td><td>APM Payout</td><td>India</td><td></td></tr><tr><td>Bank Transfer Payouts</td><td>3021</td><td>APM Payout</td><td>India</td><td></td></tr><tr><td>Techcombank</td><td>7000</td><td>Link / APM Payout</td><td>Vietnam</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Sacombank</td><td>7001</td><td>Link / APM Payout</td><td>Vietnam</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Vietcombank</td><td>7002</td><td>Link / APM Payout</td><td>Vietnam</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Asia Commercial Bank</td><td>7003</td><td>Link / APM Payout</td><td>Vietnam</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>DongA Bank</td><td>7004</td><td>Link / APM Payout</td><td>Vietnam</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Vietinbank</td><td>7005</td><td>Link / APM Payout</td><td>Vietnam</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>BIDV Bank</td><td>7006</td><td>Link / APM Payout</td><td>Vietnam</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Eximbank</td><td>7007</td><td>Link / APM Payout</td><td>Vietnam</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Agribank</td><td>7008</td><td>Link / APM Payout</td><td>Vietnam</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>USDT Crypto ERC20</td><td>7009</td><td>Link / APM Payout</td><td>Vietnam</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>USDT Crypto BEP20</td><td>7010</td><td>Link / APM Payout</td><td>Vietnam</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Asia Commercial Bank (QR service)</td><td>7061</td><td>Link / APM Payout</td><td>Vietnam</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>BIDV Bank (QR service)</td><td>7062</td><td>Link / APM Payout</td><td>Vietnam</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Vietcombank (QR service)</td><td>7063</td><td>Link / APM Payout</td><td>Vietnam</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Vietinbank (QR service)</td><td>7064</td><td>Link / APM Payout</td><td>Vietnam</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Momo QR Payment (QR service)</td><td>7065</td><td>Link / APM Payout</td><td>Vietnam</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Zalo QR Payment (QR service)</td><td>7066</td><td>Link / APM Payout</td><td>Vietnam</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Zalo H5 Payment (H5 service)</td><td>7067</td><td>Link / APM Payout</td><td>Vietnam</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Vietnam Prosperity Joint-Stock Commercial Bank (QR Service)</td><td>7068</td><td>Link / APM Payout</td><td>Vietnam</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Military Commercial Bank (QR Service)</td><td>7069</td><td>Link / APM Payout</td><td>Vietnam</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Techcombank (QR Service)</td><td>7070</td><td>Link / APM Payout</td><td>Vietnam</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Vietnam QR</td><td>22011</td><td>Link</td><td>Vietnam</td><td><h4>Link request example for certain methods. (1)</h4></td></tr><tr><td>Krung Thai Bank</td><td>7011</td><td>Link / APM Payout</td><td>Thailand</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Siam Commercial Bank</td><td>7012</td><td>Link / APM Payout</td><td>Thailand</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Bangkok bank</td><td>7013</td><td>Link / APM Payout</td><td>Thailand</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Kasikorn Bank</td><td>7014</td><td>Link / APM Payout</td><td>Thailand</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Thai Military Bank</td><td>7015</td><td>Link / APM Payout</td><td>Thailand</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Krungsri bank</td><td>7016</td><td>Link / APM Payout</td><td>Thailand</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>CIMB Thai Bank Public Company Limited</td><td>7017</td><td>Link / APM Payout</td><td>Thailand</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Government Savings Bank</td><td>7018</td><td>Link / APM Payout</td><td>Thailand</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>United Overseas Bank (Thai) PCL.</td><td>7019</td><td>Link / APM Payout</td><td>Thailand</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Government Housing Bank</td><td>7020</td><td>Link / APM Payout</td><td>Thailand</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Hong Kong Shanghai Bank</td><td>7021</td><td>Link / APM Payout</td><td>Thailand</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Standard Chartered Bank (Thai) PCL.</td><td>7022</td><td>Link / APM Payout</td><td>Thailand</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Land and Houses Bank Public Company Limited</td><td>7023</td><td>Link / APM Payout</td><td>Thailand</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Thai QR Payment</td><td>7071</td><td>Link / APM Payout</td><td>Thailand</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>USDT Crypto ERC20</td><td>7072</td><td>Link / APM Payout</td><td>Thailand</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>USDT Crypto BEP20</td><td>7073</td><td>Link / APM Payout</td><td>Thailand</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>UOB Bank</td><td>7088</td><td>APM Payout</td><td>Thailand</td><td><a data-mention href="#undefined">#undefined</a></td></tr><tr><td>TMBThanachart Bank</td><td>7089</td><td>APM Payout</td><td>Thailand</td><td><a data-mention href="#undefined">#undefined</a></td></tr><tr><td>Bank Central Asia</td><td>7024</td><td>Link / APM Payout</td><td>Indonesia</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Bank Negara Indonesia</td><td>7025</td><td>Link / APM Payout</td><td>Indonesia</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Bank Mandiri</td><td>7026</td><td>Link / APM Payout</td><td>Indonesia</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Bank Rakyat Indonesia</td><td>7027</td><td>Link / APM Payout</td><td>Indonesia</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Bank Artha Graha (Support VA Wallet Only)</td><td>7028</td><td>Link / APM Payout</td><td>Indonesia</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Bank Bukopin (Support VA Wallet Only)</td><td>7029</td><td>Link / APM Payout</td><td>Indonesia</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Bank Commonwealth (Support VA Wallet Only)</td><td>7030</td><td>Link / APM Payout</td><td>Indonesia</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Bank Danamon (Support VA Wallet Only)</td><td>7031</td><td>Link / APM Payout</td><td>Indonesia</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Bank Mega (Support VA Wallet Only)</td><td>7032</td><td>Link / APM Payout</td><td>Indonesia</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Bank Maspion (Support VA Wallet Only)</td><td>7033</td><td>Link / APM Payout</td><td>Indonesia</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Bank Mestika (Support VA Wallet Only)</td><td>7034</td><td>Link / APM Payout</td><td>Indonesia</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Bank Panin (Support VA Wallet Only)</td><td>7035</td><td>Link / APM Payout</td><td>Indonesia</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Bank Sumut (Support VA Wallet Only)</td><td>7036</td><td>Link / APM Payout</td><td>Indonesia</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Bank Sinar Mas (Support VA Wallet Only)</td><td>7037</td><td>Link / APM Payout</td><td>Indonesia</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Bank Btpn (Support VA Wallet Only)</td><td>7038</td><td>Link / APM Payout</td><td>Indonesia</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>CIMB Niaga (Support VA Wallet Only)</td><td>7039</td><td>Link / APM Payout</td><td>Indonesia</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>HSBC Indonesia (Support VA Wallet Only)</td><td>7040</td><td>Link / APM Payout</td><td>Indonesia</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Maybank /bii (Support VA Wallet Only)</td><td>7041</td><td>Link / APM Payout</td><td>Indonesia</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>OCBC Indonesia (Support VA Wallet Only)</td><td>7042</td><td>Link / APM Payout</td><td>Indonesia</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Bank Permata (Support VA Wallet Only)</td><td>7043</td><td>Link / APM Payout</td><td>Indonesia</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>UOB Indonesia (Support VA Wallet Only)</td><td>7044</td><td>Link / APM Payout</td><td>Indonesia</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Bank Negara Indonesia (VA)</td><td>7074</td><td>Link / APM Payout</td><td>Indonesia</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Bank Mandiri (VA)</td><td>7075</td><td>Link / APM Payout</td><td>Indonesia</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Bank Rakyat Indonesia (VA)</td><td>7076</td><td>Link / APM Payout</td><td>Indonesia</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Maybank Indonesia (VA)</td><td>7077</td><td>Link / APM Payout</td><td>Indonesia</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Bank Sahabat Sampoerna (VA)</td><td>7078</td><td>Link / APM Payout</td><td>Indonesia</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Bank Sinarmas (VA)</td><td>7079</td><td>Link / APM Payout</td><td>Indonesia</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>CIMB Niaga (VA)</td><td>7080</td><td>Link / APM Payout</td><td>Indonesia</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Bank Permata (VA)</td><td>7081</td><td>Link / APM Payout</td><td>Indonesia</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>USDT Crypto ERC20</td><td>7082</td><td>Link / APM Payout</td><td>Indonesia</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>USDT Crypto BEP20</td><td>7083</td><td>Link / APM Payout</td><td>Indonesia</td><td><a data-mention href="#link-request-example-for-certain-methods.-1">#link-request-example-for-certain-methods.-1</a><a data-mention href="#apm-payout-request-example-for-certain-methods.-1">#apm-payout-request-example-for-certain-methods.-1</a></td></tr><tr><td>Boleto</td><td>4011</td><td>Link</td><td>Brazil</td><td></td></tr><tr><td>Direct PIX</td><td>4012</td><td>Link</td><td>Brazil</td><td></td></tr><tr><td>Boleto Flash Itau</td><td>4013</td><td>Link</td><td>Brazil</td><td></td></tr><tr><td>SEPA Credit Transfer</td><td>6000</td><td>APM Payout</td><td>EU</td><td></td></tr><tr><td>SEPA Transfer</td><td>6001</td><td>Link</td><td>EU</td><td></td></tr><tr><td>BTC, Bitcoin</td><td>10100</td><td>Link</td><td>Worldwide</td><td><a href="#link-request-example-for-btc-10100">Link request example for BTC (10100)</a></td></tr></tbody></table>

APM Payments can be requested using the [Link](https://apidocs.global-solutions.io/broken-reference) API. When the Link API is requested, the corresponding APM Type ID must be supplied in the *paymentTypeId* field of the data object.&#x20;

#### Link request example for APM Test Payment (1)

```javascript
{
	"amount": 700,
	"accountId": "john@deer.com",
        "currency": "EUR",
	"description": "Payment for products",
	"invoiceId": "08072021-01",
	"successUrl": "https://example.com/success",
	"failureUrl": "https://example.com/failure",
        "pendingUrl": "https://example.com/pending",
        "cancelUrl": "https://example.com/cancel",
        "data": {
              "personId": "success@bank",
              "firstName": "John",
              "lastName": "Deer",
              "phone": "9555777666",
              "address": "Avishkar Ram Maruti Naupada 66 2",
              "paymentTypeId": 1
          }
}
```

#### Link request example for APM UPI Payment (2000)

```javascript
{
	"amount": 500,
	"accountId": "john@deer.com",
        "currency": "INR",
	"description": "Payment for products",
	"invoiceId": "08072021-01",
	"successUrl": "https://example.com/success",
	"failureUrl": "https://example.com/failure",
        "pendingUrl": "https://example.com/pending",
        "cancelUrl": "https://example.com/cancel",
        "data": {
              "personId": "success@bank",
              "firstName": "John",
              "lastName": "Deer",
              "phone": "9555777666",
              "address": "Avishkar Ram Maruti Naupada 66 2",
              "paymentTypeId": 2000
          }
}
```

#### Link request example for APM PhonePe Payment (2006)

```javascript
{
	"amount": 500,
	"accountId": "john@deer.com",
        "currency": "INR",
	"description": "Payment for products",
	"invoiceId": "08072021-01",
	"successUrl": "https://example.com/success",
	"failureUrl": "https://example.com/failure",
        "pendingUrl": "https://example.com/pending",
        "cancelUrl": "https://example.com/cancel",
        "data": {
              "firstName": "John",
              "lastName": "Deer",
              "phone": "9555777666",
              "address": "Avishkar Ram Maruti Naupada 66 2",
              "paymentTypeId": 2006
          }
}
```

#### Link request example for BTC (10100)

```json
{
  "amount": 0.00045,
  "currency": "BTC",
  "description": "Payment for products",
  "invoiceId": "11222344",
  "accountId": "user@email.net",
  "successUrl": "https://example.com/success",
  "failureUrl": "https://example.com/failure",
  "pendingUrl": "https://example.com/pending",
  "cancelUrl": "https://example.com/cancel",
  "ip": "10.10.10.10",
  "data": {
      "paymentTypeId":10100
    }
}
```

#### Link request example for APM Netbanking in India (2014)

```javascript
{
	"amount": 500,
	"accountId": "john@deer.com",
        "currency": "INR",
	"description": "Payment for products",
	"invoiceId": "08072021-01",
	"successUrl": "https://example.com/success",
	"failureUrl": "https://example.com/failure",
        "pendingUrl": "https://example.com/pending",
        "cancelUrl": "https://example.com/cancel",
        "data": {
              "firstName": "John",
              "lastName": "Deer",
              "phone": "9555777666",
              "address": "Avishkar Ram Maruti Naupada 66 2",
              "paymentTypeId": 2014
          }
}
```

#### Link request example for certain methods. (1)

```json
{
 "amount": 100000.00,
 "accountId": "john@deer.com",
 "currency": "THB",
 "description": "Payment for products",
 "invoiceId": "1928398740527",
 "name": "John Deer",
 "successUrl": "https://example.com/success",
 "failureUrl": "https://example.com/failure",
 "pendingUrl": "https://example.com/pending",
 "cancelUrl": "https://example.com/cancel",
 "data": {
            "firstName": "John",
            "lastName": "Deer",
            "paymentTypeId": 7022
        }
}
```

#### APM Payout request example for certain methods. (1)

```json
{
 "amount": 100000.00,
 "accountId": "john@deer.com",
 "currency": "THB",
 "description": "Payment for products",
 "invoiceId": "1928398740527",
 "name": "John Deer",
 "successUrl": "https://example.com/success",
 "failureUrl": "https://example.com/failure",
 "pendingUrl": "https://example.com/pending",
 "cancelUrl": "https://example.com/cancel",
 "data": {
            "firstName": "John",
            "lastName": "Deer",
            "bankAccountNumber":"1000000000000001",
            "paymentTypeId": 7022
        }
}
```

#### APM Payout request example for certain methods. (2)

```json
{
	"amount": 10002.00,
	"currency": "THB",
	"invoiceId": "16",
 	"name": "John Deer",
   	"successUrl": "https://example.com/success",
 	"failureUrl": "https://example.com/failure",
 	"pendingUrl": "https://example.com/pending",
 	"cancelUrl": "https://example.com/cancel",
	"data": {
            "bankAccountNumber": "0000012345864",
            "ifsc": "IFSC",
            "paymentTypeId": 7088
        }
}
```

#### Link request example for APM with list of available banks in India (2060)

```javascript
{
	"amount": 500,
	"accountId": "john@deer.com",
        "currency": "INR",
	"description": "Payment for products",
	"invoiceId": "08072021-01",
	"successUrl": "https://example.com/success",
	"failureUrl": "https://example.com/failure",
        "pendingUrl": "https://example.com/pending",
        "cancelUrl": "https://example.com/cancel",
        "data": {
              "firstName": "John",
              "lastName": "Deer",
              "phone": "9555777666",
              "address": "Avishkar Ram Maruti Naupada 66 2",
              "paymentTypeId": 2060
          }
}
```

#### Link Request Example for SEPA Transfer (6001)

```javascript
{
	"amount": 80.55,
	"accountId": "john@deer.com",
	"currency": "EUR",
	"description": "Payment for products",
	"invoiceId": "080720218279",
	"successUrl": "https://example.com/success",
	"failureUrl": "https://example.com/failure",
        "pendingUrl": "https://example.com/pending",
        "cancelUrl": "https://example.com/cancel",
        "data": {
              "firstName": "John",
              "lastName": "Deer",
              "phone": "7999383979",
              "address": "Prager Str 75 Tutzing Schleswig-Holstein",
              "paymentTypeId": 6001
          }
}
```

## APM Payout

<mark style="color:green;">`POST`</mark> `https://api.global-solutions.io/payments/apm/payout`

APM Payout include non-card transaction payouts. Goods examples of APM Payouts are payouts to e-wallets or bank accounts.

#### Headers

| Name          | Type   | Description               |
| ------------- | ------ | ------------------------- |
| Authorization | string | HTTP Basic Authentication |
| Content-Type  | string | application/json          |

#### Request Body

| Name        | Type   | Description                                                                                                     |
| ----------- | ------ | --------------------------------------------------------------------------------------------------------------- |
| amount      | number | Payout amount                                                                                                   |
| accountId   | string | Funds recipient e-mail address                                                                                  |
| currency    | string | Payout currency                                                                                                 |
| description | string | Payout description in text format                                                                               |
| invoiceId   | string | Order or invoice number                                                                                         |
| name        | string | Funds recipient name                                                                                            |
| data        | object | Additional data required for the payout processing. See request example for available fields in the data object |

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

```javascript
{
    "model": {
        "transactionId": 8432893,
        "amount": 700.0,
        "currency": "INR",
        "invoiceId": "08072021-01",
        "accountId": "john@deer.com",
        "name": "John Deer",
        "statusCode": 10,
        "status": "Created",
        "reasonCode": 0,
        "reason": "Approved"
    },
    "success": true,
    "message": null
}
```

{% endtab %}
{% endtabs %}

#### APM Payout example for APM Test Payout (2)

```javascript
{
	"amount": 10,
	"accountId": "john@deer.com",
	"currency": "EUR",
	"description": "Payment for products",
	"invoiceId": "1928398740527",
 	"name": "John Deer",
	"data": {
            "personId": "success@bank",
            "phone": "9555777666",
            "address": "Avishkar Ram Maruti Naupada 66 2",
            "paymentTypeId": 2
        }
}
```

#### APM Payout Testing credentials for APM Test Payout (2)

| personId      | Result                             |
| ------------- | ---------------------------------- |
| success\@bank | Successful payout test credentials |
| failure\@bank | Failed payout test credentials     |

#### APM Payout example for UPI (3020)

```javascript
{
	"amount": 700,
	"accountId": "john@deer.com",
        "currency": "INR",
	"description": "Payment for products",
	"invoiceId": "08072021-01",
        "name": "John Deer",
        "data": {
              "personId": "9555777666@upi",
              "phone": "9555777666",
              "address": "Avishkar Ram Maruti Naupada 66 2",
              "paymentTypeId": 3020
          }
}
```

#### APM Payout example to India bank account (3021)

```javascript
{
	"amount": 500,
	"accountId": "john@deer.com",
        "currency": "INR",
	"description": "Payment for products",
	"invoiceId": "08072021-01",
        "name": "John Deer",
        "data": {
              "personId": "24250100008333",
              "phone": "9555777666",
              "address": "Avishkar Ram Maruti Naupada 66 2",
              "paymentTypeId": 3021,
              "ifsc": "ABCD1234567"
          }
}
```

#### APM Payout request example for SEPA Credit Transfer (6000)

```javascript
{
	"amount": 10,
	"accountId": "john@deer.com",
	"currency": "EUR",
	"description": "Payment for products",
	"invoiceId": "1928398740527",
 	"name": "John Deer",
	"data": {
            "bankAccountNumber": "LT837500018004669430",
            "paymentTypeId": 6000
        }
}
```

APM Payout is asynchronous operation. After the payout is requested, the request is created and sent to the processing system. The payout execution time depends on the processing system.  When the payout is processed, the final status of the payout will be sent as a [Notification](https://apidocs.global-solutions.io/broken-reference).

## APM Refund

<mark style="color:green;">`POST`</mark> `https://api.odeonpay.com/payments/apm/refund`

The method to return the funds of successfully completed payment operation

#### Headers

| Name          | Type   | Description               |
| ------------- | ------ | ------------------------- |
| Authorization | string | HTTP Basic Authentication |
| Content-Type  | string | application/json          |

#### Request Body

| Name          | Type    | Description                                                  |
| ------------- | ------- | ------------------------------------------------------------ |
| transactionId | integer | Transaction ID of successfully completed payment transaction |
| amount        | number  | Refund amount                                                |

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

```javascript
{
    "model": {
        "transactionId": 8432893,
        "amount": 700.0,
        "currency": "INR",
        "invoiceId": "08072021-01",
        "accountId": "john@deer.com",
        "name": "John Deer",
        "statusCode": 10,
        "status": "Created",
        "reasonCode": 0,
        "reason": "Approved"
    },
    "success": true,
    "message": null
}
```

{% endtab %}
{% endtabs %}

#### Request example of the refund&#x20;

```javascript
{
    "transactionId": 8432820, 
    "amount": 700
}
```

APM Refund is asynchronous operations. After the refund is requested, the request is created and sent to the processing system. The refund execution time depends on the processing system.  When the refund is processed, the final status of the refund will be sent as a [Notification](https://apidocs.global-solutions.io/broken-reference).

## Notifications

Notification is an HTTP request from the system to your site. Similar requests are also called **callback** or **webhook**. The system provides notifications about successful and unsuccessful payments.

{% hint style="info" %}
Enabling and disabling notifications as well as setting addresses and notification formats is configured in Back Office.
{% endhint %}

### Payment Success

The Success notification is performed once a payment is successfully completed. It serves the purpose of information about a payment: the system sends a request to a merchant's website address with payment information, and the merchant's site has to register the fact of payment.

| Parameter         | Type    | Usage    | Description                                                                                    |
| ----------------- | ------- | -------- | ---------------------------------------------------------------------------------------------- |
| transactionId     | Integer | Required | Transaction number in the system                                                               |
| amount            | Number  | Required | Amount                                                                                         |
| currency          | String  | Required | Currency                                                                                       |
| dateTime          | String  | Required | Date and time                                                                                  |
| invoiceId         | String  | Optional | Invoice or order number                                                                        |
| accountId         | String  | Optional | Payer's identifier                                                                             |
| operationTypeCode | Integer | Required | Transaction operation code                                                                     |
| operationType     | String  | Required | Transaction operation ("Payment")                                                              |
| status            | String  | Required | Transaction status ("Completed")                                                               |
| statusCode        | Integer | Required | Transaction status code                                                                        |
| cardFirstSix      | String  | Required | Transaction Card PAN first 6 numbers                                                           |
| cardLastFour      | String  | Required | Transaction Card PAN last 4 numbers                                                            |
| cardType          | String  | Required | Card type (VISA, Mastercard, Amex)                                                             |
| cardExpDate       | String  | Required | Card expiry date in MM/YYYY format                                                             |
| name              | String  | Optional | Cardholder's name                                                                              |
| token             | String  | Optional | <p>Payment card's token. Returned only if accountId </p><p>was provided during the payment</p> |

### Payment Failure

In the event of a payment failure, the merchant is able to receive a notification with transaction details and failure explanation.

| Parameter         | Type    | Usage    | Description                          |
| ----------------- | ------- | -------- | ------------------------------------ |
| transactionId     | Integer | Required | Transaction number in the system     |
| amount            | Number  | Required | Amount                               |
| currency          | String  | Required | Currency                             |
| dateTime          | String  | Required | Date and time                        |
| invoiceId         | String  | Optional | Invoice or order number              |
| accountId         | String  | Optional | Payer's identifier                   |
| operationTypeCode | Integer | Required | Transaction operation code           |
| operationType     | String  | Required | Transaction operation ("Payment")    |
| status            | String  | Required | Transaction status ("Declined")      |
| statusCode        | Integer | Required | Transaction status code              |
| cardFirstSix      | String  | Required | Transaction Card PAN first 6 numbers |
| cardLastFour      | String  | Required | Transaction Card PAN last 4 numbers  |
| cardType          | String  | Required | Card type (VISA, Mastercard, Amex)   |
| cardExpDate       | String  | Required | Card expiry date in MM/YYYY format   |
| name              | String  | Optional | Cardholder's name                    |
| reason            | String  | Required | Transaction failure reason           |
| reasonCode        | Integer | Required | Transaction failure reason code      |

### Refund Success

The Refund Success notification is performed if a payment was refunded (fully or partially) on your initiative via the API or Back Office.

| Parameter            | Type    | Usage    | Description                                             |
| -------------------- | ------- | -------- | ------------------------------------------------------- |
| paymentTransactionId | Integer | Required | Transaction number of the initial payment in the system |
| transactionId        | Integer | Required | Refund transaction number in the system                 |
| amount               | Number  | Required | Refund amount                                           |
| currency             | String  | Required | Currency                                                |
| dateTime             | String  | Required | Date and time                                           |
| invoiceId            | String  | Optional | Invoice or order number                                 |
| accountId            | String  | Optional | Payer's identifier                                      |
| operationTypeCode    | Integer | Required | Transaction operation code                              |
| operationType        | String  | Required | Transaction operation ("Refund")                        |
| status               | String  | Required | Transaction status ("RefundCompleted")                  |
| statusCode           | Integer | Required | Transaction status code                                 |

### Refund Failure

The Refund Failure notification is performed if a payment refund request (full or partial) has failed.

| Parameter            | Type    | Usage    | Description                                             |
| -------------------- | ------- | -------- | ------------------------------------------------------- |
| paymentTransactionId | Integer | Required | Transaction number of the initial payment in the system |
| transactionId        | Integer | Required | Refund transaction number in the system                 |
| amount               | Number  | Required | Refund amount                                           |
| currency             | String  | Required | Currency                                                |
| dateTime             | String  | Required | Date and time                                           |
| invoiceId            | String  | Optional | Invoice or order number                                 |
| accountId            | String  | Optional | Payer's identifier                                      |
| operationTypeCode    | Integer | Required | Transaction Operation Code                              |
| operationType        | String  | Required | Transaction operation ("Refund")                        |
| status               | String  | Required | Transaction status ("Declined")                         |
| statusCode           | Integer | Required | Transaction status code                                 |
| reason               | String  | Required | Transaction failure reason                              |
| reasonCode           | Integer | Required | Transaction failure reason code                         |

### Payout Success

The Payout Success notification is performed if funds were paid out on your initiative via the API or Back Office.

| Parameter         | Type    | Usage    | Description                             |
| ----------------- | ------- | -------- | --------------------------------------- |
| transactionId     | Integer | Required | Payout transaction number in the system |
| amount            | Number  | Required | Payout amount                           |
| currency          | String  | Required | Currency                                |
| accountId         | String  | Required | Payer's identifier                      |
| invoiceId         | String  | Optional | Invoice or order number                 |
| dateTime          | String  | Required | Date and time                           |
| operationTypeCode | Integer | Required | Transaction operation code              |
| operationType     | String  | Required | Transaction operation ("CardPayout")    |
| status            | String  | Required | Transaction status ("PayoutCompleted")  |
| statusCode        | Integer | Required | Transaction status code                 |

### Payout Failure

The Payout Failure notification is performed if funds payout request has failed.

| Parameter         | Type    | Usage    | Description                             |
| ----------------- | ------- | -------- | --------------------------------------- |
| transactionId     | Integer | Required | Payout transaction number in the system |
| amount            | Number  | Required | Payout amount                           |
| currency          | String  | Required | Currency                                |
| accountId         | String  | Required | Payer's identifier                      |
| invoiceId         | String  | Optional | Invoice or order number                 |
| dateTime          | String  | Required | Date and time                           |
| operationTypeCode | Integer | Required | Transaction operation code              |
| operationType     | String  | Required | Transaction operation ("CardPayout")    |
| status            | String  | Required | Transaction status ("Declined")         |
| statusCode        | Integer | Required | Transaction status code                 |
| reason            | String  | Required | Transaction failure reason              |
| reasonCode        | Integer | Required | Transaction failure reason code         |

### Payment Check

The Payment Check notification is performed once a cardholder filled in a payment form and pressed the “Pay” button. It serves the purpose of payment validation: the system sends a request to a merchant's website address with payment information, and the website must validate and reply back if the payment has to be confirmed or rejected.

| Parameter         | Type    | Usage    | Description                              |
| ----------------- | ------- | -------- | ---------------------------------------- |
| transactionId     | Integer | Required | Payment transaction number in the system |
| amount            | Number  | Required | Payment amount                           |
| currency          | String  | Required | Payment currency                         |
| dateTime          | String  | Required | Date and time                            |
| invoiceId         | String  | Required | Invoice or order number                  |
| accountId         | String  | Required | Payer's identifier                       |
| name              | String  | Required | Cardholder's name                        |
| operationTypeCode | Integer | Required | Transaction operation code               |
| operationType     | String  | Required | Transaction operation ("Payment")        |
| cardFirstSix      | String  | Required | Transaction Card PAN first 6 numbers     |
| cardLastFour      | String  | Required | Transaction Card PAN last 4 numbers      |
| cardType          | String  | Required | Card type (VISA, Mastercard, Amex)       |
| cardExpDate       | String  | Required | Card expiry date in MM/YYYY format       |
| status            | String  | Required | Transaction status ("Created")           |
| statusCode        | Integer | Required | Transaction status code                  |

Payment Check notifications expects **HTTP status** **200** with response in JSON format with the required parameter **code**:

```javascript
{"code":0}
```

#### Response codes

Payment Check notification expects the code value **"0"** in order to proceed with the payment. Any other numeric value received with the response will reject the payment processing.

### Notification confirmation

{% hint style="success" %}
The system expects the 200 HTTP response in JSON format with the required parameter **code** equal to **0**
{% endhint %}

| Parameter | Type    | Description                    |
| --------- | ------- | ------------------------------ |
| code      | Integer | Notification confirmation code |

**Notification confirmation example**

```javascript
{"code":0}
```

In case the System didn't receive the mentioned success code, notification sending will be repeated 5 times.

### Notification validation

All the notifications have the **Content-HMAC** HTTP header which contains a validation value of a request which is calculated using the [**HMAC**](https://en.wikipedia.org/wiki/HMAC) algorithm. If you need to verify authenticity and integrity of notifications, you can calculate a validation value on your side and compare it with the request value. The coincidence confirms that you received the notification we sent in the original form.

* For notifications sent by POST method the message is represented by a request body.&#x20;
* Hash is calculated by SHA256 function;&#x20;
* The secret API is used as a key, which can be obtained in your Back Office;&#x20;
* The calculated value is passed in base64 encoding.

#### HMAC value calculation and encoding example

```php
<?php
    $data = '{"transactionId":512,"amount":30.45,"currency":"EUR"}';
    $secret = '1234ABCD';
    $hmac_data = hash_hmac('sha256', $data, $secret);
    $hmac_content = base64_encode($hmac_data);
    echo $hmac_content;
?>
```

Output result:

```
MzVkMzBlMTdmMmVkNGJkNjFhMzFmNTdhODU0ZGQwZTYwZGU5MDg5MDRiODYyMTAzZmI0ZDAzMjRiMWJmNmM3Mw==
```

The system sends notifications from the following address **34.77.206.110.**

## Testing

Once you have an access to Back Office, it is in a test mode already which means that payments and other operations will take place in emulation mode. After you create a site in Back Office, it is automatically assigned a test mode.

### Cards for Payment Operation tests

| Card             | Expiry | CVV     | 3-D Secure | Schema   | Result  |
| ---------------- | ------ | ------- | ---------- | -------- | ------- |
| 4111111111111111 | 12/24  | **123** | Yes        | Advanced | Success |
| 4111111111111111 | 12/24  | **333** | Yes        | Advanced | Failure |
| 4200000000000000 | 12/24  | **123** | Yes        | Redirect | Success |
| 4200000000000000 | 12/24  | **333** | Yes        | Redirect | Failure |
| 4242424242424242 | 12/24  | **123** | No         | None     | Success |
| 4242424242424242 | 12/24  | **333** | No         | None     | Failure |

{% hint style="info" %}
Type in "4" as the 3-D Secure passphrase&#x20;
{% endhint %}

### Cards for Refund Operation tests

| Card             | Result          | Description                                                                                                    |
| ---------------- | --------------- | -------------------------------------------------------------------------------------------------------------- |
| 4242424242424242 | RefundCompleted | Successful refund (full or partial)                                                                            |
| 4111111111111111 | Declined        | All refund requests to this card will be declined by the system                                                |
| 4200000000000000 | Created         | Refund request will be created, but not processed further until the result is received from the acquiring bank |

### Cards for Card Payout Operation tests

| Card             | Result          | Description                                                                                                    |
| ---------------- | --------------- | -------------------------------------------------------------------------------------------------------------- |
| 4242424242424242 | PayoutCompleted | Successful payout to a card                                                                                    |
| 4111111111111111 | Declined        | All payout requests to this card will be declined by the system                                                |
| 4200000000000000 | Created         | Payout request will be created, but not processed further until the result is received from the acquiring bank |

## Dictionaries

### Transaction Status

| ID | Status                 | Description                               |
| -- | ---------------------- | ----------------------------------------- |
| 1  | AwaitingAuthentication | Waiting for 3-D Secure authentication     |
| 4  | Completed              | Payment transaction successful completion |
| 5  | RefundCompleted        | Refund transaction successful completion  |
| 7  | PayoutCompleted        | Payout transaction successful completion  |
| 10 | Created                | Transaction has been created              |
| 99 | Declined               | Transaction processing failure            |

### Transaction Operations

| ID | Operation  | Description                                                                                 |
| -- | ---------- | ------------------------------------------------------------------------------------------- |
| 1  | Payment    | Transaction operation when funds are charged from the credit card                           |
| 2  | Refund     | Operation when funds are returned back to a credit card after the initial Payment operation |
| 3  | CardPayout | Operation when the funds are paid out to a credit card                                      |

### Timezones

| Timezone             | Description |
| -------------------- | ----------- |
| Pacific/Samoa        | GMT-11:00   |
| US/Hawaii            | GMT-10:00   |
| US/Alaska            | GMT-09:00   |
| America/Los\_Angeles | GMT-08:00   |
| US/Arizona           | GMT-07:00   |
| America/Mexico\_City | GMT-06:00   |
| US/East-Indiana      | GMT-05:00   |
| Atlantic/Bermuda     | GMT-04:00   |
| America/Santiago     | GMT-03:00   |
| America/Noronha      | GMT-02:00   |
| Atlantic/Azores      | GMT-01:00   |
| Europe/London        | GMT+00:00   |
| Europe/Paris         | GMT+01:00   |
| Europe/Riga          | GMT+02:00   |
| Europe/Kyiv          | GMT+03:00   |
| Asia/Tbilisi         | GMT+04:00   |
| Asia/Tashkent        | GMT+05:00   |
| Asia/Colombo         | GMT+06:00   |
| Asia/Bangkok         | GMT+07:00   |
| Asia/Shanghai        | GMT+08:00   |
| Asia/Tokyo           | GMT+09:00   |
| Australia/Sydney     | GMT+10:00   |
| Pacific/Guadalcanal  | GMT+11:00   |
