curl --request POST \
--url https://api.example.com/spi/v1/transfers/{id}/refunds \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Account-Id: <x-account-id>' \
--header 'X-Idempotency: <x-idempotency>' \
--data '
{
"amount": "100.00",
"reason": "Estorno solicitado pelo pagador",
"reasonCode": "MD06"
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/spi/v1/transfers/{id}/refunds"
payload := strings.NewReader("{\n \"amount\": \"100.00\",\n \"reason\": \"Estorno solicitado pelo pagador\",\n \"reasonCode\": \"MD06\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Idempotency", "<x-idempotency>")
req.Header.Add("X-Account-Id", "<x-account-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}const options = {
method: 'POST',
headers: {
'X-Idempotency': '<x-idempotency>',
'X-Account-Id': '<x-account-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: '100.00',
reason: 'Estorno solicitado pelo pagador',
reasonCode: 'MD06'
})
};
fetch('https://api.example.com/spi/v1/transfers/{id}/refunds', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.example.com/spi/v1/transfers/{id}/refunds"
payload = {
"amount": "100.00",
"reason": "Estorno solicitado pelo pagador",
"reasonCode": "MD06"
}
headers = {
"X-Idempotency": "<x-idempotency>",
"X-Account-Id": "<x-account-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"amount": "100.00",
"createdAt": "2026-05-06T10:45:00Z",
"id": "019606b1-3b4c-7d8e-9f01-234567890dee",
"originalEndToEndId": "E12345678202605061030abcdef12345",
"reasonCode": "MD06",
"status": "COMPLETED",
"type": "OUTBOUND",
"updatedAt": "2026-05-06T10:45:30Z",
"accountId": "019606a0-1a2b-7c3d-8e4f-567890123abc",
"deletedAt": "2023-11-07T05:31:56Z",
"description": "Estorno solicitado pelo pagador",
"ledger": {
"destinationOperationId": "019606a5-7f80-7182-3c4d-56789012cdf1",
"revert": {
"destinationOperationId": "019606a5-7f80-7182-3c4d-56789012cdf1",
"sourceOperationId": "019606a5-7f80-7182-3c4d-56789012cdf0",
"transactionId": "019606a5-7f80-7182-3c4d-56789012cdef"
},
"sourceOperationId": "019606a5-7f80-7182-3c4d-56789012cdf0",
"transactionId": "019606a5-7f80-7182-3c4d-56789012cdef"
},
"metadata": {},
"returnEndToEndId": "D12345678202605061045fedcba54321"
}{
"code": "PIX-0030",
"title": "Idempotency Key Required",
"message": "The Idempotency-Key header is required for this operation and must be within the accepted length."
}{
"type": "https://errors.lerian.studio/v1/PIX-0400",
"title": "Not Found",
"status": 404,
"detail": "Original transfer does not exist.",
"code": "PIX-0400"
}{
"type": "https://errors.lerian.studio/v1/PIX-0406",
"title": "Conflict",
"status": 409,
"detail": "The refund changed during this request. Retry the operation.",
"code": "PIX-0406"
}{
"code": "PIX-0031",
"title": "Idempotency Key Conflict",
"message": "The Idempotency-Key was already used with a different request."
}{
"type": "https://errors.lerian.studio/v1/PIX-0016",
"title": "Unsupported Media Type",
"status": 415,
"detail": "The request body must be sent with Content-Type: application/json.",
"code": "PIX-0016"
}{
"type": "https://errors.lerian.studio/v1/PIX-0401",
"title": "Unprocessable Entity",
"status": 422,
"detail": "Original transfer is not in COMPLETED status.",
"code": "PIX-0401"
}{
"type": "https://errors.lerian.studio/v1/PIX-0000",
"title": "Internal Server Error",
"status": 500,
"detail": "The server could not complete the request. Please try again later.",
"code": "PIX-0000"
}{
"type": "https://errors.lerian.studio/v1/PIX-0404",
"title": "Bad Gateway",
"status": 502,
"detail": "The server could not complete the request. Please try again later.",
"code": "PIX-0404"
}{
"code": "PIX-0032",
"title": "Idempotency Unavailable",
"message": "The request was not processed because the idempotency store is unavailable. Please retry."
}{
"code": "ERR-0001",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}Create an outbound Pix refund (MED)
Issues a refund against a previously completed CASHIN transfer with a structured pacs.004 reasonCode.
curl --request POST \
--url https://api.example.com/spi/v1/transfers/{id}/refunds \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Account-Id: <x-account-id>' \
--header 'X-Idempotency: <x-idempotency>' \
--data '
{
"amount": "100.00",
"reason": "Estorno solicitado pelo pagador",
"reasonCode": "MD06"
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/spi/v1/transfers/{id}/refunds"
payload := strings.NewReader("{\n \"amount\": \"100.00\",\n \"reason\": \"Estorno solicitado pelo pagador\",\n \"reasonCode\": \"MD06\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Idempotency", "<x-idempotency>")
req.Header.Add("X-Account-Id", "<x-account-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}const options = {
method: 'POST',
headers: {
'X-Idempotency': '<x-idempotency>',
'X-Account-Id': '<x-account-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: '100.00',
reason: 'Estorno solicitado pelo pagador',
reasonCode: 'MD06'
})
};
fetch('https://api.example.com/spi/v1/transfers/{id}/refunds', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.example.com/spi/v1/transfers/{id}/refunds"
payload = {
"amount": "100.00",
"reason": "Estorno solicitado pelo pagador",
"reasonCode": "MD06"
}
headers = {
"X-Idempotency": "<x-idempotency>",
"X-Account-Id": "<x-account-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"amount": "100.00",
"createdAt": "2026-05-06T10:45:00Z",
"id": "019606b1-3b4c-7d8e-9f01-234567890dee",
"originalEndToEndId": "E12345678202605061030abcdef12345",
"reasonCode": "MD06",
"status": "COMPLETED",
"type": "OUTBOUND",
"updatedAt": "2026-05-06T10:45:30Z",
"accountId": "019606a0-1a2b-7c3d-8e4f-567890123abc",
"deletedAt": "2023-11-07T05:31:56Z",
"description": "Estorno solicitado pelo pagador",
"ledger": {
"destinationOperationId": "019606a5-7f80-7182-3c4d-56789012cdf1",
"revert": {
"destinationOperationId": "019606a5-7f80-7182-3c4d-56789012cdf1",
"sourceOperationId": "019606a5-7f80-7182-3c4d-56789012cdf0",
"transactionId": "019606a5-7f80-7182-3c4d-56789012cdef"
},
"sourceOperationId": "019606a5-7f80-7182-3c4d-56789012cdf0",
"transactionId": "019606a5-7f80-7182-3c4d-56789012cdef"
},
"metadata": {},
"returnEndToEndId": "D12345678202605061045fedcba54321"
}{
"code": "PIX-0030",
"title": "Idempotency Key Required",
"message": "The Idempotency-Key header is required for this operation and must be within the accepted length."
}{
"type": "https://errors.lerian.studio/v1/PIX-0400",
"title": "Not Found",
"status": 404,
"detail": "Original transfer does not exist.",
"code": "PIX-0400"
}{
"type": "https://errors.lerian.studio/v1/PIX-0406",
"title": "Conflict",
"status": 409,
"detail": "The refund changed during this request. Retry the operation.",
"code": "PIX-0406"
}{
"code": "PIX-0031",
"title": "Idempotency Key Conflict",
"message": "The Idempotency-Key was already used with a different request."
}{
"type": "https://errors.lerian.studio/v1/PIX-0016",
"title": "Unsupported Media Type",
"status": 415,
"detail": "The request body must be sent with Content-Type: application/json.",
"code": "PIX-0016"
}{
"type": "https://errors.lerian.studio/v1/PIX-0401",
"title": "Unprocessable Entity",
"status": 422,
"detail": "Original transfer is not in COMPLETED status.",
"code": "PIX-0401"
}{
"type": "https://errors.lerian.studio/v1/PIX-0000",
"title": "Internal Server Error",
"status": 500,
"detail": "The server could not complete the request. Please try again later.",
"code": "PIX-0000"
}{
"type": "https://errors.lerian.studio/v1/PIX-0404",
"title": "Bad Gateway",
"status": 502,
"detail": "The server could not complete the request. Please try again later.",
"code": "PIX-0404"
}{
"code": "PIX-0032",
"title": "Idempotency Unavailable",
"message": "The request was not processed because the idempotency store is unavailable. Please retry."
}{
"code": "ERR-0001",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}Autorizaciones
JWT bearer token issued by the identity provider.
Encabezados
REQUIRED. Client-supplied replay key, at most 64 bytes. A request without it is refused with PIX-0030 @ 400 before the handler runs. Replaying the same key with a divergent method, URL or body is PIX-0031 @ 412.
1 - 64Account UUID
"019606a1-3b4c-7d8e-9f01-234567890abc"
Parámetros de ruta
Original transfer UUID
"0196070b-1234-7890-abcd-ef0123456789"
Cuerpo
Respuesta
Created
"100.00"
"2026-05-06T10:45:00Z"
"019606b1-3b4c-7d8e-9f01-234567890dee"
"E12345678202605061030abcdef12345"
"MD06"
"COMPLETED"
"OUTBOUND"
"2026-05-06T10:45:30Z"
"019606a0-1a2b-7c3d-8e4f-567890123abc"
"Estorno solicitado pelo pagador"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
"D12345678202605061045fedcba54321"
¿Esta página le ayudó?

