Skip to main content
POST
/
api
/
v1
/
partners
/
{partnerId}
/
vouchers
/
{voucher_id}
/
cancel
cURL
curl -X POST 'https://certificados.zapsign.com.br/api/v1/partners/PRT_ABC123/vouchers/ZS_ECPF_A1_01HXYZABCDEFGHJKMNPQRSTV/cancel' \
  -H 'Authorization: Bearer czk_live_SUA_CHAVE'
const res = await fetch(
'https://certificados.zapsign.com.br/api/v1/partners/PRT_ABC123/vouchers/ZS_ECPF_A1_01HXYZABCDEFGHJKMNPQRSTV/cancel',
{
method: 'POST',
headers: { Authorization: 'Bearer czk_live_SUA_CHAVE' },
},
);
const voucher = await res.json();
import requests

res = requests.post(
'https://certificados.zapsign.com.br/api/v1/partners/PRT_ABC123/vouchers/ZS_ECPF_A1_01HXYZABCDEFGHJKMNPQRSTV/cancel',
headers={'Authorization': 'Bearer czk_live_SUA_CHAVE'},
)
voucher = res.json()
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://certificados.zapsign.com.br/api/v1/partners/{partnerId}/vouchers/{voucher_id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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://certificados.zapsign.com.br/api/v1/partners/{partnerId}/vouchers/{voucher_id}/cancel"

req, _ := http.NewRequest("POST", 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.post("https://certificados.zapsign.com.br/api/v1/partners/{partnerId}/vouchers/{voucher_id}/cancel")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://certificados.zapsign.com.br/api/v1/partners/{partnerId}/vouchers/{voucher_id}/cancel")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "voucher_id": "ZS_ECPF_A1_01HXYZABCDEFGHJKMNPQRSTV",
  "certificate_type": "ecpf_a1",
  "status": "declined",
  "reference_id": "PEDIDO_12345"
}

Authorizations

Authorization
string
header
required

Token Bearer com prefixo czk_live_. Gere a chave no portal em https://certificados.zapsign.com.br/reseller/api-keys.

Path Parameters

partnerId
string
required

Identificador público do parceiro (Partner ID), exibido no portal.

Required string length: 1 - 64
voucher_id
string
required

Identificador do voucher retornado em POST /vouchers/cpf ou /vouchers/cnpj.

Pattern: ^[A-Z0-9_-]{8,80}$
Example:

"ZS_ECPF_A3_01HXYZABCDEFGHJKMNPQRSTV"

Response

Voucher cancelado. 1 certificado volta ao saldo da carteira. O detalhe completo está em GET /vouchers/{voucher_id}.

Shape retornado por POST /vouchers/{voucher_id}/cancel (200).

voucher_id
string
required

Identificador único do voucher cancelado.

Example:

"ZS_ECPF_A1_01HXYZABCDEFGHJKMNPQRSTV"

certificate_type
enum<string> | null
required

Tipo do certificado. null apenas em vouchers legados.

Available options:
ecpf_a1,
ecpf_a3_nuvem,
ecnpj_a1,
ecnpj_a3_nuvem
Example:

"ecpf_a1"

status
enum<string>
required

Estado atual do voucher no ciclo de vida.

Available options:
issued,
redeemed,
expired,
declined
reference_id
string | null
required

Alias enviado pelo parceiro na criação. Sempre presente: null quando o voucher foi criado sem alias.

Example:

"PEDIDO_12345"