1
I am trying to implement payment by card using Pagseguro’s Rest API. I have followed every step of this documentation but the return is always "message": "Unauthorized"
. I’m testing directly at POSTMAN
How to solve this ?
//url: https://sandbox.api.pagseguro.com/charges
//token: "jkerjhelajkrhqleubbc...."
//headers
//Content-Type: application/json
//Authorization: {{token}}
//x-api-version: "1.0"
//x-idempotency-key: ""
//json
{
"reference_id": "823",
"description": "Compra de produtos site",
"amount": {
"value": 1000,
"currency": "BRL"
},
"payment_method": {
"type": "CREDIT_CARD",
"installments": 1,
"capture": true,
"card": {
"number": "4111111111111111",
"exp_month": "03",
"exp_year": "2026",
"security_code": "123",
"holder": {
"name": "Jose da Silva"
}
}
},
"notification_url": "https://meusite.com/StatusPagamentoTransaction"
}
What you’re saying is I should have a token for sandbox and one for production ? The production I already have, but the sandbox I’m not getting pq this off the air. See link https://sandbox.pagseguro.uol.com.br/
– FernandoPaiva
That, a token is required for the Sandbox as well.
– Eduardo Abreu dos Santos