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": "3fd63170-ffa4-4b33-9d45-c3ab8fe6ce61",
"status": "created",
"createdAt": "2026-07-27T18:00:00.000Z",
"updatedAt": "2026-07-27T18:00:00.000Z",
"clientId": "d5afb9e8-478e-4c58-970a-39ecdafedc55",
"merchantId": "6d5b0464-090b-480b-a4e9-e1a0fb60a495",
"action": "statusChanged",
"actions": [
"statusChanged"
],
"diff": {
"changes": {
"status": {
"from": null,
"to": "pending"
}
}
}
}
]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": "3fd63170-ffa4-4b33-9d45-c3ab8fe6ce61",
"status": "created",
"createdAt": "2026-07-27T18:00:00.000Z",
"updatedAt": "2026-07-27T18:00:00.000Z",
"clientId": "d5afb9e8-478e-4c58-970a-39ecdafedc55",
"merchantId": "6d5b0464-090b-480b-a4e9-e1a0fb60a495",
"action": "statusChanged",
"actions": [
"statusChanged"
],
"diff": {
"changes": {
"status": {
"from": null,
"to": "pending"
}
}
}
}
]Response
Marcos da Venda em ordem cronológica
Was this page helpful?