POST /v1.1/online-payments/payment-request

 

Request headers

Attribute

Type

Condition

Description

X-Request-ID

UUID

Mandatory

ID of the request, unique to the call.

Authorization

String

Mandatory

The oAuth2 Bearer token

API-Key

String

Mandatory

The Client ID obtained from the myPOS Account

 

 

Request Body for Payment Request with QR code

Attribute

Type

Condition

Description

qr_generated

Boolean

Mandatory

The value should be true if you want the PR to be paid only via QR code.

amount

Decimal

Mandatory

The amount to be paid by the client. Separator is '.'.

currency

String

Mandatory

The currency, related to this payment request. Currency must be connected with some of the existing accounts (Settlement Data).

 

Request Body for normal Payment Request

Attribute

Type

Condition

Description

qr_generated

Boolean

Mandatory

The value should be false if you want to generate a normal Payment Request.

amount

Decimal

Mandatory

The amount to be paid by the client. Separator is '.'.

currency

String

Mandatory

The currency, related to this payment request. Currency must be connected with some of the existing accounts (Settlement Data).

client_name

String

Mandatory

The name of the client to whom the payment request will be sent.

reason

String

Optional

A message shown to the client with the reason for the requested payment.
booking_text String Optional Custom name of the payment request as seen in the myPOS account.
dba String Optional The doing business as field will be shown in the client's bank statement to whom he has paid.
expired_date String Optional Date until this payment link will be active. Format is: YYYY-MM-DD
payment_request_lang String Mandatory Preferred language of the payment request. Available languages could be received from Languages 

Default value: The preferred language of the user, if it's empty default language is EN.
notify_gsm String Optional Select the number which will receive an SMS when the payment is processed.

  

 

Response headers

Attribute

Type

Condition

Description

X-Request-ID

UUID

Mandatory

ID of the request, unique to the call.

Content-Type

String

Mandatory

application/json

 

 

Response body

Attribute

Type

Condition

Description

code

String

Mandatory

The code of the payment request.

payment_request_url

String

Mandatory

Url address of created payment request.

 

 

Examples

curl --location --request POST 'https://transactions-api.mypos.com/v1.1/online-payments/payment-request' \
--header 'API-Key: 3BGhoZRT74YmE2MThfEhlwUt' \
--header 'X-Request-ID: 232465ab-66ea-4776-b3f0-f7a123f988e4' \
--header 'Authorization: Bearer UXzhB6yLksE93HllhiLXODcVuwzFu5Xi1b6QDBQxpT' \
--header 'Content-Type: application/json' \
--data-raw '{
    "qr_generated": false,
    "amount": 2.14,
    "currency": "EUR",
    "client_name": "My client",
    "reason": "Payment Request Reason",
    "booking_text": "Booking Text",
    "expiry_date": "2023-12-28",
    "payment_request_lang": "en"
}'
import requests

url = "https://transactions-api.mypos.com/v1.1/online-payments/payment-request"

payload="{\r\n    \"qr_generated\": false,\r\n    \"amount\": 2.14,\r\n    \"currency\": \"EUR\",\r\n    \"client_name\": \"My Client\",\r\n    \"reason\": \"Payment Request Reason\",\r\n    \"booking_text\": \"Booking Text",\r\n    \"dba\": \"\",\r\n    \"expiry_date\": \"2021-04-16\",\r\n    \"payment_request_lang\": \"en\",\r\n    \"notify_gsm\": \"+359899999999\"\r\n}"
headers = {
  'API-Key': 'MY_API_KEY',
  'X-Request-ID': '232465ab-66ea-4776-b3f0-f7a123f988e4',
  'Authorization': 'Bearer PLpC1CqVE9CYXolbGNBPqz0NYy8asFzG95XcToDsMP',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://transactions-api.mypos.com/v1.1/online-payments/payment-request',
  'headers': {
    'API-Key': 'MY_API_KEY',
    'X-Request-ID': '11',
    'Authorization': 'Bearer HU0IlgkXm33Qule2FCik6elo3sNj6s5QHoLGsP6YMx',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({"qr_generated":false,"amount":2.14,"currency":"EUR","client_name":"My client","reason":"Payment Request Reason","booking_text":"Booking Text","dba":"","expiry_date":"2021-04-16","payment_request_lang":"ен","notify_gsm":"+359899999999"})

};
request(options, function (error, response) {

});

<?php

require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://transactions-api.mypos.com/v1.1/online-payments/payment-request');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'API-Key' => 'MY_API_KEY',
  'X-Request-ID' => '232465ab-66ea-4776-b3f0-f7a123f988e4',
  'Authorization' => 'Bearer PLpC1CqVE9CYXolbGNBPqz0NYy8asFzG95XcToDsMP',
  'Content-Type' => 'application/json'
));
$request->setBody('{
\n    "qr_generated": false,
\n    "amount": 2.14,
\n    "currency": "EUR",
\n    "client_name": "My client",
\n    "reason": "Payment Request Reason",
\n    "booking_text": "Booking Text",
\n    "dba": "",
\n    "expiry_date": "2021-04-16",
\n    "payment_request_lang": "en",
\n    "notify_gsm": "+359899999999"
\n}');
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}

	
{
    "code": "BCYJC59SJRTS59",
    "payment_request_url": "https://mypos.com/pr/BCYJC59SJRTS59"
}