Pular para o conteúdo principal

Pagamentos

Para mais detalhes, acessar a open api

Url dos ambientes abaixo

Atenção

Para utilizar esses endpoints é necessário ter uma API KEY.

obter as crendenciais

Pagamento por Transferência eletrônica(TED)

endpoint: /v1/payout/payments

método: POST

Exemplo de payload e Response esperado

Payload de Exemplo
{
"amount": 1000.0,
"merchant_id": 0,
"custom_code": "YOURAPPCODE",
"notification_url": "https://teste.requestcatcher.com/",
"beneficiary": {
"name": "The Name",
"bank_code": "147",
"bank_branch": "0000",
"bank_branch_digit": "1",
"account": "1030000",
"account_digit": "1",
"account_type": "CHECKING",
"document": "12533009091",
"document_type": "cpf"
},
"legal_entity_name": "Your client's name",
"website": "Your client's website"
}

Response esperado
{
"id": 111111,
"amount": 1000.0,
"source_currency": "USD",
"source_amount": 250,
"custom_code": "YOURAPPCODE",
"authentication_code": "8132F296ECE9271E97A776777",
"payment_type": "T",
"rejection_description": "Rejected by bank",
"notification_url": "https://your.endpoint.to.update",
"beneficiary": {
"name": "The Name",
"pix_key": "userpixkey@user.com",
"bank_code": "147",
"bank_branch": "0000",
"bank_branch_digit": "1",
"account": "1030000",
"account_digit": "1",
"account_type": "CHECKING",
"document": "12533009091",
"document_type": "cpf",
"birthdate": "1970-01-01",
"phone": "5541987456321",
"city": "Curitiba",
"postal_code": "80200-100",
"province_code": "PR",
"address": "Rua a Número 10"
},
"remitter": {
"name": "The remitter's name",
"birthdate": "1970-01-01",
"country": "USA"
},
"status": {
"id": 1,
"name": "Received"
},
"paid_at": "2020-01-01 23:59:59",
"created_at": "2020-01-01 23:59:59",
"updated_at": "2020-01-01 23:59:59",
"description": "Payment description",
"currency": "BRL"
}

Exemplos de código

var axios = require('axios');
var data = JSON.stringify({
"amount": 1000.0,
"custom_code": "YOURAPPCODE",
"notification_url": "https://test.requestcatcher.com/",
"beneficiary": {
"name": "The Name",
"bank_code": "147",
"bank_branch": "0000",
"bank_branch_digit": "1",
"account": "1030000",
"account_digit": "1",
"account_type": "CHECKING",
"document": "12533009091",
"document_type": "cpf"
},
"legal_entity_name": "Your client's name",
"website": "Your client's website"
});

var config = {
method: 'post',
url: 'api.sandbox.wepayout.com.br/v1/payout/payments',
headers: {
'Authorization': 'Bearer YOUR_KEY',
'Content-Type': 'application/json'
},
data : data
};

axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});

Pagamentos por chave pix

endpoint: /v1/payout/payments

método: POST

Exemplo de payload e Response esperado

Exemplo de payload
{
"amount": 1000.0,
"merchant_id":0,
"custom_code": "test",
"notification_url": "https://test.requestcatcher.com/",
"beneficiary": {
"name": "The Name",
"pix_key": "userpixkey@user.com",
"document": "12533009091",
"document_type": "cpf"
},
"legal_entity_name": "Your client's name",
"website": "Your client's website",
"instant_payment": 1
}
Exemplo de response esperado
{
"id": 0,
"origin_payment_id": null,
"amount": "R$ 1.000,00",
"source_currency": "BRL",
"source_amount": null,
"custom_code": "PIXTEST1122",
"authentication_code": null,
"rejection_description": "",
"notification_url": "https://test.requestcatcher.com/",
"status": {
"id": 7,
"name": "Aguardando"
},
"paid_at": null,
"created_at": "2022-06-21 11:24:00",
"description": null,
"currency": "BRL",
"beneficiary": {
"name": "The Name",
"document_type": "cpf",
"email": null,
"document": "12533009091",
"birthdate": null,
"city": null,
"postal_code": null,
"province_code": null,
"address": null,
"pix_key": "userpixkey@user.com",
"bank_branch": null,
"bank_branch_digit": null,
"account": null,
"account_digit": null,
"account_type": "",
"bank_code": null,
"bank_name": null
},
"payment_type": "P",
"merchant": {
"id": 100,
"name": "test",
"type": "u"
},
"exchange_rate": null,
"locked": null,
"file_code": null
}

Exemplos de código

var axios = require('axios');
var data = JSON.stringify({
"amount": 1000.0,
"merchant_id": 0,
"custom_code": "test",
"notification_url": "https://test.requestcatcher.com/",
"beneficiary": {
"name": "The Name",
"pix_key": "userpixkey@user.com",
"document": "12533009091",
"document_type": "cpf"
},
"legal_entity_name": "Your client's name",
"website": "Your client's website",
"instant_payment": 1
});

var config = {
method: 'post',
url: 'https://api.sandbox.wepayout.co/v1/payout/payments',
headers: {
'Authorization': 'Bearer YOUR_KEY',
'Content-Type': 'application/json'
},
data : data
};

axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});

Pagamentos por chave pix com dados bancários

endpoint: /v1/payout/payments

método: POST

Exemplo de payload e Response esperado

Exemplo de payload
{
"amount": 1000.0,
"merchant_id":0,
"custom_code": "teste",
"notification_url": "https://your.endpoint.to.update",
"beneficiary": {
"name": "The Name",
"bank_code": "104",
"bank_branch": "0000",
"bank_branch_digit": "1",
"account": "1030000",
"account_digit": "1",
"account_type": "CHECKING",
"document": "12533009091",
"document_type": "cpf"
},
"legal_entity_name": "Your client's name",
"website": "Your client's website",
"instant_payment": 1
}
Exemplo de response esperado
{
"id": -1,
"origin_payment_id": null,
"amount": "R$ 1.000,00",
"source_currency": "BRL",
"source_amount": null,
"custom_code": "teste",
"authentication_code": null,
"rejection_description": "",
"notification_url": "https://your.endpoint.to.update",
"status": {
"id": 7,
"name": "Aguardando"
},
"paid_at": null,
"created_at": "2022-06-21 12:49:06",
"description": null,
"currency": "BRL",
"beneficiary": {
"name": "The Name",
"document_type": "cpf",
"email": null,
"document": "12533009091",
"birthdate": null,
"city": null,
"postal_code": null,
"province_code": null,
"address": null,
"pix_key": null,
"bank_branch": "0000",
"bank_branch_digit": "1",
"account": "1030000",
"account_digit": "1",
"account_type": "CHECKING",
"bank_code": "104",
"bank_name": "104 - CAIXA ECONOMICA FEDERAL "
},
"payment_type": "P",
"merchant": {
"id": 100,
"name": "Eliel F Canivarolli",
"type": "u"
},
"exchange_rate": null,
"locked": null,
"file_code": null
}

Exemplos de código

var axios = require('axios');
var data = JSON.stringify({
"amount": 1000.0,
"merchant_id": 0,
"custom_code": "test",
"notification_url": "https://your.endpoint.to.update",
"beneficiary": {
"name": "The Name",
"bank_code": "104",
"bank_branch": "0000",
"bank_branch_digit": "1",
"account": "1030000",
"account_digit": "1",
"account_type": "CHECKING",
"document": "12533009091",
"document_type": "cpf"
},
"legal_entity_name": "Your client's name",
"website": "Your client's website",
"instant_payment": 1
});

var config = {
method: 'post',
url: 'https://api.sandbox.wepayout.co/v1/payout/payments',
headers: {
'Authorization': 'Bearer YOUR_KEY',
'Content-Type': 'application/json'
},
data : data
};

axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});

Pagamentos para remittence

endpoint: /v1/payout/payments

método: POST

Exemplo de payload e Response esperado

Exemplo de payload
{
"source_currency": "USD",
"amount": 1000.0,
"merchant_id":0,
"custom_code": "test",
"notification_url": "https://your.endpoint.to.update",
"beneficiary": {
"name": "The Name",
"bank_code": "104",
"bank_branch": "0000",
"bank_branch_digit": "1",
"account": "1030000",
"account_digit": "1",
"account_type": "CHECKING",
"document": "12533009091",
"document_type": "cpf",
"birthdate": "1970-01-01",
"phone": "5541987456321",
"city": "Curitiba",
"postal_code": "80200-100",
"province_code": "PR",
"address": "Rua a Número 10"
},
"legal_entity_name": "M0005",
"website": "site.com.br",
"description": "Test M0005",
"remitter": {
"name": "The remitter's name",
"birthdate": "1970-01-01",
"country": "USA"
}
}
Exemplo de response esperado
{
"id": -1,
"origin_payment_id": null,
"amount": "R$ 1.000,00",
"source_currency": "BRL",
"source_amount": null,
"custom_code": "test",
"authentication_code": null,
"rejection_description": "",
"notification_url": "https://your.endpoint.to.update",
"status": {
"id": 7,
"name": "Aguardando"
},
"paid_at": null,
"created_at": "2022-06-21 13:07:15",
"description": "Test M0005",
"currency": "BRL",
"beneficiary": {
"name": "The Name",
"document_type": "cpf",
"email": null,
"document": "12533009091",
"birthdate": null,
"city": null,
"postal_code": null,
"province_code": null,
"address": null,
"pix_key": null,
"bank_branch": "0000",
"bank_branch_digit": "1",
"account": "1030000",
"account_digit": "1",
"account_type": "CHECKING",
"bank_code": "104",
"bank_name": "104 - CAIXA ECONOMICA FEDERAL "
},
"payment_type": "T",
"merchant": {
"id": 100,
"name": "Eliel F Canivarolli",
"type": "u"
},
"exchange_rate": null,
"locked": null,
"file_code": null
}

Exemplos de código

var axios = require('axios');
var data = JSON.stringify({
"source_currency": "USD",
"amount": 1000.0,
"merchant_id": 0,
"custom_code": "test",
"notification_url": "https://your.endpoint.to.update",
"beneficiary": {
"name": "The Name",
"bank_code": "104",
"bank_branch": "0000",
"bank_branch_digit": "1",
"account": "1030000",
"account_digit": "1",
"account_type": "CHECKING",
"document": "12533009091",
"document_type": "cpf",
"birthdate": "1970-01-01",
"phone": "5541987456321",
"city": "Curitiba",
"postal_code": "80200-100",
"province_code": "PR",
"address": "Rua a Número 10"
},
"legal_entity_name": "M0005",
"website": "site.com.br",
"description": "Test M0005",
"remitter": {
"name": "The remitter's name",
"birthdate": "1970-01-01",
"country": "USA"
}
});

var config = {
method: 'post',
url: 'https://api.sandbox.wepayout.co/v1/payout/payments',
headers: {
'Authorization': 'Bearer YOUR_KEY',
'Content-Type': 'application/json'
},
data : data
};

axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});

Webhook

Pagamento Atualizado

Quando o pagamento tem o status alterado, um post é disparado com um payload para a url do atributo notification_url que foi informado durante a criação do pagamento.

Todos os webhooks de pagamentos são assinados com um hash sha256 fornecido no cabeçalho Authorization. O hash é enviado como uma Bearer token, ex: Bearer {hash}. Para validar a assinatura você precisa concatenar os campos custom_code, currency e amount do pagamento com a APIKey usada para criar os pagamentos, e fazer o hash dessa string usando o algoritmo sha256.

Por exemplo: CustomCodeBRL1000.00APIKEY

Exemplo de payload de webhook
{
"property":"Payment",
"property_id":1359280,
"date":"2022-06-21 13:28:42",
"custom_code":"TEST1327",
"batch_code":null,
"status_id":3,
"status":"Pago",
"description":"",
"instructions":[

],
"currency":"BRL",
"amount":"1000.00"
}