MENU navbar-image

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

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"
}
 

Request      

POST api/v2/wallets/{wallet_id}/c2b/mpesa

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

wallet_id   integer     

The ID of the wallet. Example: 144365

Body Parameters

msisdn   string     

Número de telefone Example: 841234567

amount   number     

Valor da transação (1-50000) Example: 500

reference_description   string     

Descrição da referência (3-32 caracteres) Example: Compra online

internal_notes   string  optional    

optional Notas internas (máx 255 caracteres) Example: Pedido #12345

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"
}
 

Request      

POST api/v2/wallets/{wallet_id}/c2b/mpesa/direct

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

wallet_id   integer     

The ID of the wallet. Example: 144365

Body Parameters

msisdn   string     

Número de telefone Example: 841234567

amount   number     

Valor da transação (1-50000) Example: 500

reference_description   string     

Descrição da referência (3-32 caracteres) Example: Compra online

internal_notes   string  optional    

optional Notas internas (máx 255 caracteres) Example: Pedido #12345

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"
}
 

Request      

POST api/v2/wallets/{wallet_id}/b2c/mpesa

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

wallet_id   integer     

The ID of the wallet. Example: 144365

Body Parameters

msisdn   string     

Número de telefone Example: 841234567

amount   number     

Valor da transação (1-50000) Example: 500

reference_description   string     

Descrição da referência (3-32 caracteres) Example: Compra online

internal_notes   string  optional    

optional Notas internas (máx 255 caracteres) Example: Pedido #12345

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"
}
 

Request      

POST api/v2/wallets/{wallet_id}/c2b/emola

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

wallet_id   integer     

The ID of the wallet. Example: 144365

Body Parameters

msisdn   string     

Número de telefone Example: 841234567

amount   number     

Valor da transação (1-50000) Example: 1000

reference_description   string     

Descrição da referência (3-32 caracteres) Example: Pagamento de serviços

internal_notes   string  optional    

optional Notas internas (máx 255 caracteres) Example: Pagamento mensal

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"
}
 

Request      

POST api/v2/wallets/{wallet_id}/c2b/emola/direct

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

wallet_id   integer     

The ID of the wallet. Example: 144365

Body Parameters

msisdn   string     

Número de telefone Example: 841234567

amount   number     

Valor da transação (1-50000) Example: 1000

reference_description   string     

Descrição da referência (3-32 caracteres) Example: Pagamento de serviços

internal_notes   string  optional    

optional Notas internas (máx 255 caracteres) Example: Pagamento mensal

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"
}
 

Request      

POST api/v2/wallets/{wallet_id}/b2c/emola

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

wallet_id   integer     

The ID of the wallet. Example: 144365

Body Parameters

msisdn   string     

Número de telefone Example: 841234567

amount   number     

Valor da transação (1-50000) Example: 1000

reference_description   string     

Descrição da referência (3-32 caracteres) Example: Pagamento de serviços

internal_notes   string  optional    

optional Notas internas (máx 255 caracteres) Example: Pagamento mensal

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"
}
 

Request      

POST api/v2/wallets/{wallet_id}/c2b/mkesh

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

wallet_id   integer     

The ID of the wallet. Example: 144365

Body Parameters

msisdn   string     

Número de telefone Example: 841234567

amount   number     

Valor da transação (1-50000) Example: 500

reference_description   string     

Descrição da referência (3-32 caracteres) Example: Compra online

internal_notes   string  optional    

optional Notas internas (máx 255 caracteres) Example: Pedido #12345

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"
}
 

Request      

POST api/v2/wallets/{wallet_id}/c2b/mkesh/direct

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

wallet_id   integer     

The ID of the wallet. Example: 144365

Body Parameters

msisdn   string     

Número de telefone Example: 841234567

amount   number     

Valor da transação (1-50000) Example: 500

reference_description   string     

Descrição da referência (3-32 caracteres) Example: Compra online

internal_notes   string  optional    

optional Notas internas (máx 255 caracteres) Example: Pedido #12345

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"
}
 

Request      

POST api/v2/wallets/{wallet_id}/b2c/mkesh

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

wallet_id   integer     

The ID of the wallet. Example: 144365

Body Parameters

msisdn   string     

Número de telefone Example: 841234567

amount   number     

Valor da transação (1-50000) Example: 500

reference_description   string     

Descrição da referência (3-32 caracteres) Example: Compra online

internal_notes   string  optional    

optional Notas internas (máx 255 caracteres) Example: Pedido #12345

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."
        ]
    }
}
 

Request      

POST api/v2/wallets/{wallet_id}/card-payment

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

wallet_id   integer     

The ID of the wallet. Example: 144365

wallet   integer     

ID da carteira NetShop Example: 1234

Body Parameters

amount   number     

Valor do pagamento Example: 1500

reference_description   string     

Descrição da referência (máx 100 caracteres) Example: Pagamento de fatura

first_name   string  optional    

optional Primeiro nome do pagador Example: João

last_name   string  optional    

optional Último nome do pagador Example: Silva

email   string  optional    

optional Email do pagador Example: QYvHk@example.com

phone   string  optional    

optional Telefone do pagador Example: 84 123 4567

callback_url   url  optional    

optional URL de retorno Example: https://example.com/callback

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"
}
 

Request      

GET api/v2/transactions/{clicpay_reference}/status

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

clicpay_reference   string     

Referência ClicPay da transação Example: CP123456789

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."
}
 

Request      

POST api/v2/wallets/{wallet_id}/split/collect

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

wallet_id   integer     

The ID of the wallet. Example: 144365

clicpay_reference   string     

Referência ClicPay da transação Example: CP123456789

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

Request      

GET api/v2/me/wallets

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

payment_method_id   integer  optional    

optional Filtrar por método de pagamento Example: 1

is_active   boolean  optional    

optional Filtrar por status ativo Example: true

environment   string  optional    

optional Filtrar por ambiente (sandbox/production) Example: production

include   string  optional    

optional Incluir relacionamentos (ex: paymentMethod) Example: paymentMethod

sort_by   string  optional    

optional Ordenar por campo (id, name, balance, created_at) Example: created_at

sort_order   string  optional    

optional Ordem da ordenação (asc, desc) Example: desc

per_page   integer  optional    

optional Itens por página (padrão: 10) Example: 20

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."
}
 

Request      

GET api/user

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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."
}
 

Request      

GET api/me/token

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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."
}
 

Request      

GET api/v2/webhooks

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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."
}
 

Request      

POST api/v2/webhooks

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

url   string     

Must be a valid URL. Must start with one of https:// Must not be greater than 2048 characters. Example: http://kunze.biz/iste-laborum-eius-est-dolor.html

events_enabled   string[]  optional    
Must be one of:
  • transaction.completed
  • transaction.failed
organization_ids   integer[]  optional    

The id of an existing record in the organizations table.

wallet_ids   integer[]  optional    

The id of an existing record in the wallets table.

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."
}
 

Request      

GET api/v2/webhooks/{endpoint_id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

endpoint_id   integer     

The ID of the endpoint. Example: 1

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."
}
 

Request      

PUT api/v2/webhooks/{endpoint_id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

endpoint_id   integer     

The ID of the endpoint. Example: 1

Body Parameters

url   string  optional    

Must be a valid URL. Must start with one of https:// Must not be greater than 2048 characters. Example: http://kunze.biz/iste-laborum-eius-est-dolor.html

events_enabled   string[]  optional    
Must be one of:
  • transaction.completed
  • transaction.failed
active   boolean  optional    

Example: true

organization_ids   integer[]  optional    

The id of an existing record in the organizations table.

wallet_ids   integer[]  optional    

The id of an existing record in the wallets table.

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."
}
 

Request      

DELETE api/v2/webhooks/{endpoint_id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

endpoint_id   integer     

The ID of the endpoint. Example: 1

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."
}
 

Request      

PATCH api/v2/webhooks/{endpoint_id}/toggle

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

endpoint_id   integer     

The ID of the endpoint. Example: 1

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."
}
 

Request      

POST api/v2/webhooks/{endpoint_id}/regenerate-secret

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

endpoint_id   integer     

The ID of the endpoint. Example: 1

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."
}
 

Request      

POST api/v2/webhooks/{endpoint_id}/test

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

endpoint_id   integer     

The ID of the endpoint. Example: 1

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."
}
 

Request      

GET api/v2/webhooks/{endpoint_id}/events

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

endpoint_id   integer     

The ID of the endpoint. Example: 1

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."
}
 

Request      

GET api/v2/webhooks/{endpoint_id}/events/{event_id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

endpoint_id   integer     

The ID of the endpoint. Example: 1

event_id   integer     

The ID of the event. Example: 2

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."
}
 

Request      

GET api/v2/webhooks/{endpoint_id}/failed-events

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

endpoint_id   integer     

The ID of the endpoint. Example: 1

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."
}
 

Request      

PATCH api/v2/webhooks/{endpoint_id}/events/{event_type}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

endpoint_id   integer     

The ID of the endpoint. Example: 1

event_type   string     

Example: consequatur

Body Parameters

event_type   string     

Example: transaction.completed

Must be one of:
  • transaction.completed
  • transaction.failed