POST /v1.1/online-payments/button

 

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 to this payment button. Available accounts can be received from Settlement Data.

currency

String

Mandatory

Currency in which is related to 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. It's in format 'XX'. 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.
button_size
Number Mandatory

Small = 0

Big = 1

ask_for_customer_name
Boolean Optional

Require customer name on the payment page.

ask_for_shipping_address
Boolean Optional

Require shipping address on the payment page.

ask_for_customer_email
Boolean Optional

Require customer email on the payment page.

ask_for_customer_phone
Boolean Optional

Require customer phone on the payment page.

cancel_url
String Optional

Customer will be redirected on this address when cancel request is executed.

return_url
String Optional

Customer will be redirected on this address when return request is executed.

  

 

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/button' \
-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":"EUR",
	"account_number":"",
	"custom_name":"Example Button",
	"quantity":1,
	"website":"http://myspos.eu",
	"send_sms":true,
	"send_email":true,
	"button_size":1,
	"ask_for_customer_name":true,
	"ask_for_shipping_address":true,
	"ask_for_customer_email":true,
	"ask_for_customer_phone":true,
	"cancel_url":"http://mypos.eu/cancel",
	"return_url":"http://mypos.eu/return"
}'
import requests

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

payload = "{\n\t\"item_name\":\"Example Item\",\n\t\"item_price\":3.43,\n\t\"pref_language\": \"EN\",\n\t\"currency\":\"EUR\",\n\t\"account_number\":\"\",\n\t\"custom_name\":\"Example Button\",\n\t\"quantity\":1,\n\t\"website\":\"http://myspos.eu\",\n\t\"send_sms\":true,\n\t\"send_email\":true,\n\t\"button_size\":1,\n\t\"ask_for_customer_name\":true,\n\t\"ask_for_shipping_address\":true,\n\t\"ask_for_customer_email\":true,\n\t\"ask_for_customer_phone\":true,\n\t\"cancel_url\":\"http://mypos.eu/cancel\",\n\t\"return_url\":\"http://mypos.eu/return\"\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/button',
  '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":"EN","currency":"EUR","account_number":"","custom_name":"Example Button","quantity":1,"website":"http://myspos.eu","send_sms":true,"send_email":true,"button_size":1,"ask_for_customer_name":true,"ask_for_shipping_address":true,"ask_for_customer_email":true,"ask_for_customer_phone":true,"cancel_url":"http://mypos.eu/cancel","return_url":"http://mypos.eu/return"})

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

});
<?php

$request = new HttpRequest();
$request->setUrl('https://transactions-api.mypos.com/v1.1/online-payments/button');
$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": "EN",\n	"currency":"EUR",\n	"account_number":"",\n	"custom_name":"Example Button",\n	"quantity":1,\n	"website":"http://myspos.eu",\n	"send_sms":true,\n	"send_email":true,\n	"button_size":1,\n	"ask_for_customer_name":true,\n	"ask_for_shipping_address":true,\n	"ask_for_customer_email":true,\n	"ask_for_customer_phone":true,\n	"cancel_url":"http://mypos.eu/cancel",\n	"return_url":"http://mypos.eu/return"\n}');

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

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

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