Recuperar detalhes de uma Venda
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": "1c6381d1-9fcd-4e9a-a012-93cf0457dcb9",
"merchantId": "6d5b0464-090b-480b-a4e9-e1a0fb60a495",
"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": "3fd63170-ffa4-4b33-9d45-c3ab8fe6ce61"
}
},
{
"slotIndex": 1,
"amount": 5000,
"paymentMethod": {
"paymentType": "credit",
"installments": 3
},
"status": "pending",
"refundedAmount": 0,
"paymentSource": {
"sourceType": "token",
"tokenId": "c9783dec-0900-401c-8946-58e1b626f85a"
}
}
],
"createdAt": "2026-07-27T18:00:00Z",
"updatedAt": "2026-07-27T18:00:00Z"
}Purchases
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.
GET
/
v1
/
purchases
/
{id}
Recuperar detalhes de uma Venda
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": "1c6381d1-9fcd-4e9a-a012-93cf0457dcb9",
"merchantId": "6d5b0464-090b-480b-a4e9-e1a0fb60a495",
"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": "3fd63170-ffa4-4b33-9d45-c3ab8fe6ce61"
}
},
{
"slotIndex": 1,
"amount": 5000,
"paymentMethod": {
"paymentType": "credit",
"installments": 3
},
"status": "pending",
"refundedAmount": 0,
"paymentSource": {
"sourceType": "token",
"tokenId": "c9783dec-0900-401c-8946-58e1b626f85a"
}
}
],
"createdAt": "2026-07-27T18:00:00Z",
"updatedAt": "2026-07-27T18:00:00Z"
}Response
Venda encontrada
Venda paga com 2 ou 3 cartões
Was this page helpful?