Skip to main content
GET
/
v1
/
sessions
Listar sessões
curl --request GET \
  --url https://api.malga.io/v1/sessions \
  --header 'X-Api-Key: <api-key>' \
  --header 'X-Client-Id: <api-key>'
import requests

url = "https://api.malga.io/v1/sessions"

headers = {
"X-Client-Id": "<api-key>",
"X-Api-Key": "<api-key>"
}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'X-Client-Id': '<api-key>', 'X-Api-Key': '<api-key>'}};

fetch('https://api.malga.io/v1/sessions', 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.malga.io/v1/sessions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <api-key>",
"X-Client-Id: <api-key>"
],
]);

$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.malga.io/v1/sessions"

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))

}
HttpResponse<String> response = Unirest.get("https://api.malga.io/v1/sessions")
.header("X-Client-Id", "<api-key>")
.header("X-Api-Key", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.malga.io/v1/sessions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-Client-Id"] = '<api-key>'
request["X-Api-Key"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "items": [
    {
      "id": "1b0c6960-702a-4074-95c2-eed2790c16a1",
      "name": "Nome da sessão",
      "status": "created",
      "isActive": true,
      "captchaEnabled": false,
      "clientId": "1b0c6960-702a-4074-95c2-eed2790c16a1",
      "orderId": null,
      "amount": 100,
      "currency": "BRL",
      "capture": true,
      "merchantId": "69aea152-ba70-49a3-a31c-044ac1651146",
      "dueDate": "2022-10-25T09:28:45.000Z",
      "description": "Promoção Black Friday",
      "statementDescriptor": "LOJA JOAO",
      "paymentMethods": [
        {
          "paymentType": "credit",
          "installments": 1
        }
      ],
      "items": [
        {
          "id": "78601913-a176-4d71-b7e8-abb6fc49a340",
          "name": "Item 1",
          "description": "Descrição do item",
          "unitPrice": 10000,
          "quantity": 1,
          "tangible": false
        }
      ],
      "createdAt": "2022-10-25T09:28:45.000Z",
      "updatedAt": "2022-10-25T09:28:45.000Z",
      "publicKey": "1b0c6960-702a-4074-95c2-eed2790c16a1",
      "paymentLink": "https://checkout.malga.io/1b0c6960-702a-4074-95c2-eed2790c16a1",
      "multiplePayments": {
        "allow": false,
        "maxPayments": null,
        "paymentCount": 0,
        "pendingCount": 0,
        "status": "active"
      }
    }
  ],
  "meta": {
    "totalItems": 1,
    "itemCount": 1,
    "itemsPerPage": 10,
    "totalPages": 1,
    "currentPage": 1
  }
}
{
"error": {
"code": 123,
"declinedCode": "<string>",
"key": "<string>",
"businessCode": "<string>",
"message": "<string>",
"details": "<array>"
}
}
{
"error": {
"code": 123,
"declinedCode": "<string>",
"key": "<string>",
"businessCode": "<string>",
"message": "<string>",
"details": "<array>"
}
}

Authorizations

X-Client-Id
string
header
required
X-Api-Key
string
header
required

Query Parameters

page
integer
default:1

Número da página a ser listada (mínimo 1)

Required range: x >= 1
limit
integer
default:10

Quantidade de registros por página (padrão 10; máximo 100)

Required range: 1 <= x <= 100
order
enum<string>
default:desc

Aceito como asc ou desc (padrão desc; valores inválidos caem para desc). A listagem atual ordena sempre por createdAt decrescente.

Available options:
asc,
desc
id
string<uuid>

Filtra pelo identificador da sessão

status
enum<string>

Filtra por status da sessão. Aceita múltiplos valores separados por vírgula

Available options:
created,
paid,
canceled,
voided
isActive
enum<string>

Filtra sessões ativadas ou desativadas. Aceita múltiplos valores separados por vírgula (true e/ou false)

Available options:
true,
false
merchantId
string<uuid>

Filtra pelo identificador do merchant

orderId
string

Filtra pelo identificador do pedido. Se informado, deve ter no mínimo 2 caracteres Unicode após o trim

Minimum string length: 2
multiplePayments.status
enum<string>

Filtra pela disponibilidade agregada do link (multiplePayments.status). Aceita múltiplos valores separados por vírgula. disabled cobre links temporariamente indisponíveis, incluindo expiração por dueDate.

Available options:
active,
disabled,
canceled
created.gt
string<date-time>

Filtra sessões com createdAt estritamente maior que o instante informado (RFC 3339 ou RFC 3339 com fração de segundos)

created.lt
string<date-time>

Filtra sessões com createdAt estritamente menor que o instante informado (RFC 3339 ou RFC 3339 com fração de segundos)

Response

Success

items
object[]
meta
object