cURL
curl --request POST \
--url 'https://api.skalepayments.com.br/transactions' \
--header 'Content-Type: application/json' \
--header 'X-API-Key: sk_sua_chave_aqui' \
--header 'Idempotency-Key: pedido-PED-123' \
--data '{"amount":5000,"paymentMethod":"pix","customer":{"name":"Cliente Exemplo","email":"cliente@exemplo.com","phone":"11999999999","document":{"type":"cpf","number":"52998224725"}},"items":[{"title":"Produto 1","unitPrice":5000,"quantity":1,"tangible":false}]}'const response = await fetch('https://api.skalepayments.com.br/transactions', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': process.env.SKALE_API_KEY,
'Idempotency-Key': 'pedido-PED-123',
},
body: JSON.stringify({
amount: 5000,
paymentMethod: 'pix',
customer: {
name: 'Cliente Exemplo',
email: 'cliente@exemplo.com',
phone: '11999999999',
document: { type: 'cpf', number: '52998224725' },
},
items: [{ title: 'Produto 1', unitPrice: 5000, quantity: 1, tangible: false }],
}),
});
const transaction = await response.json();
import requests
url = "https://api.skalepayments.com.br/transactions"
payload = {
"amount": 5000,
"paymentMethod": "pix",
"pix": { "expiresInDays": 1 },
"customer": {
"name": "Cliente Exemplo",
"email": "cliente@exemplo.com",
"phone": "11999999999",
"document": {
"type": "cpf",
"number": "52998224725"
}
},
"items": [
{
"title": "Produto 1",
"unitPrice": 5000,
"quantity": 1,
"tangible": False,
"externalRef": "prod-123"
}
],
"metadata": { "pedido": "PED-123" },
"postbackUrl": "https://api.seudominio.com.br/webhooks/skale"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.skalepayments.com.br/transactions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 5000,
'paymentMethod' => 'pix',
'pix' => [
'expiresInDays' => 1
],
'customer' => [
'name' => 'Cliente Exemplo',
'email' => 'cliente@exemplo.com',
'phone' => '11999999999',
'document' => [
'type' => 'cpf',
'number' => '52998224725'
]
],
'items' => [
[
'title' => 'Produto 1',
'unitPrice' => 5000,
'quantity' => 1,
'tangible' => false,
'externalRef' => 'prod-123'
]
],
'metadata' => [
'pedido' => 'PED-123'
],
'postbackUrl' => 'https://api.seudominio.com.br/webhooks/skale'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.skalepayments.com.br/transactions"
payload := strings.NewReader("{\n \"amount\": 5000,\n \"paymentMethod\": \"pix\",\n \"pix\": {\n \"expiresInDays\": 1\n },\n \"customer\": {\n \"name\": \"Cliente Exemplo\",\n \"email\": \"cliente@exemplo.com\",\n \"phone\": \"11999999999\",\n \"document\": {\n \"type\": \"cpf\",\n \"number\": \"52998224725\"\n }\n },\n \"items\": [\n {\n \"title\": \"Produto 1\",\n \"unitPrice\": 5000,\n \"quantity\": 1,\n \"tangible\": false,\n \"externalRef\": \"prod-123\"\n }\n ],\n \"metadata\": {\n \"pedido\": \"PED-123\"\n },\n \"postbackUrl\": \"https://api.seudominio.com.br/webhooks/skale\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.skalepayments.com.br/transactions")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 5000,\n \"paymentMethod\": \"pix\",\n \"pix\": {\n \"expiresInDays\": 1\n },\n \"customer\": {\n \"name\": \"Cliente Exemplo\",\n \"email\": \"cliente@exemplo.com\",\n \"phone\": \"11999999999\",\n \"document\": {\n \"type\": \"cpf\",\n \"number\": \"52998224725\"\n }\n },\n \"items\": [\n {\n \"title\": \"Produto 1\",\n \"unitPrice\": 5000,\n \"quantity\": 1,\n \"tangible\": false,\n \"externalRef\": \"prod-123\"\n }\n ],\n \"metadata\": {\n \"pedido\": \"PED-123\"\n },\n \"postbackUrl\": \"https://api.seudominio.com.br/webhooks/skale\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.skalepayments.com.br/transactions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 5000,\n \"paymentMethod\": \"pix\",\n \"pix\": {\n \"expiresInDays\": 1\n },\n \"customer\": {\n \"name\": \"Cliente Exemplo\",\n \"email\": \"cliente@exemplo.com\",\n \"phone\": \"11999999999\",\n \"document\": {\n \"type\": \"cpf\",\n \"number\": \"52998224725\"\n }\n },\n \"items\": [\n {\n \"title\": \"Produto 1\",\n \"unitPrice\": 5000,\n \"quantity\": 1,\n \"tangible\": false,\n \"externalRef\": \"prod-123\"\n }\n ],\n \"metadata\": {\n \"pedido\": \"PED-123\"\n },\n \"postbackUrl\": \"https://api.seudominio.com.br/webhooks/skale\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"id": "txn_abc123",
"status": "waiting_payment",
"pix": {
"qrcode": "00020126360014BR.GOV.BCB.PIX0114...",
"end2EndId": null,
"qrcodeImage": null
},
"metadata": {
"pedido": "PED-123"
},
"postbackUrl": "https://api.seudominio.com.br/webhooks/skale",
"statusCode": 201,
"timestamp": "2026-11-10T15:30:00-03:00"
}{
"success": false,
"statusCode": 123,
"message": "<string>",
"code": "HTTP_EXCEPTION",
"timestamp": "2023-11-07T05:31:56Z",
"path": "<string>",
"method": "<string>"
}{
"success": false,
"statusCode": 123,
"message": "<string>",
"code": "HTTP_EXCEPTION",
"timestamp": "2023-11-07T05:31:56Z",
"path": "<string>",
"method": "<string>"
}{
"success": false,
"statusCode": 123,
"message": "<string>",
"code": "HTTP_EXCEPTION",
"timestamp": "2023-11-07T05:31:56Z",
"path": "<string>",
"method": "<string>"
}{
"success": false,
"statusCode": 123,
"message": "<string>",
"code": "HTTP_EXCEPTION",
"timestamp": "2023-11-07T05:31:56Z",
"path": "<string>",
"method": "<string>"
}Transações
Criar transação
Cria uma cobrança PIX e retorna os dados para pagamento.
POST
/
transactions
cURL
curl --request POST \
--url 'https://api.skalepayments.com.br/transactions' \
--header 'Content-Type: application/json' \
--header 'X-API-Key: sk_sua_chave_aqui' \
--header 'Idempotency-Key: pedido-PED-123' \
--data '{"amount":5000,"paymentMethod":"pix","customer":{"name":"Cliente Exemplo","email":"cliente@exemplo.com","phone":"11999999999","document":{"type":"cpf","number":"52998224725"}},"items":[{"title":"Produto 1","unitPrice":5000,"quantity":1,"tangible":false}]}'const response = await fetch('https://api.skalepayments.com.br/transactions', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': process.env.SKALE_API_KEY,
'Idempotency-Key': 'pedido-PED-123',
},
body: JSON.stringify({
amount: 5000,
paymentMethod: 'pix',
customer: {
name: 'Cliente Exemplo',
email: 'cliente@exemplo.com',
phone: '11999999999',
document: { type: 'cpf', number: '52998224725' },
},
items: [{ title: 'Produto 1', unitPrice: 5000, quantity: 1, tangible: false }],
}),
});
const transaction = await response.json();
import requests
url = "https://api.skalepayments.com.br/transactions"
payload = {
"amount": 5000,
"paymentMethod": "pix",
"pix": { "expiresInDays": 1 },
"customer": {
"name": "Cliente Exemplo",
"email": "cliente@exemplo.com",
"phone": "11999999999",
"document": {
"type": "cpf",
"number": "52998224725"
}
},
"items": [
{
"title": "Produto 1",
"unitPrice": 5000,
"quantity": 1,
"tangible": False,
"externalRef": "prod-123"
}
],
"metadata": { "pedido": "PED-123" },
"postbackUrl": "https://api.seudominio.com.br/webhooks/skale"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.skalepayments.com.br/transactions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 5000,
'paymentMethod' => 'pix',
'pix' => [
'expiresInDays' => 1
],
'customer' => [
'name' => 'Cliente Exemplo',
'email' => 'cliente@exemplo.com',
'phone' => '11999999999',
'document' => [
'type' => 'cpf',
'number' => '52998224725'
]
],
'items' => [
[
'title' => 'Produto 1',
'unitPrice' => 5000,
'quantity' => 1,
'tangible' => false,
'externalRef' => 'prod-123'
]
],
'metadata' => [
'pedido' => 'PED-123'
],
'postbackUrl' => 'https://api.seudominio.com.br/webhooks/skale'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.skalepayments.com.br/transactions"
payload := strings.NewReader("{\n \"amount\": 5000,\n \"paymentMethod\": \"pix\",\n \"pix\": {\n \"expiresInDays\": 1\n },\n \"customer\": {\n \"name\": \"Cliente Exemplo\",\n \"email\": \"cliente@exemplo.com\",\n \"phone\": \"11999999999\",\n \"document\": {\n \"type\": \"cpf\",\n \"number\": \"52998224725\"\n }\n },\n \"items\": [\n {\n \"title\": \"Produto 1\",\n \"unitPrice\": 5000,\n \"quantity\": 1,\n \"tangible\": false,\n \"externalRef\": \"prod-123\"\n }\n ],\n \"metadata\": {\n \"pedido\": \"PED-123\"\n },\n \"postbackUrl\": \"https://api.seudominio.com.br/webhooks/skale\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.skalepayments.com.br/transactions")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 5000,\n \"paymentMethod\": \"pix\",\n \"pix\": {\n \"expiresInDays\": 1\n },\n \"customer\": {\n \"name\": \"Cliente Exemplo\",\n \"email\": \"cliente@exemplo.com\",\n \"phone\": \"11999999999\",\n \"document\": {\n \"type\": \"cpf\",\n \"number\": \"52998224725\"\n }\n },\n \"items\": [\n {\n \"title\": \"Produto 1\",\n \"unitPrice\": 5000,\n \"quantity\": 1,\n \"tangible\": false,\n \"externalRef\": \"prod-123\"\n }\n ],\n \"metadata\": {\n \"pedido\": \"PED-123\"\n },\n \"postbackUrl\": \"https://api.seudominio.com.br/webhooks/skale\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.skalepayments.com.br/transactions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 5000,\n \"paymentMethod\": \"pix\",\n \"pix\": {\n \"expiresInDays\": 1\n },\n \"customer\": {\n \"name\": \"Cliente Exemplo\",\n \"email\": \"cliente@exemplo.com\",\n \"phone\": \"11999999999\",\n \"document\": {\n \"type\": \"cpf\",\n \"number\": \"52998224725\"\n }\n },\n \"items\": [\n {\n \"title\": \"Produto 1\",\n \"unitPrice\": 5000,\n \"quantity\": 1,\n \"tangible\": false,\n \"externalRef\": \"prod-123\"\n }\n ],\n \"metadata\": {\n \"pedido\": \"PED-123\"\n },\n \"postbackUrl\": \"https://api.seudominio.com.br/webhooks/skale\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"id": "txn_abc123",
"status": "waiting_payment",
"pix": {
"qrcode": "00020126360014BR.GOV.BCB.PIX0114...",
"end2EndId": null,
"qrcodeImage": null
},
"metadata": {
"pedido": "PED-123"
},
"postbackUrl": "https://api.seudominio.com.br/webhooks/skale",
"statusCode": 201,
"timestamp": "2026-11-10T15:30:00-03:00"
}{
"success": false,
"statusCode": 123,
"message": "<string>",
"code": "HTTP_EXCEPTION",
"timestamp": "2023-11-07T05:31:56Z",
"path": "<string>",
"method": "<string>"
}{
"success": false,
"statusCode": 123,
"message": "<string>",
"code": "HTTP_EXCEPTION",
"timestamp": "2023-11-07T05:31:56Z",
"path": "<string>",
"method": "<string>"
}{
"success": false,
"statusCode": 123,
"message": "<string>",
"code": "HTTP_EXCEPTION",
"timestamp": "2023-11-07T05:31:56Z",
"path": "<string>",
"method": "<string>"
}{
"success": false,
"statusCode": 123,
"message": "<string>",
"code": "HTTP_EXCEPTION",
"timestamp": "2023-11-07T05:31:56Z",
"path": "<string>",
"method": "<string>"
}O campo
amount e os demais valores monetários da requisição usam centavos.Cabeçalhos
Corpo
application/json
Resposta
Transação criada com sucesso
