Voltar ao site
Links de pagamento

Consultar link de pagamento

GET/v1/payment-links/{id}

Devolve o link. O desfecho chega por payment.succeeded com paymentLinkId; os pagamentos do link saem em GET /v1/payments?paymentLinkId=.

X-Merchant-Id é obrigatório com credencial de organização; com credencial de merchant é opcional (ausente = o próprio merchant).

Authorization

kodanoOAuth payments:links:read
headerAuthorizationBearer <token>

Token obtido no Zitadel do ambiente (POST /oauth/v2/token), fora do host da API, e enviado em Authorization: Bearer <access_token>.

  • Sandbox: https://kodano-uat-p55zt6.us1.zitadel.cloud/oauth/v2/token
  • Produção: https://kodano-prod-qe8hbt.us1.zitadel.cloud/oauth/v2/token

Use sempre o tokenUrl devolvido na emissão da credencial. Duas variantes: private_key_jwt (preferida; grant urn:ietf:params:oauth:grant-type:jwt-bearer com assertion RS256 assinada pela chave da credencial, iss = sub = userId, aud = authority do Zitadel, kid = keyId) e client_secret (grant client_credentials). O OpenAPI só modela a segunda.

O parâmetro scope do token é OIDC, não os escopos da API: openid urn:zitadel:iam:org:project:id:<projectId da API>:aud urn:zitadel:iam:user:resourceowner. Sem o :aud a API responde 401 AUTH.TOKEN_INVALID; sem resourceowner, 403 AUTH.TENANT_MISMATCH.

Os 28 escopos abaixo são os entitlements concedidos à credencial pelos produtos de integração (produto:recurso:ação; write não implica read), avaliados a cada requisição; não são pedidos no token. O tenant vem da organização do token; o merchant, de X-Merchant-Id. Revogar a credencial nega os tokens já emitidos em até 60 s.

Scope: payments:links:read

Path Parameters

id*string

Id do link (ord_…).

Header Parameters

X-Merchant-Id*string

Merchant da operação (mrc_ + Guid sem hífens, minúsculo). Obrigatório com credencial de organização (ausente → 400 MERCHANT.HEADER_REQUIRED); com credencial de merchant é opcional (ausente = o próprio merchant). Malformado, repetido, inexistente ou de outro tenant → 403 MERCHANT.FORBIDDEN (nunca 404). Vazio = ausente.

Match^mrc_[0-9a-f]{32}$
X-Correlation-Id?string

Opcional, sempre ecoado na resposta e repetido em correlationId do Problem. Ausente ou inválido → o serviço gera UUID v7.

Match^[A-Za-z0-9._-]{1,64}$

Response Body

Link.

application/json
  1. response
id*string

ord_ + 28 caracteres.

Match^ord_
url*string

Checkout hospedado e anônimo, fora do host da API.

Formaturi
status*PaymentLinkStatus
Value in"ACTIVE""COMPLETED""EXPIRED""CANCELED"
amount*integer
Range100 <= value <= 100000000
currency*"BRL"

Único valor na v1.

Value in"BRL"
name*|
Lengthlength <= 255
description*|
Lengthlength <= 255
methods*array<>
Items1 <= items <= 3
maxPayments*integer

Sempre 1 com customer.

Range1 <= value <= 10000
paymentsCount*integer

Pode passar de maxPayments.

maxInstallments*|
Range1 <= value <= 12
expiresAt*|

null = sem vencimento.

Formatdate-time
customer*|null
externalReference*string

Única por merchant; gerada quando omitida.

Lengthlength <= 100
successUrl*|
Lengthlength <= 255
failureUrl*|
Lengthlength <= 255
metadata*|null
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
Example Request
curl -X GET 'https://api.sandbox.kodano.com.br/v1/payment-links/string' \  -H 'X-Merchant-Id: mrc_0f8fad5bd9cb469fa16570867728950e' \  -H 'X-Correlation-Id: erp-7f3a-0010'
Example Response
{  "id": "ord_2mK9xQ7vR4tL8nW1pZ6cY3bH5jD0",  "url": "https://pay.kodano.com.br/8b1f6c0e-3d2a-4f7b-9c1e-5a6d7e8f9a0b",  "status": "COMPLETED",  "amount": 15990,  "currency": "BRL",  "name": "Plano anual",  "description": "Assinatura anual do plano Pro",  "methods": [    "PIX",    "CARD"  ],  "maxPayments": 1,  "paymentsCount": 1,  "maxInstallments": 3,  "expiresAt": "2026-10-23T13:00:00Z",  "customer": {    "id": "cus_8kQ2mZ7xW1pL4nR0",    "name": "Ana Souza",    "document": "123******09"  },  "externalReference": "pedido-123",  "successUrl": "https://loja.example.com/obrigado",  "failureUrl": "https://loja.example.com/pagamento-falhou",  "metadata": {    "orderRef": "123"  },  "createdAt": "2026-10-16T13:00:00Z",  "updatedAt": "2026-10-16T13:07:41Z"}