Introduction
API ClicPay v2 - M-Pesa, e-Mola, NetShop e autenticação
ClicPay API — v2
Visão geral
Esta documentação apresenta a API ClicPay v2, destinada à integração de soluções de pagamento (M-Pesa, e-Mola, Mkesh, NetShop), gestão de carteiras digitais e consulta de estados de transações.
Objetivo
Permitir que aplicações de terceiros criem e confirmem pagamentos, consultem o estado de transações, obtenham históricos e gerenciem carteiras de utilizadores de forma segura e auditável.
Autenticação
A API utiliza OAuth2 (Laravel Passport). Para testar endpoints protegidos na interface, insira um token Bearer através da opção Authorize. Sem um token válido, os pedidos autenticados irão retornar erros de autorização.
Testes e exemplos
Utilize a funcionalidade Try It Out para executar pedidos diretamente a partir da documentação. Os exemplos de código disponíveis no canto superior direito suportam Bash, JavaScript, PHP e Python.
Exemplos de pedidos e respostas
Sempre que possível, cada endpoint inclui exemplos de payloads de pedido e exemplos de resposta. Estes servem como referência, mas os valores reais podem variar conforme o ambiente (sandbox / produção).
Boas práticas de integração
- Forneça números de telefone no formato indicado na descrição de cada endpoint.
- Valide localmente os campos obrigatórios antes de enviar pedidos para evitar chamadas desnecessárias.
- Utilize os códigos de erro e mensagens retornadas para tratamento de falhas.
Autorização
Para autenticar pedidos, inclua um cabeçalho Authorization com o valor "Bearer {YOUR_AUTH_KEY}".
Todos os endpoints autenticados estão marcados com um distintivo requer autenticação na documentação abaixo.
Para testar a API, insira o seu token Bearer no campo "Authorize". Pode obter um token através do endpoint de autenticação da API.
Transações M-Pesa
POST api/v2/wallets/{wallet_id}/c2b/mpesa
requires authentication
Example request:
curl --request POST \
"http://localhost:9000/api/v2/wallets/144365/c2b/mpesa" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"msisdn\": \"841234567\",
\"amount\": 500,
\"reference_description\": \"Compra online\",
\"internal_notes\": \"Pedido #12345\"
}"
const url = new URL(
"http://localhost:9000/api/v2/wallets/144365/c2b/mpesa"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"msisdn": "841234567",
"amount": 500,
"reference_description": "Compra online",
"internal_notes": "Pedido #12345"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:9000/api/v2/wallets/144365/c2b/mpesa';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'msisdn' => '841234567',
'amount' => 500.0,
'reference_description' => 'Compra online',
'internal_notes' => 'Pedido #12345',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'http://localhost:9000/api/v2/wallets/144365/c2b/mpesa'
payload = {
"msisdn": "841234567",
"amount": 500,
"reference_description": "Compra online",
"internal_notes": "Pedido #12345"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"message": "Transação iniciada com sucesso",
"clicpay_reference": "CP123456789",
"status": "pending",
"transaction_id": 124
}
Example response (400):
{
"errors": {
"msisdn": [
"Número de telefone inválido"
],
"amount": [
"Valor deve ser entre 1 e 50000"
]
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (403):
{
"message": "Acesso negado à carteira"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
clicpay_reference
string
Referência única da transação
status
string
Status atual (pending/successful/failed)
transaction_id
integer
ID interno da transação
POST api/v2/wallets/{wallet_id}/c2b/mpesa/direct
requires authentication
Example request:
curl --request POST \
"http://localhost:9000/api/v2/wallets/144365/c2b/mpesa/direct" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"msisdn\": \"841234567\",
\"amount\": 500,
\"reference_description\": \"Compra online\",
\"internal_notes\": \"Pedido #12345\"
}"
const url = new URL(
"http://localhost:9000/api/v2/wallets/144365/c2b/mpesa/direct"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"msisdn": "841234567",
"amount": 500,
"reference_description": "Compra online",
"internal_notes": "Pedido #12345"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:9000/api/v2/wallets/144365/c2b/mpesa/direct';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'msisdn' => '841234567',
'amount' => 500.0,
'reference_description' => 'Compra online',
'internal_notes' => 'Pedido #12345',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'http://localhost:9000/api/v2/wallets/144365/c2b/mpesa/direct'
payload = {
"msisdn": "841234567",
"amount": 500,
"reference_description": "Compra online",
"internal_notes": "Pedido #12345"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"message": "Transação iniciada com sucesso",
"clicpay_reference": "CP123456789",
"status": "pending",
"transaction_id": 124
}
Example response (400):
{
"errors": {
"msisdn": [
"Número de telefone inválido"
],
"amount": [
"Valor deve ser entre 1 e 50000"
]
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (403):
{
"message": "Acesso negado à carteira"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
clicpay_reference
string
Referência único da transação
status
string
Status atual (pending/successful/failed)
transaction_id
integer
ID interno da transação
POST api/v2/wallets/{wallet_id}/b2c/mpesa
requires authentication
Example request:
curl --request POST \
"http://localhost:9000/api/v2/wallets/144365/b2c/mpesa" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"msisdn\": \"841234567\",
\"amount\": 500,
\"reference_description\": \"Compra online\",
\"internal_notes\": \"Pedido #12345\"
}"
const url = new URL(
"http://localhost:9000/api/v2/wallets/144365/b2c/mpesa"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"msisdn": "841234567",
"amount": 500,
"reference_description": "Compra online",
"internal_notes": "Pedido #12345"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:9000/api/v2/wallets/144365/b2c/mpesa';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'msisdn' => '841234567',
'amount' => 500.0,
'reference_description' => 'Compra online',
'internal_notes' => 'Pedido #12345',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'http://localhost:9000/api/v2/wallets/144365/b2c/mpesa'
payload = {
"msisdn": "841234567",
"amount": 500,
"reference_description": "Compra online",
"internal_notes": "Pedido #12345"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"message": "Transação iniciada com sucesso",
"clicpay_reference": "CP123456789",
"status": "pending",
"transaction_id": 124
}
Example response (400):
{
"errors": {
"msisdn": [
"Número de telefone inválido"
],
"amount": [
"Valor deve ser entre 1 e 50000"
]
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (403):
{
"message": "Acesso negado à carteira"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
clicpay_reference
string
Referência única da transação
status
string
Status atual (pending/successful/failed)
transaction_id
integer
ID interno da transação
Transações eMola
POST api/v2/wallets/{wallet_id}/c2b/emola
requires authentication
Example request:
curl --request POST \
"http://localhost:9000/api/v2/wallets/144365/c2b/emola" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"msisdn\": \"841234567\",
\"amount\": 1000,
\"reference_description\": \"Pagamento de serviços\",
\"internal_notes\": \"Pagamento mensal\"
}"
const url = new URL(
"http://localhost:9000/api/v2/wallets/144365/c2b/emola"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"msisdn": "841234567",
"amount": 1000,
"reference_description": "Pagamento de serviços",
"internal_notes": "Pagamento mensal"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:9000/api/v2/wallets/144365/c2b/emola';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'msisdn' => '841234567',
'amount' => 1000.0,
'reference_description' => 'Pagamento de serviços',
'internal_notes' => 'Pagamento mensal',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'http://localhost:9000/api/v2/wallets/144365/c2b/emola'
payload = {
"msisdn": "841234567",
"amount": 1000,
"reference_description": "Pagamento de serviços",
"internal_notes": "Pagamento mensal"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"message": "Transação iniciada com sucesso",
"clicpay_reference": "CP123456789",
"status": "pending",
"transaction_id": 123
}
Example response (400):
{
"errors": {
"msisdn": [
"Número de telefone inválido"
],
"amount": [
"Valor deve ser entre 1 e 50000"
]
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (403):
{
"message": "Acesso negado à carteira"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
clicpay_reference
string
Referência única da transação
status
string
Status atual (pending/successful/failed)
transaction_id
integer
ID interno da transação
POST api/v2/wallets/{wallet_id}/c2b/emola/direct
requires authentication
Example request:
curl --request POST \
"http://localhost:9000/api/v2/wallets/144365/c2b/emola/direct" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"msisdn\": \"841234567\",
\"amount\": 1000,
\"reference_description\": \"Pagamento de serviços\",
\"internal_notes\": \"Pagamento mensal\"
}"
const url = new URL(
"http://localhost:9000/api/v2/wallets/144365/c2b/emola/direct"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"msisdn": "841234567",
"amount": 1000,
"reference_description": "Pagamento de serviços",
"internal_notes": "Pagamento mensal"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:9000/api/v2/wallets/144365/c2b/emola/direct';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'msisdn' => '841234567',
'amount' => 1000.0,
'reference_description' => 'Pagamento de serviços',
'internal_notes' => 'Pagamento mensal',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'http://localhost:9000/api/v2/wallets/144365/c2b/emola/direct'
payload = {
"msisdn": "841234567",
"amount": 1000,
"reference_description": "Pagamento de serviços",
"internal_notes": "Pagamento mensal"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"message": "Transação iniciada com sucesso",
"clicpay_reference": "CP123456789",
"status": "pending",
"transaction_id": 123
}
Example response (400):
{
"errors": {
"msisdn": [
"Número de telefone inválido"
],
"amount": [
"Valor deve ser entre 1 e 50000"
]
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (403):
{
"message": "Acesso negado à carteira"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
clicpay_reference
string
Referência única da transação
status
string
Status atual (pending/successful/failed)
transaction_id
integer
ID interno da transação
POST api/v2/wallets/{wallet_id}/b2c/emola
requires authentication
Example request:
curl --request POST \
"http://localhost:9000/api/v2/wallets/144365/b2c/emola" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"msisdn\": \"841234567\",
\"amount\": 1000,
\"reference_description\": \"Pagamento de serviços\",
\"internal_notes\": \"Pagamento mensal\"
}"
const url = new URL(
"http://localhost:9000/api/v2/wallets/144365/b2c/emola"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"msisdn": "841234567",
"amount": 1000,
"reference_description": "Pagamento de serviços",
"internal_notes": "Pagamento mensal"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:9000/api/v2/wallets/144365/b2c/emola';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'msisdn' => '841234567',
'amount' => 1000.0,
'reference_description' => 'Pagamento de serviços',
'internal_notes' => 'Pagamento mensal',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'http://localhost:9000/api/v2/wallets/144365/b2c/emola'
payload = {
"msisdn": "841234567",
"amount": 1000,
"reference_description": "Pagamento de serviços",
"internal_notes": "Pagamento mensal"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"message": "Transação iniciada com sucesso",
"clicpay_reference": "CP123456789",
"status": "pending",
"transaction_id": 123
}
Example response (400):
{
"errors": {
"msisdn": [
"Número de telefone inválido"
],
"amount": [
"Valor deve ser entre 1 e 50000"
]
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (403):
{
"message": "Acesso negado à carteira"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
clicpay_reference
string
Referência única da transação
status
string
Status atual (pending/successful/failed)
transaction_id
integer
ID interno da transação
Transações Mkesh
POST api/v2/wallets/{wallet_id}/c2b/mkesh
requires authentication
Example request:
curl --request POST \
"http://localhost:9000/api/v2/wallets/144365/c2b/mkesh" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"msisdn\": \"841234567\",
\"amount\": 500,
\"reference_description\": \"Compra online\",
\"internal_notes\": \"Pedido #12345\"
}"
const url = new URL(
"http://localhost:9000/api/v2/wallets/144365/c2b/mkesh"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"msisdn": "841234567",
"amount": 500,
"reference_description": "Compra online",
"internal_notes": "Pedido #12345"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:9000/api/v2/wallets/144365/c2b/mkesh';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'msisdn' => '841234567',
'amount' => 500.0,
'reference_description' => 'Compra online',
'internal_notes' => 'Pedido #12345',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'http://localhost:9000/api/v2/wallets/144365/c2b/mkesh'
payload = {
"msisdn": "841234567",
"amount": 500,
"reference_description": "Compra online",
"internal_notes": "Pedido #12345"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"message": "Transação iniciada com sucesso",
"clicpay_reference": "CP123456789",
"status": "pending",
"transaction_id": 124
}
Example response (400):
{
"errors": {
"msisdn": [
"Número de telefone inválido"
],
"amount": [
"Valor deve ser entre 1 e 50000"
]
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (403):
{
"message": "Acesso negado à carteira"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
clicpay_reference
string
Referência única da transação
status
string
Status atual (pending/successful/failed)
transaction_id
integer
ID interno da transação
POST api/v2/wallets/{wallet_id}/c2b/mkesh/direct
requires authentication
Example request:
curl --request POST \
"http://localhost:9000/api/v2/wallets/144365/c2b/mkesh/direct" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"msisdn\": \"841234567\",
\"amount\": 500,
\"reference_description\": \"Compra online\",
\"internal_notes\": \"Pedido #12345\"
}"
const url = new URL(
"http://localhost:9000/api/v2/wallets/144365/c2b/mkesh/direct"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"msisdn": "841234567",
"amount": 500,
"reference_description": "Compra online",
"internal_notes": "Pedido #12345"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:9000/api/v2/wallets/144365/c2b/mkesh/direct';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'msisdn' => '841234567',
'amount' => 500.0,
'reference_description' => 'Compra online',
'internal_notes' => 'Pedido #12345',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'http://localhost:9000/api/v2/wallets/144365/c2b/mkesh/direct'
payload = {
"msisdn": "841234567",
"amount": 500,
"reference_description": "Compra online",
"internal_notes": "Pedido #12345"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"message": "Transação iniciada com sucesso",
"clicpay_reference": "CP123456789",
"status": "pending",
"transaction_id": 124
}
Example response (400):
{
"errors": {
"msisdn": [
"Número de telefone inválido"
],
"amount": [
"Valor deve ser entre 1 e 50000"
]
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (403):
{
"message": "Acesso negado à carteira"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
clicpay_reference
string
Referência única da transação
status
string
Status atual (pending/successful/failed)
transaction_id
integer
ID interno da transação
POST api/v2/wallets/{wallet_id}/b2c/mkesh
requires authentication
Example request:
curl --request POST \
"http://localhost:9000/api/v2/wallets/144365/b2c/mkesh" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"msisdn\": \"841234567\",
\"amount\": 500,
\"reference_description\": \"Compra online\",
\"internal_notes\": \"Pedido #12345\"
}"
const url = new URL(
"http://localhost:9000/api/v2/wallets/144365/b2c/mkesh"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"msisdn": "841234567",
"amount": 500,
"reference_description": "Compra online",
"internal_notes": "Pedido #12345"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:9000/api/v2/wallets/144365/b2c/mkesh';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'msisdn' => '841234567',
'amount' => 500.0,
'reference_description' => 'Compra online',
'internal_notes' => 'Pedido #12345',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'http://localhost:9000/api/v2/wallets/144365/b2c/mkesh'
payload = {
"msisdn": "841234567",
"amount": 500,
"reference_description": "Compra online",
"internal_notes": "Pedido #12345"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"message": "Transação iniciada com sucesso",
"clicpay_reference": "CP123456789",
"status": "pending",
"transaction_id": 124
}
Example response (400):
{
"errors": {
"msisdn": [
"Número de telefone inválido"
],
"amount": [
"Valor deve ser entre 1 e 50000"
]
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (403):
{
"message": "Acesso negado à carteira"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
clicpay_reference
string
Referência única da transação
status
string
Status atual (pending/successful/failed)
transaction_id
integer
ID interno da transação
Transações NetShop
POST api/v2/wallets/{wallet_id}/card-payment
requires authentication
Example request:
curl --request POST \
"http://localhost:9000/api/v2/wallets/144365/card-payment" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"amount\": 1500,
\"reference_description\": \"Pagamento de fatura\",
\"first_name\": \"João\",
\"last_name\": \"Silva\",
\"email\": \"QYvHk@example.com\",
\"phone\": \"84 123 4567\",
\"callback_url\": \"https:\\/\\/example.com\\/callback\"
}"
const url = new URL(
"http://localhost:9000/api/v2/wallets/144365/card-payment"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"amount": 1500,
"reference_description": "Pagamento de fatura",
"first_name": "João",
"last_name": "Silva",
"email": "QYvHk@example.com",
"phone": "84 123 4567",
"callback_url": "https:\/\/example.com\/callback"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:9000/api/v2/wallets/144365/card-payment';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'amount' => 1500.0,
'reference_description' => 'Pagamento de fatura',
'first_name' => 'João',
'last_name' => 'Silva',
'email' => 'QYvHk@example.com',
'phone' => '84 123 4567',
'callback_url' => 'https://example.com/callback',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'http://localhost:9000/api/v2/wallets/144365/card-payment'
payload = {
"amount": 1500,
"reference_description": "Pagamento de fatura",
"first_name": "João",
"last_name": "Silva",
"email": "QYvHk@example.com",
"phone": "84 123 4567",
"callback_url": "https:\/\/example.com\/callback"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201):
{
"message": "Sessão criada.",
"clicpay_reference": "123456789",
"status": "pending",
"provider_reference": "123456789",
"provider_response_code": "200",
"provider_status_text": "Pending",
"initiated_at": "2023-01-01T00:00:00Z",
"completed_at": null,
"transaction_id": 123,
"checkout_url": "https://netshop.example.com/checkout/abc123",
"session_id": "abc123",
"success_indicator": "indicator123"
}
Example response (400):
{
"message": "Erro ao criar a sessão.",
"clicpay_reference": "123456789",
"status": "failed",
"transaction_id": 123,
"provider_response_code": "400"
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (403):
{
"message": "Acesso negado à carteira"
}
Example response (422):
{
"errors": {
"amount": [
"O campo valor é obrigatório."
],
"reference_description": [
"O campo descrição da referência é obrigatório."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
clicpay_reference
string
Referência única da transação
status
string
Status atual (pending/successful/failed)
provider_reference
string
Referência do provedor de pagamento
provider_response_code
string
Código de resposta do provedor
provider_status_text
string
Descrição do status do provedor
message
string
Mensagem descritiva do status
initiated_at
string
Data e hora de início da transação (ISO 8601)
completed_at
string
Data e hora de conclusão da transação (ISO 8601)
transaction_id
integer
ID interno da transação
checkout_url
string
URL do checkout NetShop
session_id
string
ID da sessão NetShop
success_indicator
string
Indicador de sucesso da sessão NetShop
Estado de Transações
GET api/v2/transactions/{clicpay_reference}/status
requires authentication
Example request:
curl --request GET \
--get "http://localhost:9000/api/v2/transactions/CP123456789/status" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:9000/api/v2/transactions/CP123456789/status"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:9000/api/v2/transactions/CP123456789/status';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'http://localhost:9000/api/v2/transactions/CP123456789/status'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200):
{
"clicpay_reference": "CP123456789",
"status": "successful",
"amount": 1000,
"message": "Transação concluída com sucesso"
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (404):
{
"message": "Transação não encontrada"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
clicpay_reference
string
Referência da transação
status
string
Status atual (pending/successful/failed/cancelled)
amount
number
Valor da transação
message
string
Mensagem descritiva do status
POST api/v2/wallets/{wallet_id}/split/collect
requires authentication
Example request:
curl --request POST \
"http://localhost:9000/api/v2/wallets/144365/split/collect" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:9000/api/v2/wallets/144365/split/collect"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:9000/api/v2/wallets/144365/split/collect';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'http://localhost:9000/api/v2/wallets/144365/split/collect'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers)
response.json()Example response (200):
{
"message": "Transação encontrada",
"clicpay_reference": "CP123456789",
"status": "pending",
"transaction_id": 124
}
Example response (400):
{
"errors": {
"clicpay_reference": [
"Referência ClicPay inválida"
]
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
clicpay_reference
string
Referência única da transação
status
string
Status atual (pending/successful/failed)
transaction_id
integer
ID interno da transação
Carteiras
GET api/v2/me/wallets
requires authentication
Example request:
curl --request GET \
--get "http://localhost:9000/api/v2/me/wallets?payment_method_id=1&is_active=1&environment=production&include=paymentMethod&sort_by=created_at&sort_order=desc&per_page=20" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:9000/api/v2/me/wallets"
);
const params = {
"payment_method_id": "1",
"is_active": "1",
"environment": "production",
"include": "paymentMethod",
"sort_by": "created_at",
"sort_order": "desc",
"per_page": "20",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:9000/api/v2/me/wallets';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'payment_method_id' => '1',
'is_active' => '1',
'environment' => 'production',
'include' => 'paymentMethod',
'sort_by' => 'created_at',
'sort_order' => 'desc',
'per_page' => '20',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'http://localhost:9000/api/v2/me/wallets'
params = {
'payment_method_id': '1',
'is_active': '1',
'environment': 'production',
'include': 'paymentMethod',
'sort_by': 'created_at',
'sort_order': 'desc',
'per_page': '20',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200):
{
"data": [
{
"id": 1,
"name": "Minha Carteira",
"balance": 1000,
"payment_method": {
"id": 1,
"name": "eMola",
"slug": "emola"
}
}
],
"links": {
"first": "...",
"last": "...",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"per_page": 20,
"to": 1,
"total": 1
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
data
string[]
Lista de carteiras
id
integer
ID da carteira
name
string
Nome da carteira
balance
number
Saldo disponível
payment_method
object
Método de pagamento associado
Autenticação
Obter utilizador autenticado
requires authentication
Example request:
curl --request GET \
--get "http://localhost:9000/api/user" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:9000/api/user"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:9000/api/user';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'http://localhost:9000/api/user'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Obter token de acesso
requires authentication
Example request:
curl --request GET \
--get "http://localhost:9000/api/me/token" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:9000/api/me/token"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:9000/api/me/token';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'http://localhost:9000/api/me/token'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Endpoints
Listar webhooks do usuário (suas wallets/organizações)
requires authentication
Example request:
curl --request GET \
--get "http://localhost:9000/api/v2/webhooks" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:9000/api/v2/webhooks"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:9000/api/v2/webhooks';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'http://localhost:9000/api/v2/webhooks'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Criar novo webhook
requires authentication
Example request:
curl --request POST \
"http://localhost:9000/api/v2/webhooks" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"url\": \"http:\\/\\/kunze.biz\\/iste-laborum-eius-est-dolor.html\",
\"events_enabled\": [
\"transaction.failed\"
],
\"organization_ids\": [
17
],
\"wallet_ids\": [
17
]
}"
const url = new URL(
"http://localhost:9000/api/v2/webhooks"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"url": "http:\/\/kunze.biz\/iste-laborum-eius-est-dolor.html",
"events_enabled": [
"transaction.failed"
],
"organization_ids": [
17
],
"wallet_ids": [
17
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:9000/api/v2/webhooks';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'url' => 'http://kunze.biz/iste-laborum-eius-est-dolor.html',
'events_enabled' => [
'transaction.failed',
],
'organization_ids' => [
17,
],
'wallet_ids' => [
17,
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'http://localhost:9000/api/v2/webhooks'
payload = {
"url": "http:\/\/kunze.biz\/iste-laborum-eius-est-dolor.html",
"events_enabled": [
"transaction.failed"
],
"organization_ids": [
17
],
"wallet_ids": [
17
]
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Ver webhook específico
requires authentication
Example request:
curl --request GET \
--get "http://localhost:9000/api/v2/webhooks/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:9000/api/v2/webhooks/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:9000/api/v2/webhooks/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'http://localhost:9000/api/v2/webhooks/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Atualizar webhook
requires authentication
Example request:
curl --request PUT \
"http://localhost:9000/api/v2/webhooks/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"url\": \"http:\\/\\/kunze.biz\\/iste-laborum-eius-est-dolor.html\",
\"events_enabled\": [
\"transaction.completed\"
],
\"active\": true,
\"organization_ids\": [
17
],
\"wallet_ids\": [
17
]
}"
const url = new URL(
"http://localhost:9000/api/v2/webhooks/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"url": "http:\/\/kunze.biz\/iste-laborum-eius-est-dolor.html",
"events_enabled": [
"transaction.completed"
],
"active": true,
"organization_ids": [
17
],
"wallet_ids": [
17
]
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:9000/api/v2/webhooks/1';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'url' => 'http://kunze.biz/iste-laborum-eius-est-dolor.html',
'events_enabled' => [
'transaction.completed',
],
'active' => true,
'organization_ids' => [
17,
],
'wallet_ids' => [
17,
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'http://localhost:9000/api/v2/webhooks/1'
payload = {
"url": "http:\/\/kunze.biz\/iste-laborum-eius-est-dolor.html",
"events_enabled": [
"transaction.completed"
],
"active": true,
"organization_ids": [
17
],
"wallet_ids": [
17
]
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Deletar webhook
requires authentication
Example request:
curl --request DELETE \
"http://localhost:9000/api/v2/webhooks/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:9000/api/v2/webhooks/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:9000/api/v2/webhooks/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'http://localhost:9000/api/v2/webhooks/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Ativar/Desativar webhook
requires authentication
Example request:
curl --request PATCH \
"http://localhost:9000/api/v2/webhooks/1/toggle" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:9000/api/v2/webhooks/1/toggle"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "PATCH",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:9000/api/v2/webhooks/1/toggle';
$response = $client->patch(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'http://localhost:9000/api/v2/webhooks/1/toggle'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PATCH', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Regenerar secret do webhook
requires authentication
Example request:
curl --request POST \
"http://localhost:9000/api/v2/webhooks/1/regenerate-secret" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:9000/api/v2/webhooks/1/regenerate-secret"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:9000/api/v2/webhooks/1/regenerate-secret';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'http://localhost:9000/api/v2/webhooks/1/regenerate-secret'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Testar webhook com payload de teste
requires authentication
Example request:
curl --request POST \
"http://localhost:9000/api/v2/webhooks/1/test" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:9000/api/v2/webhooks/1/test"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:9000/api/v2/webhooks/1/test';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'http://localhost:9000/api/v2/webhooks/1/test'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Ver eventos do webhook
requires authentication
Example request:
curl --request GET \
--get "http://localhost:9000/api/v2/webhooks/1/events" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:9000/api/v2/webhooks/1/events"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:9000/api/v2/webhooks/1/events';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'http://localhost:9000/api/v2/webhooks/1/events'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Ver detalhe de um evento
requires authentication
Example request:
curl --request GET \
--get "http://localhost:9000/api/v2/webhooks/1/events/2" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:9000/api/v2/webhooks/1/events/2"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:9000/api/v2/webhooks/1/events/2';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'http://localhost:9000/api/v2/webhooks/1/events/2'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Ver eventos falhados para retry
requires authentication
Example request:
curl --request GET \
--get "http://localhost:9000/api/v2/webhooks/1/failed-events" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:9000/api/v2/webhooks/1/failed-events"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:9000/api/v2/webhooks/1/failed-events';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'http://localhost:9000/api/v2/webhooks/1/failed-events'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Ativar/Desativar evento específico
requires authentication
Example request:
curl --request PATCH \
"http://localhost:9000/api/v2/webhooks/1/events/consequatur" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"event_type\": \"transaction.completed\"
}"
const url = new URL(
"http://localhost:9000/api/v2/webhooks/1/events/consequatur"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"event_type": "transaction.completed"
};
fetch(url, {
method: "PATCH",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:9000/api/v2/webhooks/1/events/consequatur';
$response = $client->patch(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'event_type' => 'transaction.completed',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'http://localhost:9000/api/v2/webhooks/1/events/consequatur'
payload = {
"event_type": "transaction.completed"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PATCH', url, headers=headers, json=payload)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.