Cancel PicPay Payments
https://api-sandbox.letpay.io/payment/MY_PAYMENT_TOKEN/cancel
Cancels a PicPay payment that were already sent using one of the following methods: Process PicPay Payment
, Simple PicPay
. After this, the payment can no longer be paid.
Request Fields
None
Response Fields
payment_token
(string): Token to identify this payment.refresh_token
(string): Updated access token for next calls.transaction_status
(string): Status of this payment.
AUTHORIZATION | API Key |
---|---|
Key | X-Auth-Token |
Value | MY_ACCESS_TOKEN |
Example Request
- 200 - Success
- 401 - Unauthorized
- 502 - Bad Gateway
Example Request
200 - Success
curl --location 'https://api-sandbox.letpay.io/payment/MY_PAYMENT_TOKEN/cancel' \
--header 'X-Auth-Token: MY_ACCESS_TOKEN' \
--data '{
}'
Example Response
Header
Content-Type: application/json
Body
{
"transaction_status": "PROCESSING",
"payment_token": "8f048623-16c6-47da-aca1-546a16e8fb99",
"refresh_token": "MY_ACCESS_TOKEN"
}
Example Request
401 - Unauthorized
curl --location 'https://api-sandbox.letpay.io/payment/MY_PAYMENT_TOKEN/cancel' \
--header 'X-Auth-Token: INVALID_ACCESS_TOKEN' \
--data '{
}'
Example Response
Header
Content-Type: application/json
Body
{
"timestamp": "2024-01-16T19:52:18.186+0000",
"status": 401,
"error": "Unauthorized",
"message": "Access Denied",
"path": "/payment/633de157-9a42-4d30-bbad-bd9fb883e058/capture"
}
Example Request
502 - Bad Gateway
curl --location 'https://api-sandbox.letpay.io/payment/MY_PAYMENT_TOKEN/cancel' \
--header 'X-Auth-Token: MY_ACCESS_TOKEN' \
--data '{
}'
Example Response
Header
Content-Type: application/json
Body
{
"timestamp": "2024-01-16T20:12:28.156+0000",
"status": 502,
"error": "Bad Gateway",
"message": "There was an issue when contacting an external API, please contact support",
"path": "/payment/2f1c0103-b6fe-4e99-864c-d20c68b97a85/cancel",
"errors": [
{
"code": "00.03.0001",
"description": "There was an issue when contacting an external API, please contact support"
}
],
"refresh_token": "MY_ACCESS_TOKEN"
}