Excluir assinatura
curl --request DELETE \
--url https://v4pay-api.vercel.app/subscriptions/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://v4pay-api.vercel.app/subscriptions/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://v4pay-api.vercel.app/subscriptions/{id}', 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://v4pay-api.vercel.app/subscriptions/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://v4pay-api.vercel.app/subscriptions/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://v4pay-api.vercel.app/subscriptions/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://v4pay-api.vercel.app/subscriptions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_name": "Maria Silva",
"customer_email": "<string>",
"customer_cpf": "<string>",
"description": "<string>",
"amount": 199.9,
"method": "pix",
"interval": "monthly",
"status": "active",
"next_billing_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"desvinculados": {
"charges.subscription_id": 3
},
"aviso": "<string>"
}{
"error": "Token JWT ou chave de API ausente"
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>",
"codigo": "MUITAS_REFERENCIAS"
}
}Assinaturas
Excluir assinatura
DELETE
/
subscriptions
/
{id}
Excluir assinatura
curl --request DELETE \
--url https://v4pay-api.vercel.app/subscriptions/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://v4pay-api.vercel.app/subscriptions/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://v4pay-api.vercel.app/subscriptions/{id}', 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://v4pay-api.vercel.app/subscriptions/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://v4pay-api.vercel.app/subscriptions/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://v4pay-api.vercel.app/subscriptions/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://v4pay-api.vercel.app/subscriptions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_name": "Maria Silva",
"customer_email": "<string>",
"customer_cpf": "<string>",
"description": "<string>",
"amount": 199.9,
"method": "pix",
"interval": "monthly",
"status": "active",
"next_billing_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"desvinculados": {
"charges.subscription_id": 3
},
"aviso": "<string>"
}{
"error": "Token JWT ou chave de API ausente"
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>",
"codigo": "MUITAS_REFERENCIAS"
}
}Authorizations
Token JWT obtido em /auth/login, enviado no cabeçalho Authorization no formato Bearer <token>.
Path Parameters
Response
Assinatura excluída com sucesso.
Objeto representando uma assinatura recorrente.
Show child attributes
Show child attributes
Ao excluir, as cobranças da assinatura ficam sem subscription_id. Quantos registros foram desvinculados, por tabela.campo.
Show child attributes
Show child attributes
Example:
{ "charges.subscription_id": 3 }
Só vem quando parte das referências não pôde ser desvinculada. A assinatura foi excluída mesmo assim; nenhuma cobrança é afetada.