Listar sessions
curl --request GET \
--url https://api.sandbox.z2pay.com/v1/checkout/sessions \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.sandbox.z2pay.com/v1/checkout/sessions', 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/sessions"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": [
{
"id": "cs_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
"linkId": "chk_byd8p3p79re859jpkmr0j65n3",
"status": "paid",
"mode": "payment",
"currency": "BRL",
"locale": "pt-BR",
"config": {
"paymentMethods": {
"card": {
"enabled": true
},
"pix": {
"enabled": true
}
}
},
"customer": {
"name": "João Silva",
"email": "joao@example.com",
"document": "12345678909"
},
"customFieldValues": null,
"paymentMethodSelected": "pix",
"subtotal": 49700,
"discountTotal": 0,
"amount": 49700,
"discounts": null,
"paymentAttempts": 1,
"transactionId": "txn_glv363b1d6ftu78u2jgor9t8n",
"subscriptionId": null,
"invoiceId": null,
"metadata": null,
"createdAt": "2025-06-29T13:45:30.000Z",
"updatedAt": "2025-06-29T13:50:12.000Z",
"openedAt": "2025-06-29T13:46:00.000Z",
"paidAt": "2025-06-29T13:50:12.000Z",
"canceledAt": null,
"expiresAt": "2025-06-30T13:45:30.000Z",
"url": "https://pay.sandbox.z2pay.com/c/cs_9ffa51de3b60209c426388fbbd5ae4dc56980b13406d93b7"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 1,
"totalPages": 1
}
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "Validation failed",
"issues": [
{
"path": "status",
"message": "Status inválido. Valores aceitos: pending, waiting_payment, paid, refused, canceled, refunded"
},
{
"path": "startDate",
"message": "Data deve ser ISO 8601 com timezone (ex.: 2026-06-24T00:00:00Z)"
}
]
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid API key"
}
}{
"error": {
"code": "FORBIDDEN",
"message": "Forbidden — insufficient permissions"
}
}Links
Listar sessions
Lista paginada das compras — as de Link e as de venda rápida, juntas.
GET
/
checkout
/
sessions
Listar sessions
curl --request GET \
--url https://api.sandbox.z2pay.com/v1/checkout/sessions \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.sandbox.z2pay.com/v1/checkout/sessions', 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/sessions"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": [
{
"id": "cs_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
"linkId": "chk_byd8p3p79re859jpkmr0j65n3",
"status": "paid",
"mode": "payment",
"currency": "BRL",
"locale": "pt-BR",
"config": {
"paymentMethods": {
"card": {
"enabled": true
},
"pix": {
"enabled": true
}
}
},
"customer": {
"name": "João Silva",
"email": "joao@example.com",
"document": "12345678909"
},
"customFieldValues": null,
"paymentMethodSelected": "pix",
"subtotal": 49700,
"discountTotal": 0,
"amount": 49700,
"discounts": null,
"paymentAttempts": 1,
"transactionId": "txn_glv363b1d6ftu78u2jgor9t8n",
"subscriptionId": null,
"invoiceId": null,
"metadata": null,
"createdAt": "2025-06-29T13:45:30.000Z",
"updatedAt": "2025-06-29T13:50:12.000Z",
"openedAt": "2025-06-29T13:46:00.000Z",
"paidAt": "2025-06-29T13:50:12.000Z",
"canceledAt": null,
"expiresAt": "2025-06-30T13:45:30.000Z",
"url": "https://pay.sandbox.z2pay.com/c/cs_9ffa51de3b60209c426388fbbd5ae4dc56980b13406d93b7"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 1,
"totalPages": 1
}
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "Validation failed",
"issues": [
{
"path": "status",
"message": "Status inválido. Valores aceitos: pending, waiting_payment, paid, refused, canceled, refunded"
},
{
"path": "startDate",
"message": "Data deve ser ISO 8601 com timezone (ex.: 2026-06-24T00:00:00Z)"
}
]
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid API key"
}
}{
"error": {
"code": "FORBIDDEN",
"message": "Forbidden — insufficient permissions"
}
}GET /checkout/sessions
Faz parte do recurso Links — o que é uma Session e os estados dela estão
lá.
Devolve todas as suas Sessions, da mais recente para a mais antiga, em páginas de 20 por padrão
(máximo 100). Os filtros são opcionais e se somam. As Sessions de Link e as de
venda rápida aparecem misturadas — o que as distingue é o linkId, que
vem preenchido nas primeiras e null nas segundas.
Para ver só as vendas rápidas, use a listagem delas.
GET /checkout/charges
é a mesma Session com o filtro já aplicado. Aqui, ?linkId=chk_... faz o contrário: restringe às
Sessions de um template específico.status aceita mais de um valor, separados por vírgula: ?status=paid,opened. Um valor fora
da lista responde 400 com os aceitos.Exemplo
curl -G https://api.sandbox.z2pay.com/v1/checkout/sessions \
-H "x-api-key: SUA_CHAVE_DE_SANDBOX" \
-d status=paid \
-d page=1 \
-d limit=20
Resposta 200
{
"data": [
{
"id": "cs_9ffa51de3b60209c426388fbbd5ae4dc56980b13406d93b7",
"linkId": "chk_byd8p3p79re859jpkmr0j65n3",
"status": "paid",
"amount": 49900,
"currency": "BRL",
"transactionId": "txn_ebgsvfsb4151nmbgvj4sek6ol",
"createdAt": "2026-06-24T13:10:00.000Z",
"expiresAt": "2026-06-25T13:10:00.000Z"
}
],
"pagination": { "page": 1, "limit": 20, "total": 37, "totalPages": 2 }
}
Authorizations
API key unificada (z2_{live|test}{sk|pk}...) — secret (sk) para integração backend, publishable (pk) para uso no frontend público
Query Parameters
Página da listagem. Padrão: 1.
Required range:
x >= 1Itens por página. Padrão: 20. Máximo: 100.
Required range:
1 <= x <= 100Apenas as compras geradas por este Link (chk_). Correspondência exata. Omitido, traz também as vendas rápidas.
Situação da compra. Aceita vários valores, separados por vírgula ou repetindo o parâmetro. Um valor inválido responde 400 com a lista dos aceitos.
Available options:
created, opened, filling, paying, partially_paid, paid, failed, abandoned, expired, canceled