Simular pagamento
curl --request POST \
--url https://api.pagstack.com/v1/transactions/{id}/simulate-payment \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.pagstack.com/v1/transactions/{id}/simulate-payment', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pagstack.com/v1/transactions/{id}/simulate-payment"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text){
"id": "tx_7Fq2kM9xLp",
"object": "transaction",
"livemode": false,
"status": "pending",
"amount": 4990,
"fee": null,
"net_amount": null,
"amount_refunded": 0,
"payment_method": "pix",
"description": "Pedido #1042",
"external_id": "pedido_1042",
"buyer": null,
"pix": {
"code": "PAGSTACK-TESTE-NAO-PAGAVEL:tx_7Fq2kM9xLp",
"qrcode_base64": "data:image/png;base64,iVBORw0KGgo...",
"expires_at": "2026-12-02T14:30:00.000Z"
},
"end_to_end_id": null,
"tracking": {
"utm_source": "meta",
"utm_campaign": "black-friday"
},
"checkout_id": null,
"subscription_id": null,
"bucket": {
"id": "bkt_cm4x9q2k80001",
"name": "Assinaturas Premium",
"slug": "premium"
},
"coupon": null,
"metadata": {},
"dispute_reason": null,
"paid_at": null,
"created_at": "2026-12-02T14:00:00.000Z"
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}Transações
Simular pagamento
Só no modo de teste: marca a transação como paga e dispara transaction.paid, como se o comprador tivesse pago.
Simular pagamento
curl --request POST \
--url https://api.pagstack.com/v1/transactions/{id}/simulate-payment \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.pagstack.com/v1/transactions/{id}/simulate-payment', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pagstack.com/v1/transactions/{id}/simulate-payment"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text){
"id": "tx_7Fq2kM9xLp",
"object": "transaction",
"livemode": false,
"status": "pending",
"amount": 4990,
"fee": null,
"net_amount": null,
"amount_refunded": 0,
"payment_method": "pix",
"description": "Pedido #1042",
"external_id": "pedido_1042",
"buyer": null,
"pix": {
"code": "PAGSTACK-TESTE-NAO-PAGAVEL:tx_7Fq2kM9xLp",
"qrcode_base64": "data:image/png;base64,iVBORw0KGgo...",
"expires_at": "2026-12-02T14:30:00.000Z"
},
"end_to_end_id": null,
"tracking": {
"utm_source": "meta",
"utm_campaign": "black-friday"
},
"checkout_id": null,
"subscription_id": null,
"bucket": {
"id": "bkt_cm4x9q2k80001",
"name": "Assinaturas Premium",
"slug": "premium"
},
"coupon": null,
"metadata": {},
"dispute_reason": null,
"paid_at": null,
"created_at": "2026-12-02T14:00:00.000Z"
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}Autorizações
Cabeçalhos
Resposta
Sucesso.
Transação: um pagamento Pix recebido.
pending aguardando pagamento, paid paga, expired, canceled, refunded, partially_refunded ou under_dispute: contestação MED aberta pelo pagador, o valor fica bloqueado até a decisão. Na decisão, volta a paid (valor liberado, evento transaction.dispute_released) ou vira refunded (devolvido ao pagador, evento transaction.refunded).
Opções disponíveis:
pending, paid, expired, canceled, refunded, partially_refunded, under_dispute Motivo da contestação MED mais recente: fraud (fraude), not_received (produto ou serviço não recebido), not_as_described (diferente do anunciado), duplicate (cobrança duplicada). Continua preenchido depois da decisão. null se a transação nunca foi contestada.
Opções disponíveis:
fraud, not_received, not_as_described, duplicate