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": "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"
}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": "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"
}Response
Venda encontrada
Venda paga com 2 ou 3 cartões
Was this page helpful?