Update payment method
curl --request PATCH \
--url https://app.zenedu.io/api/v1/payment-systems/{paymentSystem} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"public_name": "<string>",
"settings": {
"manualTextRequisites": [
{
"name": "<string>",
"value": "<string>"
}
],
"bot_only": true
}
}
'import requests
url = "https://app.zenedu.io/api/v1/payment-systems/{paymentSystem}"
payload = {
"name": "<string>",
"public_name": "<string>",
"settings": {
"manualTextRequisites": [
{
"name": "<string>",
"value": "<string>"
}
],
"bot_only": True
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
public_name: '<string>',
settings: {manualTextRequisites: [{name: '<string>', value: '<string>'}], bot_only: true}
})
};
fetch('https://app.zenedu.io/api/v1/payment-systems/{paymentSystem}', 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://app.zenedu.io/api/v1/payment-systems/{paymentSystem}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'public_name' => '<string>',
'settings' => [
'manualTextRequisites' => [
[
'name' => '<string>',
'value' => '<string>'
]
],
'bot_only' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://app.zenedu.io/api/v1/payment-systems/{paymentSystem}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"public_name\": \"<string>\",\n \"settings\": {\n \"manualTextRequisites\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"bot_only\": true\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://app.zenedu.io/api/v1/payment-systems/{paymentSystem}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"public_name\": \"<string>\",\n \"settings\": {\n \"manualTextRequisites\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"bot_only\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.zenedu.io/api/v1/payment-systems/{paymentSystem}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"public_name\": \"<string>\",\n \"settings\": {\n \"manualTextRequisites\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"bot_only\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"name": "<string>",
"public_name": "<string>",
"type": "<string>",
"type_name": "<string>",
"supports_subscription": true,
"sort": 123,
"settings": {},
"credentials_set": true,
"created_at": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"errors": {}
}Способи оплати
Оновити спосіб оплати
Частково оновлює спосіб оплати
PATCH
/
api
/
v1
/
payment-systems
/
{paymentSystem}
Update payment method
curl --request PATCH \
--url https://app.zenedu.io/api/v1/payment-systems/{paymentSystem} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"public_name": "<string>",
"settings": {
"manualTextRequisites": [
{
"name": "<string>",
"value": "<string>"
}
],
"bot_only": true
}
}
'import requests
url = "https://app.zenedu.io/api/v1/payment-systems/{paymentSystem}"
payload = {
"name": "<string>",
"public_name": "<string>",
"settings": {
"manualTextRequisites": [
{
"name": "<string>",
"value": "<string>"
}
],
"bot_only": True
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
public_name: '<string>',
settings: {manualTextRequisites: [{name: '<string>', value: '<string>'}], bot_only: true}
})
};
fetch('https://app.zenedu.io/api/v1/payment-systems/{paymentSystem}', 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://app.zenedu.io/api/v1/payment-systems/{paymentSystem}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'public_name' => '<string>',
'settings' => [
'manualTextRequisites' => [
[
'name' => '<string>',
'value' => '<string>'
]
],
'bot_only' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://app.zenedu.io/api/v1/payment-systems/{paymentSystem}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"public_name\": \"<string>\",\n \"settings\": {\n \"manualTextRequisites\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"bot_only\": true\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://app.zenedu.io/api/v1/payment-systems/{paymentSystem}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"public_name\": \"<string>\",\n \"settings\": {\n \"manualTextRequisites\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"bot_only\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.zenedu.io/api/v1/payment-systems/{paymentSystem}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"public_name\": \"<string>\",\n \"settings\": {\n \"manualTextRequisites\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"bot_only\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"name": "<string>",
"public_name": "<string>",
"type": "<string>",
"type_name": "<string>",
"supports_subscription": true,
"sort": 123,
"settings": {},
"credentials_set": true,
"created_at": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"errors": {}
}Частково оновлює спосіб оплати: змінюються лише передані поля.
typeзмінити не можна, він ігнорується.settingsоб’єднуються зі збереженими за ключами, тож можна змінити один ключ, не передаючи дані доступу заново.manualTextRequisitesзамінюється цілим списком.public_name: nullабо порожній рядок скидає назву для підписників на назву типу.
Для
stripe вебхук реєструється заново лише під час зміни secret_key. Якщо Stripe відхиляє новий ключ, нічого не зберігається і повертається 422 з помилкою в settings.secret_key.Авторизації
API token from the Zenedu dashboard
Параметри шляху
Payment method ID
Тіло
application/json
Partial update: only sent fields change. type cannot be changed and is ignored.
Internal name, unique within the account (case-insensitive)
Maximum string length:
255Name shown to subscribers; empty or null resets it to the type name
Maximum string length:
255Merged over the stored settings by key: omitted keys keep their values.
Show child attributes
Show child attributes
Відповідь
Payment method updated
Show child attributes
Show child attributes