Atualizar configurações do cliente
curl --request PATCH \
--url https://api.malga.io/v1/subscriptions/settings \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--header 'X-Client-Id: <api-key>' \
--data '
{
"retryPolicy": [
{
"daysAfterLastAttempt": 1
},
{
"daysAfterLastAttempt": 4
},
{
"daysAfterLastAttempt": 9
},
{
"daysAfterLastAttempt": 16
}
],
"statementDescriptor": "MINHA EMPRESA",
"cancelAfterAllRetries": false
}
'import requests
url = "https://api.malga.io/v1/subscriptions/settings"
payload = {
"retryPolicy": [{ "daysAfterLastAttempt": 1 }, { "daysAfterLastAttempt": 4 }, { "daysAfterLastAttempt": 9 }, { "daysAfterLastAttempt": 16 }],
"statementDescriptor": "MINHA EMPRESA",
"cancelAfterAllRetries": False
}
headers = {
"X-Client-Id": "<api-key>",
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'X-Client-Id': '<api-key>',
'X-Api-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
retryPolicy: [
{daysAfterLastAttempt: 1},
{daysAfterLastAttempt: 4},
{daysAfterLastAttempt: 9},
{daysAfterLastAttempt: 16}
],
statementDescriptor: 'MINHA EMPRESA',
cancelAfterAllRetries: false
})
};
fetch('https://api.malga.io/v1/subscriptions/settings', 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.malga.io/v1/subscriptions/settings",
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([
'retryPolicy' => [
[
'daysAfterLastAttempt' => 1
],
[
'daysAfterLastAttempt' => 4
],
[
'daysAfterLastAttempt' => 9
],
[
'daysAfterLastAttempt' => 16
]
],
'statementDescriptor' => 'MINHA EMPRESA',
'cancelAfterAllRetries' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>",
"X-Client-Id: <api-key>"
],
]);
$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.malga.io/v1/subscriptions/settings"
payload := strings.NewReader("{\n \"retryPolicy\": [\n {\n \"daysAfterLastAttempt\": 1\n },\n {\n \"daysAfterLastAttempt\": 4\n },\n {\n \"daysAfterLastAttempt\": 9\n },\n {\n \"daysAfterLastAttempt\": 16\n }\n ],\n \"statementDescriptor\": \"MINHA EMPRESA\",\n \"cancelAfterAllRetries\": false\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Client-Id", "<api-key>")
req.Header.Add("X-Api-Key", "<api-key>")
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://api.malga.io/v1/subscriptions/settings")
.header("X-Client-Id", "<api-key>")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"retryPolicy\": [\n {\n \"daysAfterLastAttempt\": 1\n },\n {\n \"daysAfterLastAttempt\": 4\n },\n {\n \"daysAfterLastAttempt\": 9\n },\n {\n \"daysAfterLastAttempt\": 16\n }\n ],\n \"statementDescriptor\": \"MINHA EMPRESA\",\n \"cancelAfterAllRetries\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.malga.io/v1/subscriptions/settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Client-Id"] = '<api-key>'
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"retryPolicy\": [\n {\n \"daysAfterLastAttempt\": 1\n },\n {\n \"daysAfterLastAttempt\": 4\n },\n {\n \"daysAfterLastAttempt\": 9\n },\n {\n \"daysAfterLastAttempt\": 16\n }\n ],\n \"statementDescriptor\": \"MINHA EMPRESA\",\n \"cancelAfterAllRetries\": false\n}"
response = http.request(request)
puts response.read_body{
"clientId": "e234eeb3-483d-4df2-87eb-1e2be5cdaccd",
"retryPolicy": [
{
"daysAfterLastAttempt": 1
},
{
"daysAfterLastAttempt": 4
},
{
"daysAfterLastAttempt": 9
},
{
"daysAfterLastAttempt": 16
}
],
"cancelAfterAllRetries": false,
"createdAt": "2025-01-31T10:00:00Z",
"updatedAt": "2025-01-31T15:30:00Z",
"statementDescriptor": "MINHA EMPRESA"
}{
"error": {
"code": 123,
"declinedCode": "<string>",
"key": "<string>",
"businessCode": "<string>",
"message": "<string>",
"details": "<array>"
}
}Subscriptions
Atualizar configurações do cliente
Atualiza as configurações do cliente para assinaturas (retry policy, statement descriptor, etc.)
PATCH
/
v1
/
subscriptions
/
settings
Atualizar configurações do cliente
curl --request PATCH \
--url https://api.malga.io/v1/subscriptions/settings \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--header 'X-Client-Id: <api-key>' \
--data '
{
"retryPolicy": [
{
"daysAfterLastAttempt": 1
},
{
"daysAfterLastAttempt": 4
},
{
"daysAfterLastAttempt": 9
},
{
"daysAfterLastAttempt": 16
}
],
"statementDescriptor": "MINHA EMPRESA",
"cancelAfterAllRetries": false
}
'import requests
url = "https://api.malga.io/v1/subscriptions/settings"
payload = {
"retryPolicy": [{ "daysAfterLastAttempt": 1 }, { "daysAfterLastAttempt": 4 }, { "daysAfterLastAttempt": 9 }, { "daysAfterLastAttempt": 16 }],
"statementDescriptor": "MINHA EMPRESA",
"cancelAfterAllRetries": False
}
headers = {
"X-Client-Id": "<api-key>",
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'X-Client-Id': '<api-key>',
'X-Api-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
retryPolicy: [
{daysAfterLastAttempt: 1},
{daysAfterLastAttempt: 4},
{daysAfterLastAttempt: 9},
{daysAfterLastAttempt: 16}
],
statementDescriptor: 'MINHA EMPRESA',
cancelAfterAllRetries: false
})
};
fetch('https://api.malga.io/v1/subscriptions/settings', 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.malga.io/v1/subscriptions/settings",
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([
'retryPolicy' => [
[
'daysAfterLastAttempt' => 1
],
[
'daysAfterLastAttempt' => 4
],
[
'daysAfterLastAttempt' => 9
],
[
'daysAfterLastAttempt' => 16
]
],
'statementDescriptor' => 'MINHA EMPRESA',
'cancelAfterAllRetries' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>",
"X-Client-Id: <api-key>"
],
]);
$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.malga.io/v1/subscriptions/settings"
payload := strings.NewReader("{\n \"retryPolicy\": [\n {\n \"daysAfterLastAttempt\": 1\n },\n {\n \"daysAfterLastAttempt\": 4\n },\n {\n \"daysAfterLastAttempt\": 9\n },\n {\n \"daysAfterLastAttempt\": 16\n }\n ],\n \"statementDescriptor\": \"MINHA EMPRESA\",\n \"cancelAfterAllRetries\": false\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Client-Id", "<api-key>")
req.Header.Add("X-Api-Key", "<api-key>")
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://api.malga.io/v1/subscriptions/settings")
.header("X-Client-Id", "<api-key>")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"retryPolicy\": [\n {\n \"daysAfterLastAttempt\": 1\n },\n {\n \"daysAfterLastAttempt\": 4\n },\n {\n \"daysAfterLastAttempt\": 9\n },\n {\n \"daysAfterLastAttempt\": 16\n }\n ],\n \"statementDescriptor\": \"MINHA EMPRESA\",\n \"cancelAfterAllRetries\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.malga.io/v1/subscriptions/settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Client-Id"] = '<api-key>'
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"retryPolicy\": [\n {\n \"daysAfterLastAttempt\": 1\n },\n {\n \"daysAfterLastAttempt\": 4\n },\n {\n \"daysAfterLastAttempt\": 9\n },\n {\n \"daysAfterLastAttempt\": 16\n }\n ],\n \"statementDescriptor\": \"MINHA EMPRESA\",\n \"cancelAfterAllRetries\": false\n}"
response = http.request(request)
puts response.read_body{
"clientId": "e234eeb3-483d-4df2-87eb-1e2be5cdaccd",
"retryPolicy": [
{
"daysAfterLastAttempt": 1
},
{
"daysAfterLastAttempt": 4
},
{
"daysAfterLastAttempt": 9
},
{
"daysAfterLastAttempt": 16
}
],
"cancelAfterAllRetries": false,
"createdAt": "2025-01-31T10:00:00Z",
"updatedAt": "2025-01-31T15:30:00Z",
"statementDescriptor": "MINHA EMPRESA"
}{
"error": {
"code": 123,
"declinedCode": "<string>",
"key": "<string>",
"businessCode": "<string>",
"message": "<string>",
"details": "<array>"
}
}Body
application/json
Política de retentativas para pagamentos falhados
Required array length:
1 - 6 elementsShow child attributes
Show child attributes
Example:
[
{ "daysAfterLastAttempt": 1 },
{ "daysAfterLastAttempt": 4 },
{ "daysAfterLastAttempt": 9 },
{ "daysAfterLastAttempt": 16 }
]
Texto que aparece na fatura do cartão de crédito
Maximum string length:
25Example:
"MINHA EMPRESA"
Se a assinatura deve ser cancelada após todas as retentativas falharem
Example:
false
Response
Success
Identificador do cliente
Example:
"e234eeb3-483d-4df2-87eb-1e2be5cdaccd"
Política de retentativas configurada
Show child attributes
Show child attributes
Example:
[
{ "daysAfterLastAttempt": 1 },
{ "daysAfterLastAttempt": 4 },
{ "daysAfterLastAttempt": 9 },
{ "daysAfterLastAttempt": 16 }
]
Se a assinatura deve ser cancelada após todas as retentativas falharem
Example:
false
Data de criação das configurações
Example:
"2025-01-31T10:00:00Z"
Data da última atualização das configurações
Example:
"2025-01-31T15:30:00Z"
Texto que aparece na fatura do cartão de crédito
Example:
"MINHA EMPRESA"
Was this page helpful?
⌘I