PATCH /v1.1/online-payments/button/<code>
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 |
Path parameters
Attribute | Type | Condition | Description |
code | String | Mandatory | Unique payment button code. |
Request Body
Attribute | Type | Condition | Description |
pref_lang
|
String | Optional | Preferred language of the payment button. It's in format 'XX'. Available languages could be received from Languages |
custom_name
|
String | Optional | Payment button name. |
send_sms
|
Boolean | Optional | Receiving SMS when a purchase is processed. |
sens_email
|
Boolean | Optional | Receiving email when a purchase is processed. |
ask_for_customer_name
|
Boolean | Optional | Require customer name on the payment page. |
ask_for_customer_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_number
|
Boolean | Optional | Require customer phone on the payment page. |
website
|
String | Optional | Website address. |
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. |
button_size
|
Number | Optional |
Small = 0 Big = 1 |
enable
|
Boolean | Optional | Flag that provides information if this button is currently enabled or disabled. |
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 |
- |
Payment Button Details |
Mandatory |
Fields with details for this payment button. |
Examples
curl -L -X PATCH 'https://transactions-api.mypos.com/v1.1/online-payments/button/BPYCO5XTQXK40' \
-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 '{
"pref_lang":"EN",
"custom_name":"Payment Button Edited",
"send_sms":false,
"send_email":false,
"ask_for_customer_name":false,
"ask_for_customer_shipping_address":false,
"ask_for_customer_email":false,
"ask_for_customer_phone_number":false,
"website":"http://mypos-edit.eu",
"cancel_url":"http://mypos-cancel-edit.eu",
"return_url":"http://mypos-return-edit.eu",
"button_size":0,
"enable":true
}'
import requests
url = "https://transactions-api.mypos.com/v1.1/online-payments/button/BPYCO5XTQXK40"
payload = "{\n\t\"pref_lang\":\"EN\",\n\t\"custom_name\":\"Payment Button Edited\",\n\t\"send_sms\":false,\n\t\"send_email\":false,\n\t\"ask_for_customer_name\":false,\n\t\"ask_for_customer_shipping_address\":false,\n\t\"ask_for_customer_email\":false,\n\t\"ask_for_customer_phone_number\":false,\n\t\"website\":\"http://mypos-edit.eu\",\n\t\"cancel_url\":\"http://mypos-cancel-edit.eu\",\n\t\"return_url\":\"http://mypos-return-edit.eu\",\n\t\"button_size\":0,\n\t\"enable\":true\n}"
headers = {
'API-Key': 'MY_API_KEY',
'X-Request-ID': '232465ab-66ea-4776-b3f0-f7a123f988e4',
'Authorization': 'Bearer PLpC1CqVE9CYXolbGNBPqz0NYy8asFzG95XcToDsMP',
'Content-Type': 'application/json'
}
requests.request("PATCH", url, headers=headers, data = payload)
const request = require('request');
const options = {
'method': 'PATCH',
'url': 'https://transactions-api.mypos.com/v1.1/online-payments/button/BPYCO5XTQXK40',
'headers': {
'API-Key': 'MY_API_KEY',
'X-Request-ID': '232465ab-66ea-4776-b3f0-f7a123f988e4',
'Authorization': 'Bearer PLpC1CqVE9CYXolbGNBPqz0NYy8asFzG95XcToDsMP',
'Content-Type': 'application/json'
},
body: JSON.stringify({"pref_lang":"EN","custom_name":"Payment Button Edited","send_sms":false,"send_email":false,"ask_for_customer_name":false,"ask_for_customer_shipping_address":false,"ask_for_customer_email":false,"ask_for_customer_phone_number":false,"website":"http://mypos-edit.eu","cancel_url":"http://mypos-cancel-edit.eu","return_url":"http://mypos-return-edit.eu","button_size":0,"enable":true})
};
request(options, (error, response) => {
});
<?php
$request = new HttpRequest();
$request->setUrl('https://transactions-api.mypos.com/v1.1/online-payments/button/BPYCO5XTQXK40');
$request->setMethod('PATCH');
$request->setHeaders(array(
'Authorization' => 'Bearer PLpC1CqVE9CYXolbGNBPqz0NYy8asFzG95XcToDsMP',
'API-Key' => 'MY_API_KEY',
'X-Request-ID' => '232465ab-66ea-4776-b3f0-f7a123f988e4',
'Content-Type' => 'application/json'
));
$request->setBody('{\n "pref_lang":"EN",\n "custom_name":"Payment Button Edited",\n "send_sms":false,\n "send_email":false,\n "ask_for_customer_name":false,\n "ask_for_customer_shipping_address":false,\n "ask_for_customer_email":false,\n "ask_for_customer_phone_number":false,\n "website":"http://mypos-edit.eu",\n "cancel_url":"http://mypos-cancel-edit.eu",\n "return_url":"http://mypos-return-edit.eu",\n "button_size":0,\n "enable":true\n}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
{
"created_on": "2020-09-14 18:02:34",
"code": "BPYCO5XTQXK40",
"url": "https://mypos.eu/vmp/btn/BPYCO5XTQXK40",
"custom_name": "Payment Button Edited",
"item_name": "API Button",
"enable": true,
"item_price": 3.43,
"total_amount": 6.86,
"quantity": 2,
"button_size": 1,
"send_sms": false,
"send_email": true,
"ask_for_customer_name": false,
"ask_for_shipping_address": false,
"ask_for_customer_email": false,
"ask_for_customer_phone_number": false,
"currency": "EUR",
"pref_language": "EN",
"website": "http://mypos-edit.eu",
"cancel_url": "",
"return_url": "",
"account_number": "50767683555"
}