Recuperar o histórico de uma Venda
curl --request GET \
--url https://api.malga.io/v1/purchases/{id}/history \
--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}/history', 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}/history"
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": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"status": "created",
"createdAt": "2026-07-27T18:00:00.000Z",
"updatedAt": "2026-07-27T18:00:00.000Z",
"clientId": "0f1e2d3c-4b5a-6978-8796-a5b4c3d2e1f0",
"merchantId": "3b8c1f2a-4d5e-6f70-8192-a3b4c5d6e7f8",
"action": "statusChanged",
"actions": [
"statusChanged"
],
"diff": {
"changes": {
"status": {
"from": null,
"to": "pending"
}
}
}
}
]{
"error": {
"type": "unauthorized",
"code": 401,
"message": "Unauthorized",
"details": [
"unauthorized"
]
}
}{
"error": {
"type": "not_found",
"code": 404,
"message": "Resource not found",
"businessCode": "purchase_not_found",
"details": [
"purchase_not_found"
]
}
}Purchases
Recuperar o histórico de uma Venda
Retorna a linha do tempo da Venda como um array de marcos, em ordem crescente de createdAt. A resposta não é paginada e não usa o formato { items, meta }.
Toda Venda existente tem ao menos o marco created. O campo status de cada item é o nome do marco, não o status da Venda. Os marcos não incluem dados de cartão, metadata, fraudAnalysis nem IP.
Uma Venda inexistente, com id malformado ou de outro cliente devolve 404 com purchase_not_found.
GET
/
v1
/
purchases
/
{id}
/
history
Recuperar o histórico de uma Venda
curl --request GET \
--url https://api.malga.io/v1/purchases/{id}/history \
--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}/history', 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}/history"
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": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"status": "created",
"createdAt": "2026-07-27T18:00:00.000Z",
"updatedAt": "2026-07-27T18:00:00.000Z",
"clientId": "0f1e2d3c-4b5a-6978-8796-a5b4c3d2e1f0",
"merchantId": "3b8c1f2a-4d5e-6f70-8192-a3b4c5d6e7f8",
"action": "statusChanged",
"actions": [
"statusChanged"
],
"diff": {
"changes": {
"status": {
"from": null,
"to": "pending"
}
}
}
}
]{
"error": {
"type": "unauthorized",
"code": 401,
"message": "Unauthorized",
"details": [
"unauthorized"
]
}
}{
"error": {
"type": "not_found",
"code": 404,
"message": "Resource not found",
"businessCode": "purchase_not_found",
"details": [
"purchase_not_found"
]
}
}Path Parameters
Identificador da Venda
Response
Marcos da Venda em ordem cronológica
Nome do marco
Available options:
created, slot_authorized, pre_authorized, paid, failed, rollback_started, rollback_completed, rollback_failed, reconciliation_failed, abandoned, cancelled, cancel_failed, refund_requested, refund_completed, refund_failed, slot_cancelled Ação registrada no marco
Available options:
statusChanged, captureRequested, captureCompleted, captureFailed, voidRequested, voidCompleted, voidFailed, refundRequested, refundCompleted, refundFailed, chargeCancelled Ação registrada no marco
Available options:
statusChanged, captureRequested, captureCompleted, captureFailed, voidRequested, voidCompleted, voidFailed, refundRequested, refundCompleted, refundFailed, chargeCancelled Detalhe da mudança (changes). Não contém dados de cartão
Was this page helpful?