POST /v1.1/online-payments/link

 

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

Attribute

Type

Condition

Description

item_name

String

Mandatory

Item name.

item_price

Decimal

Mandatory

Price of a single item. Separator is '.'.

account_number

String

Optional

Account number which is related with this payment button. Available accounts can be received from Settlement Data.

currency

String

Mandatory

Currency in which is related with this payment button. Currency must be connected with some of the existing accounts (Settlement Data).

pref_language

String

Optional

Preferred language of the payment button. Available languages could be received from Languages 

Default value: The preferred language of the user, if it's empty default language is EN.

custom_name

String

Mandatory

 Payment button name.
quantity
Number Mandatory  Items quantity. Value must be at least 1.
website
String Optional Website address.
send_sms
Boolean Optional Receiving SMS when a purchase is processed.
send_email
Boolean Optional Receiving email when a purchase is processed.
ask_for_customer_name
Boolean Optional Require customer name on the payment page.
hide_quantity Boolean Optional Quantity should be hidden for Customer.
expired_date String Optional Date until this payment link will be active. Format is: YYYY-MM-DD

  

 

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

url

String

Mandatory

Url address of created payment button.

 

 

Examples

curl -L -X POST 'https://transactions-api.mypos.com/v1.1/online-payments/link' \
-H 'API-Key: MY_API_KEY' \
-H 'X-Request-ID: 232465ab-66ea-4776-b3f0-f7a123f988e4' \
-H 'Authorization: Bearer PLpC1CqVE9CYXolbGNBPqz0NYy8asFzG95XcToDsMP' \
-H 'Content-Type: application/json' \
--data-raw '{
	"item_name":"Example Item",
	"item_price":3.43,
        "pref_language": "EN",
	"currency":"GBP",
        "account_number":"",
	"custom_name":"Payment Link",
	"quantity":2,
	"website":"http://mypos.eu",
	"send_sms":true,
	"send_email":true,
	"ask_for_customer_name":true,
	"hide_quantity":true,
	"expired_date":"2020-10-25"
}'
import requests

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

payload = "{\n\t\"item_name\":\"Example Item\",\n\t\"item_price\":3.43,\n\t \"pref_language\": \"BG\",\n\t\"currency\":\"GBP\",\n\t\ "account_number\":\"\",\n\t\"custom_name\":\"Payment Link\",\n\t\"quantity\":2,\n\t\"website\":\"http://mypos.eu\",\n\t\"send_sms\":true,\n\t\"send_email\":true,\n\t\"ask_for_customer_name\":true,\n\t\"hide_quantity\":true,\n\t\"expired_date\":\"2020-10-25\"\n}"
headers = {
  'API-Key': 'MY_API_KEY',
  'X-Request-ID': '232465ab-66ea-4776-b3f0-f7a123f988e4',
  'Authorization': 'Bearer PLpC1CqVE9CYXolbGNBPqz0NYy8asFzG95XcToDsMP',
  'Content-Type': 'application/json'
}

requests.request("POST", url, headers=headers, data = payload)
const request = require('request');
const options = {
  'method': 'POST',
  'url': 'https://transactions-api.mypos.com//v1.1/online-payments/link',
  'headers': {
    'API-Key': 'MY_API_KEY',
    'X-Request-ID': '232465ab-66ea-4776-b3f0-f7a123f988e4',
    'Authorization': 'Bearer PLpC1CqVE9CYXolbGNBPqz0NYy8asFzG95XcToDsMP',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({"item_name":"Example Item","item_price":3.43,"pref_language":"BG","currency":"GBP","account_number":"","custom_name":"Payment Link","quantity":2,"website":"http://mypos.eu","send_sms":true,"send_email":true,"ask_for_customer_name":true,"hide_quantity":true,"expired_date":"2020-10-25"})

};
request(options, (error, response, body) => {

});
<?php

$request = new HttpRequest();
$request->setUrl('https://transactions-api.mypos.com/v1.1/online-payments/link');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Authorization' => 'Bearer PLpC1CqVE9CYXolbGNBPqz0NYy8asFzG95XcToDsMP',
  'Content-Type' => 'application/json',
  'API-Key' => 'MY_API_KEY',
  'X-Request-ID' => '232465ab-66ea-4776-b3f0-f7a123f988e4'
));

$request->setBody('{\n	"item_name":"Example Item",\n	"item_price":3.43,\n    "pref_language": "BG",\n	"currency":"GBP",\n    "account_number":"",\n	"custom_name":"Payment Link",\n	"quantity":2,\n	"website":"http://mypos.eu",\n	"send_sms":true,\n	"send_email":true,\n	"ask_for_customer_name":true,\n	"hide_quantity":true,\n	"expired_date":"2020-10-25"\n}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

{
    "url": "https://mypos.com/vmp/btn/BPYCO5XTQXK40"
}