Arquivar checkout link
curl --request DELETE \
--url https://api.sandbox.z2pay.com/v1/checkout/links/{id} \
--header 'x-api-key: <api-key>'const options = {method: 'DELETE', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.sandbox.z2pay.com/v1/checkout/links/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.sandbox.z2pay.com/v1/checkout/links/{id}"
headers = {"x-api-key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text){
"id": "chk_byd8p3p79re859jpkmr0j65n3",
"slug": "curso-marketing-digital",
"status": "archived",
"mode": "payment",
"currency": "BRL",
"locale": "pt-BR",
"name": "Curso de Marketing Digital",
"description": "Acesso vitalício ao curso completo",
"sellable": true,
"config": {
"items": [
{
"name": "Curso de Marketing Digital",
"quantity": 1,
"unitAmount": 49700,
"chargeType": "one_time"
}
],
"paymentMethods": {
"card": {
"enabled": true
},
"pix": {
"enabled": true
}
}
},
"requiredFields": [
"email",
"document",
"phone"
],
"customFields": null,
"successUrl": "https://academia.com/obrigado",
"cancelUrl": null,
"metadata": null,
"expirationMinutes": 1440,
"createdAt": "2025-06-29T13:45:30.000Z",
"updatedAt": "2025-06-29T16:00:00.000Z"
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid API key"
}
}{
"error": {
"code": "FORBIDDEN",
"message": "Forbidden — insufficient permissions"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Checkout link not found"
}
}{
"error": "A request with this idempotency key is already being processed"
}{
"error": "Idempotency key already used with a different request body"
}Links
Arquivar checkout link
Tira o template do ar — a URL deixa de vender e nenhuma Session nova nasce dele.
DELETE
/
checkout
/
links
/
{id}
Arquivar checkout link
curl --request DELETE \
--url https://api.sandbox.z2pay.com/v1/checkout/links/{id} \
--header 'x-api-key: <api-key>'const options = {method: 'DELETE', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.sandbox.z2pay.com/v1/checkout/links/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.sandbox.z2pay.com/v1/checkout/links/{id}"
headers = {"x-api-key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text){
"id": "chk_byd8p3p79re859jpkmr0j65n3",
"slug": "curso-marketing-digital",
"status": "archived",
"mode": "payment",
"currency": "BRL",
"locale": "pt-BR",
"name": "Curso de Marketing Digital",
"description": "Acesso vitalício ao curso completo",
"sellable": true,
"config": {
"items": [
{
"name": "Curso de Marketing Digital",
"quantity": 1,
"unitAmount": 49700,
"chargeType": "one_time"
}
],
"paymentMethods": {
"card": {
"enabled": true
},
"pix": {
"enabled": true
}
}
},
"requiredFields": [
"email",
"document",
"phone"
],
"customFields": null,
"successUrl": "https://academia.com/obrigado",
"cancelUrl": null,
"metadata": null,
"expirationMinutes": 1440,
"createdAt": "2025-06-29T13:45:30.000Z",
"updatedAt": "2025-06-29T16:00:00.000Z"
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid API key"
}
}{
"error": {
"code": "FORBIDDEN",
"message": "Forbidden — insufficient permissions"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Checkout link not found"
}
}{
"error": "A request with this idempotency key is already being processed"
}{
"error": "Idempotency key already used with a different request body"
}DELETE /checkout/links/{id}
Faz parte do recurso Links — o conceito e os estados estão lá.
O status passa a archived, a URL pública deixa de vender e nenhuma Session nova é materializada.
A resposta é 200 com o Link inteiro, já com o estado novo.
Quem estava com a página aberta também para de poder pagar. O comprador que clicar em “Pagar”
recebe
409 com key: "errors.checkout.link_not_active" — a confirmação revalida o Link a cada
tentativa, de propósito, para que ninguém pague contra algo que você já tirou do ar.Se a intenção é só parar de divulgar e deixar quem está no meio da compra terminar, não arquive
agora: espere as Sessions abertas expirarem (24h por padrão) ou
cancele-as explicitamente.Não há como desarquivar pela API. Não existe rota de restauração, e o
PATCH não aceita status no corpo — pelo painel dá, pela
integração não. Se precisar do mesmo checkout de volta, o caminho é criar um Link novo, com outro
chk_, e o mesmo slug só se você tiver liberado o antigo.Não é remoção, é mudança de estado — não há
deletedAt. O Link continua existindo e sendo
devolvido pelo GET com status: "archived", o que permite reler a
configuração depois.Endpoint idempotente. Veja Convenções.
Exemplo
curl -X DELETE https://api.sandbox.z2pay.com/v1/checkout/links/chk_byd8p3p79re859jpkmr0j65n3 \
-H "x-api-key: SUA_CHAVE_DE_SANDBOX"
Resposta 200
{
"id": "chk_byd8p3p79re859jpkmr0j65n3",
"name": "Curso de Backend",
"status": "archived",
"sellable": true,
"mode": "payment",
"currency": "BRL",
"updatedAt": "2026-06-26T18:40:00.000Z",
"url": "https://pay.sandbox.z2pay.com/c/chk_byd8p3p79re859jpkmr0j65n3"
}
Authorizations
Response
Link arquivado