| версия от 2023-02-13 |
Группа методов позволяет получать информацию по балансу и оплатам.
Адрес: https://restapi.plusofon.ru
GET api/v1/payment/balance
Метод позволяет получить баланс текущего личного кабинета.
Не имеет параметров.
curl -X GET \
-G "https://restapi.plusofon.ru/api/v1/payment/balance" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Client: 10553" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://restapi.plusofon.ru/api/v1/payment/balance"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Client": "10553",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://restapi.plusofon.ru/api/v1/payment/balance',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Client' => '10553',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://restapi.plusofon.ru/api/v1/payment/balance'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Client': '10553',
'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
В ответе возвращается:
"balance" |
double | значение баланса |
{
"balance": 255
}
GET api/v1/payment/notice
Метод позволяет получить значение баланса, при котором отправляется уведомление.
Не имеет параметров.
curl -X GET \
-G "https://restapi.plusofon.ru/api/v1/payment/notice" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Client: 10553" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://restapi.plusofon.ru/api/v1/payment/notice"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Client": "10553",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://restapi.plusofon.ru/api/v1/payment/notice',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Client' => '10553',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://restapi.plusofon.ru/api/v1/payment/notice'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Client': '10553',
'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
В ответе возвращается:
"amount" |
double | порог баланса |
{
"amount": 75
}
Пользователь не найден:
{
"message": "User not found.",
"code": 500
}
PATCH api/v1/payment/notice
Метод позволяет обновить значение баланса, при котором отправляется уведомление.
Параметры Body
"amount" |
integer | значение порога баланса |
curl -X PATCH \
"https://restapi.plusofon.ru/api/v1/payment/notice" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Client: 10553" \
-H "Authorization: Bearer {token}" \
-d '{"amount":500}'
const url = new URL(
"https://restapi.plusofon.ru/api/v1/payment/notice"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Client": "10553",
"Authorization": "Bearer {token}",
};
let body = {
"amount": 500
}
fetch(url, {
method: "PATCH",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->patch(
'https://restapi.plusofon.ru/api/v1/payment/notice',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Client' => '10553',
'Authorization' => 'Bearer {token}',
],
'json' => [
'amount' => 500,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://restapi.plusofon.ru/api/v1/payment/notice'
payload = {
"amount": 500
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Client': '10553',
'Authorization': 'Bearer {token}'
}
response = requests.request('PATCH', url, headers=headers, json=payload)
response.json()
В ответе может возвращаться:
"success" |
bool | признак успешно выполненного запроса |
"message" |
string | сообщение об ошибке |
Порог баланса успешно обновлён:
{
"success": true
}
Передано некорректное значение порога баланса:
{
"message": "The amount must be at least 0.",
"code": 400
}
Пользователь не найден:
{
"message": "User not found.",
"code": 500
}
GET api/v1/payment/history/{type}
Метод позволяет получить историю пополнений баланса и разовых и периодических списаний.
Параметры Path
"type" |
string | тип операции возможные варианты:
|
Параметры Body
"limit" |
integer | количество записей в ответе |
"page" |
integer | номер страницы ответа |
curl -X GET \
-G "https://restapi.plusofon.ru/api/v1/payment/history" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Client: 10553" \
-H "Authorization: Bearer {token}" \
-d '{"limit":10,"page":1}'
const url = new URL(
"https://restapi.plusofon.ru/api/v1/payment/history"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Client": "10553",
"Authorization": "Bearer {token}",
};
let body = {
"limit": 10,
"page": 1
}
fetch(url, {
method: "GET",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://restapi.plusofon.ru/api/v1/payment/history',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Client' => '10553',
'Authorization' => 'Bearer {token}',
],
'json' => [
'limit' => 10,
'page' => 1,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://restapi.plusofon.ru/api/v1/payment/history'
payload = {
"limit": 10,
"page": 1
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Client': '10553',
'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, json=payload)
response.json()
В ответе возвращается:
"history" |
array | массив транзакций |
"money" |
double | сумма транзакции |
"datetime" |
string | дата и время транзакции |
"comment" |
string | комментарий (информация о платеже, платёжной системе и т.д.) |
Получен список пополнений:
{
"history": [
{
"money": "2000",
"datetime": "16.07.2020 11:32:19",
"comment": "#Manual payment"
},
{
"money": "600",
"datetime": "16.07.2020 11:32:19",
"comment": "Яндекс Деньги -2359038002294-Банковская карта"
},
{
"money": "100",
"datetime": "16.07.2020 11:32:19",
"comment": "#Manual payment"
}
],
"success": true
}
Переданы некорректные параметры:
{
"message": "The selected type is invalid",
"code": 400
}
GET api/v1/payment/invoice
Метод позволяет получить список всех выставленных к оплате счетов.
Не имеет параметров.
curl -X GET \
-G "https://restapi.plusofon.ru/api/v1/payment/invoice" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Client: 10553" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://restapi.plusofon.ru/api/v1/payment/invoice"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Client": "10553",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://restapi.plusofon.ru/api/v1/payment/invoice',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Client' => '10553',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://restapi.plusofon.ru/api/v1/payment/invoice'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Client': '10553',
'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
В ответе возвращается:
"data" |
array | массив счетов |
"id" |
integer | ИД счёта |
"number" |
integer | номер счёта |
"name" |
string | название счёта |
"sum" |
string | сумма к оплате |
"created_at" |
string | дата создания |
{
"current_page": 1,
"data": [
{
"id": 1,
"number": "187605",
"name": "Оплата услуг по договору Plusofon2-103491",
"sum": "444.00",
"created_at": "2022-08-24"
},
{
"id": 2,
"number": "187606",
"name": "Оплата услуг по договору Plusofon2-103491",
"sum": "555.00",
"created_at": "2022-08-24"
},
{
"id": 3,
"number": "187611",
"name": "Оплата услуг по договору Plusofon2-103491",
"sum": "500.00",
"created_at": "2022-08-24"
}
],
"first_page_url": "http:\/\/localhost\/api\/v1\/payment\/invoice?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "http:\/\/localhost\/api\/v1\/payment\/invoice?page=1",
"next_page_url": null,
"path": "http:\/\/localhost\/api\/v1\/payment\/invoice",
"per_page": 15,
"prev_page_url": null,
"to": 3,
"total": 3
}
GET api/v1/payment/invoice/{invoice_id}
Метод позволяет получить файл счёта, выставленного к оплате.
Параметры Path
"invoice_id" |
string | ИД счёта (см. "id" в методе получения списка счетов) |
curl -X GET \
-G "https://restapi.plusofon.ru/api/v1/payment/invoice/1" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Client: 10553" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://restapi.plusofon.ru/api/v1/payment/invoice/1"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Client": "10553",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://restapi.plusofon.ru/api/v1/payment/invoice/1',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Client' => '10553',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://restapi.plusofon.ru/api/v1/payment/invoice/1'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Client': '10553',
'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
null
POST api/v1/payment/invoice
Метод позволяет создать счёт на оплату.
Параметры Body
"sum" |
double | сумма счёта |
curl -X POST \
"https://restapi.plusofon.ru/api/v1/payment/invoice" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Client: 10553" \
-H "Authorization: Bearer {token}" \
-d '{"sum":123.5}'
const url = new URL(
"https://restapi.plusofon.ru/api/v1/payment/invoice"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Client": "10553",
"Authorization": "Bearer {token}",
};
let body = {
"sum": 123.5
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
const url = new URL(
"https://restapi.plusofon.ru/api/v1/payment/invoice"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Client": "10553",
"Authorization": "Bearer {token}",
};
let body = {
"sum": 123.5
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
import requests
import json
url = 'https://restapi.plusofon.ru/api/v1/payment/invoice'
payload = {
"sum": 123.5
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Client': '10553',
'Authorization': 'Bearer {token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
В ответе может возвращаться:
"invoice_id" |
string | ИД созданного счёта |
"success" |
bool | признак успешно выполненного запроса |
"message" |
string | сообщение об ошибке |
Счёт успешно создан:
{
"invoice_id": "2f6-a387-ad45",
"success": true
}
GET api/v1/payment/autopay
Метод позволяет получить параметры счёта на оплату, автоматически выставляемого при пересечении порога баланса.
Не имеет параметров.
curl -X GET \
-G "https://restapi.plusofon.ru/api/v1/payment/autopay" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Client: 10553" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://restapi.plusofon.ru/api/v1/payment/autopay"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Client": "10553",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://restapi.plusofon.ru/api/v1/payment/autopay',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Client' => '10553',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://restapi.plusofon.ru/api/v1/payment/autopay'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Client': '10553',
'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
В ответе возвращается:
"access" |
bool | признак доступности услуги для текущего пользователя |
"active" |
bool | признак активности услуги |
"sum" |
double | сумма счёта |
{
"access": true,
"active": true,
"sum": 75.5
}
Пользователь не найден:
{
"message": "User not found.",
"code": 500
}
PUT api/v1/payment/autopay
Метод позволяет включить или изменить параметры счёта на оплату, автоматически выставляемого при пересечении порога баланса.
Параметры Body
"sum" |
double | сумма счёта |
curl -X PUT \
"https://restapi.plusofon.ru/api/v1/payment/autopay" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Client: 10553" \
-H "Authorization: Bearer {token}" \
-d '{"sum":123.5}'
const url = new URL(
"https://restapi.plusofon.ru/api/v1/payment/autopay"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Client": "10553",
"Authorization": "Bearer {token}",
};
let body = {
"sum": 123.5
}
fetch(url, {
method: "PUT",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->put(
'https://restapi.plusofon.ru/api/v1/payment/autopay',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Client' => '10553',
'Authorization' => 'Bearer {token}',
],
'json' => [
'sum' => 123.5,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://restapi.plusofon.ru/api/v1/payment/autopay'
payload = {
"sum": 123.5
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Client': '10553',
'Authorization': 'Bearer {token}'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()
В ответе могут возвращаться следующие поля:
"success" |
bool | признак успешно выполненного запроса |
"message" |
string | сообщение об ошибке |
Параметры успешно обновлены:
{
"success": true
}
Передана некорректная сумма счёта:
{
"message": "The amount must be at least 0.",
"code": 400
}
Пользователь не найден:
{
"message": "User not found.",
"code": 500
}
DELETE api/v1/payment/autopay
Метод позволяет отключить счёт на оплату, автоматически выставляемый при пересечении порога баланса.
Не имеет параметров.
curl -X DELETE \
"https://restapi.plusofon.ru/api/v1/payment/autopay" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Client: 10553" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://restapi.plusofon.ru/api/v1/payment/autopay"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Client": "10553",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "DELETE",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'https://restapi.plusofon.ru/api/v1/payment/autopay',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Client' => '10553',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://restapi.plusofon.ru/api/v1/payment/autopay'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Client': '10553',
'Authorization': 'Bearer {token}'
}
response = requests.request('DELETE', url, headers=headers)
response.json()
В ответе может возвращаться:
"success" |
bool | признак успешно выполненного запроса |
"message" |
string | сообщение об ошибке |
Услуга успешно отключена:
{
"success": true
}
Пользователь не найден:
{
"message": "User not found.",
"code": 500
}
GET api/v1/payment/types
Метод позволяет получить список всех доступных способов оплаты.
Не имеет параметров.
curl -X GET \
-G "https://restapi.plusofon.ru/api/v1/payment/types" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Client: 10553" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://restapi.plusofon.ru/api/v1/payment/types"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Client": "10553",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://restapi.plusofon.ru/api/v1/payment/types',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Client' => '10553',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://restapi.plusofon.ru/api/v1/payment/types'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Client': '10553',
'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
В ответе возвращается массив paymentTypes:
"type" |
string | код метода оплаты |
"title" |
string | название метода оплаты |
{
"paymentTypes": [
{
"type": "AC",
"title": "Банковская карта"
},
{
"type": "GP",
"title": "Наличными через кассы и терминалы"
},
{
"type": "SB",
"title": "Сбербанк Онлайн"
}
]
}