Skip to main content
POST
Create payment method
Создаёт способ оплаты указанного type.
  • Ключи settings зависят от type, см. таблицу в поле settings. Неизвестные ключи отбрасываются, у текстовых значений обрезаются пробелы.
  • name должен быть уникальным в аккаунте без учёта регистра.
  • В аккаунте может быть только один способ оплаты telegramstars: на второй вернётся 409.
  • Для manually у реквизитов обязательны name и value, а итоговое сообщение бота должно уложиться в 4000 символов.
  • attach_to_all_offers добавляет способ оплаты во все тарифы, чью валюту и минимальную сумму он поддерживает.
Для stripe перед сохранением в Stripe регистрируется вебхук с переданным secret_key. Если Stripe отклоняет ключ, ничего не сохраняется и возвращается 422 с ошибкой в settings.secret_key.

Авторизации

Authorization
string
header
обязательно

API token from the Zenedu dashboard

Тело

application/json
name
string
обязательно

Internal name, unique within the account (case-insensitive)

Maximum string length: 255
type
string
обязательно

Payment method type, see List payment method types

public_name
string | null

Name shown to subscribers; empty or null shows the type name

Maximum string length: 255
settings
object

Settings for the payment method type. Allowed keys depend on type — see List payment method types. Unknown keys are dropped, text values are trimmed, and every credential key of the type is required.

For manually, every text key except manualIcon and manualTextIntroShop is required, and manualTextRequisites must contain at least one row with both name and value filled. The resulting bot message must fit into 4000 characters.

attach_to_all_offers
boolean
по умолчанию:false

Attach the new method to every offer whose currency and minimum amount it supports

Ответ

Payment method created

data
object