curl --request GET \
--url https://api.sandbox.gravitypay.app/v1/payments \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sandbox.gravitypay.app/v1/payments"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sandbox.gravitypay.app/v1/payments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.gravitypay.app/v1/payments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.gravitypay.app/v1/payments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sandbox.gravitypay.app/v1/payments")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.gravitypay.app/v1/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "list",
"data": [
{
"id": "clz8h2k9x0000ab12cd34ef56",
"object": "payment",
"status": "PENDING",
"amountInCents": 123,
"currency": "brl",
"platformFeeInCents": 123,
"netInCents": 123,
"paymentMethod": "pix",
"provider": "PAGARME",
"product": {
"id": "<string>",
"name": "<string>"
},
"offerId": "<string>",
"offer": {
"id": "<string>",
"name": "<string>",
"description": "<string>",
"billingType": "ONE_TIME",
"billingCycle": "<string>",
"priceInCents": 123,
"currency": "<string>",
"setupFeeInCents": 123,
"trialDays": 123,
"maxCharges": 123,
"statementDescriptor": "<string>",
"product": {
"id": "<string>",
"name": "<string>"
}
},
"subscriptionId": "<string>",
"chargeId": "<string>",
"customer": {
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"document": "<string>",
"address": {
"zipCode": "<string>",
"street": "<string>",
"number": "<string>",
"complement": "<string>",
"neighborhood": "<string>",
"city": "<string>",
"state": "<string>"
}
},
"externalId": "<string>",
"storeId": "<string>",
"metadata": {},
"tracking": {},
"salesRep": {
"id": "<string>",
"name": "<string>",
"refCode": "<string>"
},
"salesRefCode": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"page": 123,
"perPage": 123,
"total": 123,
"totalPages": 123,
"hasMore": true
}{
"error": {
"type": "<string>",
"message": "<string>",
"param": "<string>",
"requiredScope": "<string>"
}
}{
"error": {
"type": "<string>",
"message": "<string>",
"param": "<string>",
"requiredScope": "<string>"
}
}{
"error": {
"type": "insufficient_scope",
"message": "Esta chave de API não tem o escopo students:read.",
"requiredScope": "students:read"
}
}Listar cobranças
Lista paginada das cobranças (vendas) da loja da chave. Todos os filtros são opcionais; sem filtro traz tudo. A chave é escopada a uma única loja. Cada item traz o customer completo (com endereço/CEP) e a offer detalhada — o valor cheio da oferta/lote, distinto de amountInCents (o valor pago, que pode ser uma parcela).
Escopo exigido: payments:read.
curl --request GET \
--url https://api.sandbox.gravitypay.app/v1/payments \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sandbox.gravitypay.app/v1/payments"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sandbox.gravitypay.app/v1/payments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.gravitypay.app/v1/payments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.gravitypay.app/v1/payments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sandbox.gravitypay.app/v1/payments")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.gravitypay.app/v1/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "list",
"data": [
{
"id": "clz8h2k9x0000ab12cd34ef56",
"object": "payment",
"status": "PENDING",
"amountInCents": 123,
"currency": "brl",
"platformFeeInCents": 123,
"netInCents": 123,
"paymentMethod": "pix",
"provider": "PAGARME",
"product": {
"id": "<string>",
"name": "<string>"
},
"offerId": "<string>",
"offer": {
"id": "<string>",
"name": "<string>",
"description": "<string>",
"billingType": "ONE_TIME",
"billingCycle": "<string>",
"priceInCents": 123,
"currency": "<string>",
"setupFeeInCents": 123,
"trialDays": 123,
"maxCharges": 123,
"statementDescriptor": "<string>",
"product": {
"id": "<string>",
"name": "<string>"
}
},
"subscriptionId": "<string>",
"chargeId": "<string>",
"customer": {
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"document": "<string>",
"address": {
"zipCode": "<string>",
"street": "<string>",
"number": "<string>",
"complement": "<string>",
"neighborhood": "<string>",
"city": "<string>",
"state": "<string>"
}
},
"externalId": "<string>",
"storeId": "<string>",
"metadata": {},
"tracking": {},
"salesRep": {
"id": "<string>",
"name": "<string>",
"refCode": "<string>"
},
"salesRefCode": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"page": 123,
"perPage": 123,
"total": 123,
"totalPages": 123,
"hasMore": true
}{
"error": {
"type": "<string>",
"message": "<string>",
"param": "<string>",
"requiredScope": "<string>"
}
}{
"error": {
"type": "<string>",
"message": "<string>",
"param": "<string>",
"requiredScope": "<string>"
}
}{
"error": {
"type": "insufficient_scope",
"message": "Esta chave de API não tem o escopo students:read.",
"requiredScope": "students:read"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Página (começa em 1).
x >= 1Itens por página (máx. 500; default 500).
1 <= x <= 500Filtra por status do pagamento.
PENDING, PAID, FAILED, REFUNDED, EXPIRED Filtra os pagamentos de um produto.
Início do período (filtra por createdAt). Aceita YYYY-MM-DD (início do dia, UTC) ou ISO 8601 completo.
Fim do período (filtra por createdAt). YYYY-MM-DD é tratado como o FIM do dia (23:59:59.999 UTC), então o dia inteiro entra.
Opcional. Se enviado, precisa ser o id da loja desta chave — não há agregação cross-store; um id diferente retorna 400.
Filtra pelos pagamentos de um vendedor. Use o literal none para as vendas diretas (sem vendedor). Um id que não existe na loja da chave devolve lista vazia, sem erro.
Filtra pelo código de referência bruto gravado no pagamento (igualdade exata, sem normalizar caixa/espaço) — mesmo quando o código não resolveu para nenhum vendedor.
Filtra por chave/valor dentro de metadata ou tracking (UTMs). Um par malformado, ou mais de 10 pares, responde 400 sem aplicar nenhum filtro de metadata.
JSON de até 10 pares {scope, key, value}. scope é metadata ou tracking. value casa por igualdade exata. Vários pares combinam em AND. Exemplo: [{"scope":"tracking","key":"utm_source","value":"facebook"}].

