curl --request POST \
--url https://api.m4psp.com/gateway/v1/invoice/check \
--header 'Content-Type: application/json' \
--data '
{
"shop_order_id": "5b0efa8a-153b-4421-abac-2aba4d772a86",
"shop_id": 1520,
"now": "2026-05-24T16:35:42"
}
'import requests
url = "https://api.m4psp.com/gateway/v1/invoice/check"
payload = {
"shop_order_id": "5b0efa8a-153b-4421-abac-2aba4d772a86",
"shop_id": 1520,
"now": "2026-05-24T16:35:42"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
shop_order_id: '5b0efa8a-153b-4421-abac-2aba4d772a86',
shop_id: 1520,
now: '2026-05-24T16:35:42'
})
};
fetch('https://api.m4psp.com/gateway/v1/invoice/check', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.m4psp.com/gateway/v1/invoice/check",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'shop_order_id' => '5b0efa8a-153b-4421-abac-2aba4d772a86',
'shop_id' => 1520,
'now' => '2026-05-24T16:35:42'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.m4psp.com/gateway/v1/invoice/check"
payload := strings.NewReader("{\n \"shop_order_id\": \"5b0efa8a-153b-4421-abac-2aba4d772a86\",\n \"shop_id\": 1520,\n \"now\": \"2026-05-24T16:35:42\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.m4psp.com/gateway/v1/invoice/check")
.header("Content-Type", "application/json")
.body("{\n \"shop_order_id\": \"5b0efa8a-153b-4421-abac-2aba4d772a86\",\n \"shop_id\": 1520,\n \"now\": \"2026-05-24T16:35:42\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.m4psp.com/gateway/v1/invoice/check")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"shop_order_id\": \"5b0efa8a-153b-4421-abac-2aba4d772a86\",\n \"shop_id\": 1520,\n \"now\": \"2026-05-24T16:35:42\"\n}"
response = http.request(request)
puts response.read_body{
"result": true,
"message": "Ok",
"error_code": 0,
"data": {
"shop_order_id": "5b0efa8a-153b-4421-abac-2aba4d772a86",
"shop_id": 1520,
"status": 2,
"payment_id": 12,
"ps_data": "{\"ps_payer_account\": \"412103XXXXXX7701\", \"bill_id\": \"7766\", \"amount\": \"190.99\", \"status\": \"success\"}",
"ps_currency": 840,
"payway": "<string>",
"description": "Invoice for shop_id=1520",
"created": "2026-05-24T16:35:42",
"updated": "2026-04-21T20:09:02",
"processed": "2026-05-24T16:35:42",
"shop_currency": 840,
"shop_amount": 359.01,
"client_price": 365,
"error_code": 0,
"shop_refund": 104,
"settlement_currency": 840,
"settlement_rate": null,
"expires_at": "2026-01-01T03:00:00+03:00",
"is_unique": true,
"payment_token": {
"token": "980fba62-94d9-4489-bf4c-75b43eecf134",
"status": "SUCCESS",
"expires_at": "2026-04-21T20:07:02",
"account": "412103XXXXXX7701",
"card_info": {
"issuing_country": "GBR",
"issuing_bank": "Example Bank",
"payment_system": "MASTERCARD",
"funding_source": "DEBIT",
"payment_system_product": "PLATINUM"
}
}
}
}Issued invoice status request
To get the status and up-to-date information regarding issued invoice.
Fields involved in request signature generation:
nowshop_idshop_order_id
curl --request POST \
--url https://api.m4psp.com/gateway/v1/invoice/check \
--header 'Content-Type: application/json' \
--data '
{
"shop_order_id": "5b0efa8a-153b-4421-abac-2aba4d772a86",
"shop_id": 1520,
"now": "2026-05-24T16:35:42"
}
'import requests
url = "https://api.m4psp.com/gateway/v1/invoice/check"
payload = {
"shop_order_id": "5b0efa8a-153b-4421-abac-2aba4d772a86",
"shop_id": 1520,
"now": "2026-05-24T16:35:42"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
shop_order_id: '5b0efa8a-153b-4421-abac-2aba4d772a86',
shop_id: 1520,
now: '2026-05-24T16:35:42'
})
};
fetch('https://api.m4psp.com/gateway/v1/invoice/check', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.m4psp.com/gateway/v1/invoice/check",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'shop_order_id' => '5b0efa8a-153b-4421-abac-2aba4d772a86',
'shop_id' => 1520,
'now' => '2026-05-24T16:35:42'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.m4psp.com/gateway/v1/invoice/check"
payload := strings.NewReader("{\n \"shop_order_id\": \"5b0efa8a-153b-4421-abac-2aba4d772a86\",\n \"shop_id\": 1520,\n \"now\": \"2026-05-24T16:35:42\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.m4psp.com/gateway/v1/invoice/check")
.header("Content-Type", "application/json")
.body("{\n \"shop_order_id\": \"5b0efa8a-153b-4421-abac-2aba4d772a86\",\n \"shop_id\": 1520,\n \"now\": \"2026-05-24T16:35:42\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.m4psp.com/gateway/v1/invoice/check")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"shop_order_id\": \"5b0efa8a-153b-4421-abac-2aba4d772a86\",\n \"shop_id\": 1520,\n \"now\": \"2026-05-24T16:35:42\"\n}"
response = http.request(request)
puts response.read_body{
"result": true,
"message": "Ok",
"error_code": 0,
"data": {
"shop_order_id": "5b0efa8a-153b-4421-abac-2aba4d772a86",
"shop_id": 1520,
"status": 2,
"payment_id": 12,
"ps_data": "{\"ps_payer_account\": \"412103XXXXXX7701\", \"bill_id\": \"7766\", \"amount\": \"190.99\", \"status\": \"success\"}",
"ps_currency": 840,
"payway": "<string>",
"description": "Invoice for shop_id=1520",
"created": "2026-05-24T16:35:42",
"updated": "2026-04-21T20:09:02",
"processed": "2026-05-24T16:35:42",
"shop_currency": 840,
"shop_amount": 359.01,
"client_price": 365,
"error_code": 0,
"shop_refund": 104,
"settlement_currency": 840,
"settlement_rate": null,
"expires_at": "2026-01-01T03:00:00+03:00",
"is_unique": true,
"payment_token": {
"token": "980fba62-94d9-4489-bf4c-75b43eecf134",
"status": "SUCCESS",
"expires_at": "2026-04-21T20:07:02",
"account": "412103XXXXXX7701",
"card_info": {
"issuing_country": "GBR",
"issuing_bank": "Example Bank",
"payment_system": "MASTERCARD",
"funding_source": "DEBIT",
"payment_system_product": "PLATINUM"
}
}
}
}Authorizations
Every API request must be signed so that we can identify your account.
The signature is transferred in the request body through the sign parameter, for example:
{
"shop_id": 1520,
"shop_order_id" : "5b0efa8a-153b-4421-abac-2aba4d772a86",
"amout": "6320.91",
"currency": 840,
"payway": "card_invoice_usd",
"description": "Payment for shop_id=1520",
"sign": "77a6f7a30876d480d4e771d08cb83800dd5cb874664c77e515ffc052b20293c6"
}
"sign" parameter, nevertheless your real requests must include it in the request body where required.
Signature line is generated according to the following algorithm: all request parameters involved in signature generation are ordered in the alphabetical order of keys, the values are concatenated with a colon (":") and the account secret key is added at the end (without the: sign), a sha256 hash is generated from the resulting line and its hex representation is passed in the sign request parameter.
Example of signature generation for a method invoice/create:
- Determining the list of parameters. It looks as follows for the method in consideration:
Fields involved in request signature generation:
shop_idshop_order_idamountcurrencypayway
- Let's sort keys in alphabetical sequence:
"amount", "currency", "payway", "shop_id", "shop_order_id"
- The line for generating the SHA256 hash will be as follows:
"6320.91:840:card_invoice_usd:1520:5b0efa8a-153b-4421-abac-2aba4d772a86account-secret-key"
Where account-secret-key is the secret identification key for your account. You can request a key from the support service.
- Let's get a hash expression of the generated line using Python code:
>>> string_to_sign = '6320.91:840:card_invoice_usd:1520:5b0efa8a-153b-4421-abac-2aba4d772a86account-secret-key' >>> import hashlib >>> sign = hashlib.sha256(string_to_sign.encode()).hexdigest() >>> print(sign) '77a6f7a30876d480d4e771d08cb83800dd5cb874664c77e515ffc052b20293c6'
Body
Order ID in your system. Must be unique for each new invoice.
255"5b0efa8a-153b-4421-abac-2aba4d772a86"
Unique shop identifier in the M4 system.
1520
Request date and time.
"2026-05-24T16:35:42"
Response
OK
- Successful response
- Error response
Boolean value, in case of successful response it will be true, in case of error – false
true
A textual description of the error, in case of success - simply Ok
"Ok"
If this value is greater than 0, then the request ended with an error. Description of error codes
0
Show child attributes
Show child attributes