Obter Assinatura por ID
curl --request GET \
--url https://api.example.com/subscriptions/{plan_id}/{beneficiary_cpf} \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.example.com/subscriptions/{plan_id}/{beneficiary_cpf}"
headers = {"x-api-key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
fetch('https://api.example.com/subscriptions/{plan_id}/{beneficiary_cpf}', 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.example.com/subscriptions/{plan_id}/{beneficiary_cpf}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <x-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"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/subscriptions/{plan_id}/{beneficiary_cpf}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/subscriptions/{plan_id}/{beneficiary_cpf}")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/subscriptions/{plan_id}/{beneficiary_cpf}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"start_date": "2023-02-22T06:16:49.584Z",
"expiry_date": "2024-02-22T06:16:49.584Z",
"plan_id": "plan_10001",
"beneficiary": {
"primary_card": "27030474015",
"user_card": "27030474015",
"name": "João Silva",
"cpf": "34567898233",
"birth_date": "1990-02-22",
"gender": "M",
"email": "joao.silva@example.com",
"address": {
"zipcode": "06454040",
"street": "Rua Exemplo",
"number": "123",
"complement": "Apto 45",
"neighborhood": "Centro",
"city": "São Paulo",
"state": "SP"
},
"phone_number": "+5511996042491"
}
}
{
"message": "Assinatura não encontrada"
}
Assinaturas
Obter Assinatura por ID
Recupera os detalhes de uma assinatura específica.
GET
/
subscriptions
/
{plan_id}
/
{beneficiary_cpf}
Obter Assinatura por ID
curl --request GET \
--url https://api.example.com/subscriptions/{plan_id}/{beneficiary_cpf} \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.example.com/subscriptions/{plan_id}/{beneficiary_cpf}"
headers = {"x-api-key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
fetch('https://api.example.com/subscriptions/{plan_id}/{beneficiary_cpf}', 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.example.com/subscriptions/{plan_id}/{beneficiary_cpf}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <x-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"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/subscriptions/{plan_id}/{beneficiary_cpf}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/subscriptions/{plan_id}/{beneficiary_cpf}")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/subscriptions/{plan_id}/{beneficiary_cpf}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"start_date": "2023-02-22T06:16:49.584Z",
"expiry_date": "2024-02-22T06:16:49.584Z",
"plan_id": "plan_10001",
"beneficiary": {
"primary_card": "27030474015",
"user_card": "27030474015",
"name": "João Silva",
"cpf": "34567898233",
"birth_date": "1990-02-22",
"gender": "M",
"email": "joao.silva@example.com",
"address": {
"zipcode": "06454040",
"street": "Rua Exemplo",
"number": "123",
"complement": "Apto 45",
"neighborhood": "Centro",
"city": "São Paulo",
"state": "SP"
},
"phone_number": "+5511996042491"
}
}
{
"message": "Assinatura não encontrada"
}
Visão Geral
Retorna os detalhes completos de uma assinatura identificada peloplan_id e CPF do beneficiário.
Autenticação
string
required
Sua chave de API fornecida pela Zentek.
Path Parameters
string
required
ID do plano da assinatura. Exemplo:
plan_10000string
required
CPF do beneficiário (apenas números). Exemplo:
34567898233Exemplo de Request
curl -X GET "https://api.partner.zentek.com.br/v1/subscriptions/plan_10000/34567898233" \
-H "x-api-key: SUA_API_KEY" \
-H "Accept: application/json"
const response = await fetch('https://api.partner.zentek.com.br/v1/subscriptions/plan_10000/34567898233', {
headers: {
'x-api-key': 'SUA_API_KEY',
'Accept': 'application/json'
}
});
Response
{
"start_date": "2023-02-22T06:16:49.584Z",
"expiry_date": "2024-02-22T06:16:49.584Z",
"plan_id": "plan_10001",
"beneficiary": {
"primary_card": "27030474015",
"user_card": "27030474015",
"name": "João Silva",
"cpf": "34567898233",
"birth_date": "1990-02-22",
"gender": "M",
"email": "joao.silva@example.com",
"address": {
"zipcode": "06454040",
"street": "Rua Exemplo",
"number": "123",
"complement": "Apto 45",
"neighborhood": "Centro",
"city": "São Paulo",
"state": "SP"
},
"phone_number": "+5511996042491"
}
}
{
"message": "Assinatura não encontrada"
}
Was this page helpful?
⌘I
