Справочник APIeSIM с балансом
eSIM с балансом: ваши цены
GET
/api/partner/v1/esim/payg/config- Scope
esim:read
hold(выпуск) = issue_price_usd + topup(credit); hold(пополнение) = ceil_cent(credit × (1 + topup_fee_pct/100) + topup_fee_const_usd).
Пример запроса
TS=$(date +%s)
SIG=$(printf '%s\n%s\n%s\n%s' "$TS" "GET" "/api/partner/v1/esim/payg/config" "" \
| openssl dgst -sha256 -hmac "$PP_SECRET" -hex | awk '{print $NF}')
curl -sS -X GET "https://api.plativputi.com/api/partner/v1/esim/payg/config" \
-H "X-Key-Id: $PP_KEY_ID" \
-H "X-Timestamp: $TS" \
-H "X-Signature: $SIG"const res = await pp("GET", "/esim/payg/config");res = pp("GET", "/esim/payg/config")$res = pp('GET', '/esim/payg/config');pp() — функция-обёртка с подписью из раздела Аутентификация и подпись.
Ответ
200 OK — PaygConfigOutputBody
| Поле | Тип | Обяз. | Описание |
|---|---|---|---|
available | boolean | да | false: выпуск и пополнение сейчас отвечают 503 payg_unavailable |
currency | string | да | — |
issue_price_usd | string | нет | Выпускная часть холда (eSIM + комиссия). Нет, пока недоступно. |
max_credit_usd | string | да | — |
max_operation_usd | string | да | — |
min_credit_usd | string | да | — |
refund_fee_pct | string | да | — |
topup_fee_const_usd | string | да | — |
topup_fee_pct | string (decimal) | да | — |
Примеры ответа
{
"available": true,
"currency": "USD",
"issue_price_usd": "3.38",
"topup_fee_pct": "5",
"topup_fee_const_usd": "0.00",
"refund_fee_pct": "0",
"min_credit_usd": "1",
"max_credit_usd": "1000",
"max_operation_usd": "1000.00"
}Ошибки
| HTTP | Код | Когда |
|---|---|---|
| 403 | payg_not_enabled | eSIM с балансом для вашего аккаунта не включён. |
Плюс общие ошибки подписи и лимитов — см. Ошибки.