curl --request GET \
--url https://api.malga.io/v1/purchases/{id} \
--header 'X-Api-Key: <api-key>' \
--header 'X-Client-Id: <api-key>'const options = {method: 'GET', headers: {'X-Client-Id': '<api-key>', 'X-Api-Key': '<api-key>'}};
fetch('https://api.malga.io/v1/purchases/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.malga.io/v1/purchases/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Client-Id", "<api-key>")
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "550e8400-e29b-41d4-a716-446655440000",
"merchantId": "3b8c1f2a-4d5e-6f70-8192-a3b4c5d6e7f8",
"amount": 15000,
"currency": "BRL",
"capture": true,
"status": "pending",
"orderId": "pedido-1001",
"payments": [
{
"slotIndex": 0,
"amount": 10000,
"paymentMethod": {
"paymentType": "credit",
"installments": 1
},
"status": "pending",
"refundedAmount": 0,
"paymentSource": {
"sourceType": "card",
"cardId": "7c9e6679-7425-40de-944b-e07fc1f90ae7"
}
},
{
"slotIndex": 1,
"amount": 5000,
"paymentMethod": {
"paymentType": "credit",
"installments": 3
},
"status": "pending",
"refundedAmount": 0,
"paymentSource": {
"sourceType": "token",
"tokenId": "9f8e7d6c-5b4a-3928-1706-5e4d3c2b1a09"
}
}
],
"createdAt": "2026-07-27T18:00:00Z",
"updatedAt": "2026-07-27T18:00:00Z"
}Recuperar detalhes de uma Venda
Retorna a Venda e o estado de cada cartão. Use este endpoint para acompanhar o desfecho do processamento assíncrono.
Uma Venda inexistente ou de outro cliente devolve 404 com purchase_not_found, sem distinção entre os dois casos.
Depois da autorização, payments[] pode trazer chargeId, declineReason (somente o código de recusa) e card (brand e last4). Sem esses dados, o campo correspondente é omitido.
Quando a Venda está pending e a operação mais recente terminou com uma anomalia (reconciliation_failed, amount_mismatch ou claims_exhausted), a resposta traz pendingReview. Nesse caso, interrompa o polling automático: a Venda permanece pending.
curl --request GET \
--url https://api.malga.io/v1/purchases/{id} \
--header 'X-Api-Key: <api-key>' \
--header 'X-Client-Id: <api-key>'const options = {method: 'GET', headers: {'X-Client-Id': '<api-key>', 'X-Api-Key': '<api-key>'}};
fetch('https://api.malga.io/v1/purchases/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.malga.io/v1/purchases/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Client-Id", "<api-key>")
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "550e8400-e29b-41d4-a716-446655440000",
"merchantId": "3b8c1f2a-4d5e-6f70-8192-a3b4c5d6e7f8",
"amount": 15000,
"currency": "BRL",
"capture": true,
"status": "pending",
"orderId": "pedido-1001",
"payments": [
{
"slotIndex": 0,
"amount": 10000,
"paymentMethod": {
"paymentType": "credit",
"installments": 1
},
"status": "pending",
"refundedAmount": 0,
"paymentSource": {
"sourceType": "card",
"cardId": "7c9e6679-7425-40de-944b-e07fc1f90ae7"
}
},
{
"slotIndex": 1,
"amount": 5000,
"paymentMethod": {
"paymentType": "credit",
"installments": 3
},
"status": "pending",
"refundedAmount": 0,
"paymentSource": {
"sourceType": "token",
"tokenId": "9f8e7d6c-5b4a-3928-1706-5e4d3c2b1a09"
}
}
],
"createdAt": "2026-07-27T18:00:00Z",
"updatedAt": "2026-07-27T18:00:00Z"
}Path Parameters
Identificador da Venda
Response
Venda encontrada
Venda paga com 2 ou 3 cartões
Identificador da Venda
Identificador do merchant da Venda
Valor total da Venda em centavos
x >= 200BRL Indica o modo de captura informado na criação. false exige captura explícita; true captura automaticamente
Status da Venda
pending, paid, failed, cancelled 2 - 3 elementsShow child attributes
Show child attributes
Sinal de que a Venda precisa de revisão. A Venda permanece pending e você deve interromper o polling automático
Show child attributes
Show child attributes
Operação pending ou processing em andamento na Venda (a mais recente). Omitido quando não há operação ativa. Nas respostas 202, a operação aceita vem em operation
Show child attributes
Show child attributes
Identificador do pedido no seu sistema
Session de origem informada na criação
Metadados informados na criação. Omitido quando não enviados
Regras de split informadas na criação. Omitido quando não enviadas
Show child attributes
Show child attributes
Was this page helpful?