Skip to main content

Payin

For more details, access the open api

Url of the environments

Attention

To use these endpoints you need a API KEY.

get the crendential

Simple charge‚Äč

endpoint: /v1/payin/payments/{chargeType}

The route parameter {chargeType} should be boleto or pix.

method: POST

Samples of payload and Response‚Äč

Payload
{
"clientId": 15,
"customNumber": "123456",
"callbackUrl": "https://payin-test.requestcatcher.com/",
"title": {
"expireDate": "2022-07-25T16:20:00",
"amountInCents": 5000,
"instructions": "any bank"
},
"buyer": {
"name": "Name",
"document": {
"number": "01234567890",
"type": "CPF"
},
"address": {
"street": "ALAMEDA RIO NEGRO",
"number": "500",
"complement": "BLOCO B ANDAR 15 SALA 1503",
"zipCode": "06454000",
"city": "Barueri",
"district": "ALPHAVILLE INDUSTRIAL",
"stateCode": "SP"
}
}
}

Response
{
"key": "string",
"clientId": 0,
"clientName": "string",
"buyerName": "string",
"buyerDocument": "string",
"customNumber": "string",
"ourNumber": "string",
"digitableLine": "string",
"barCodeNumber": "string",
"status": {
"name": "string",
"id": "string"
},
"typePayin": "string",
"amountCents": 0,
"paidAmountCents": null,
"paidAt": null,
"expiresAt": "2019-08-24T14:15:22Z",
"createdAt": "2019-08-24T14:15:22Z",
"fine": null,
"discount": null,
"splits": [
{
"walletOwner": "string",
"walletUUID": "string",
"percent": 0,
"amountInCents": null
}
],
"statusHistory": [
{
"status": {
"id": 0,
"name": "string"
},
"updatedAt": "string"
}
],
"sender": {
"name": "string",
"document": "string",
"helpdesk": "string"
},
"payinRefunds": [
{
"id": 1,
"payinId": 1,
"statusId": 2,
"user": {
"id": 1,
"name": "Usu√°rio de Teste"
},
"clientId": 1,
"amountCents": 100,
"statuses": [
{
"id": 1,
"statusId": 1,
"name": "Solicitado",
"notification": 1,
"createdAt": "2022-03-11T17:14:47.000000Z"
},
{
"id": 2,
"statusId": 2,
"name": "Pago",
"notification": 1,
"createdAt": "2022-03-11T17:14:49.000000Z"
}
],
"endToEndId": "string",
"reason": "strind",
"callbackUrl": "https://payin-refund.requestcatcher.com/",
"createdAt": "2022-03-11T17:31:03.000000Z",
"updatedAt": "2022-03-11T17:31:05.000000Z"
}
],
"refundAmountCents": 1000
}

Samples codes‚Äč


var axios = require('axios');
var data = JSON.stringify({
"clientId": 15,
"customNumber": "258688a0-92ee-42a6-b84d-ea54c6aeaac3",
"callbackUrl": "https://enehias.requestcatcher.com/",
"title": {
"expireDate": "2022-07-25T16:20:00",
"amountInCents": 5000,
"instructions": "any bank"
},
"buyer": {
"name": "Name",
"document": {
"number": "01234567890",
"type": "CPF"
},
"address": {
"street": "ALAMEDA RIO NEGRO",
"number": "500",
"complement": "BLOCO B ANDAR 15 SALA 1503",
"zipCode": "06454000",
"city": "Barueri",
"district": "ALPHAVILLE INDUSTRIAL",
"stateCode": "SP"
}
}
});

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

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

Charge with split to recipients‚Äč

endpoint: /v1/payin/payments/boleto

method: POST

Samples of payload and Response‚Äč

Payload
{
"clientId": 104,
"customNumber": "1234",
"callbackUrl": "https://payin-test.requestcatcher.com/",
"title": {
"expireDate": "2021-11-29",
"amountInCents": 15000,
"instructions": "PAG√ĀVEL DE QUALQUER BANCO COM QR CODE PIX"
},
"buyer": {
"name": "NAME",
"document": {
"type": "CPF",
"number": "1234567890"
},
"address": {
"street": "ALAMEDA RIO NEGRO",
"number": "500",
"complement": "BLOCO B ANDAR 15 SALA 1503",
"zipCode": "06454000",
"city": "Barueri",
"district": "ALPHAVILLE INDUSTRIAL",
"stateCode": "SP"
}
},
"splits" : [
{
"walletUUID":"d953bf82-25a1-4665-807e-4398eb2ebf6b",
"percent": 50
},
{
"walletUUID":"c708f21c-3995-47bd-bbcd-b6c924455e55",
"percent": 50
}
]
}
Response
{
"key": "string",
"clientId": 0,
"clientName": "string",
"buyerName": "string",
"buyerDocument": "string",
"customNumber": "string",
"ourNumber": "string",
"digitableLine": "string",
"barCodeNumber": "string",
"status": {
"name": "string",
"id": "string"
},
"typePayin": "string",
"amountCents": 0,
"paidAmountCents": null,
"paidAt": null,
"expiresAt": "2019-08-24T14:15:22Z",
"createdAt": "2019-08-24T14:15:22Z",
"fine": null,
"discount": null,
"splits": [
{
"walletOwner": "string",
"walletUUID": "string",
"percent": 0,
"amountInCents": null
}
],
"statusHistory": [
{
"status": {
"id": 0,
"name": "string"
},
"updatedAt": "string"
}
],
"sender": {
"name": "string",
"document": "string",
"helpdesk": "string"
},
"payinRefunds": [
{
"id": 1,
"payinId": 1,
"statusId": 2,
"user": {
"id": 1,
"name": "Usu√°rio de Teste"
},
"clientId": 1,
"amountCents": 100,
"statuses": [
{
"id": 1,
"statusId": 1,
"name": "Solicitado",
"notification": 1,
"createdAt": "2022-03-11T17:14:47.000000Z"
},
{
"id": 2,
"statusId": 2,
"name": "Pago",
"notification": 1,
"createdAt": "2022-03-11T17:14:49.000000Z"
}
],
"endToEndId": "string",
"reason": "strind",
"callbackUrl": "https://payin-refund.requestcatcher.com/",
"createdAt": "2022-03-11T17:31:03.000000Z",
"updatedAt": "2022-03-11T17:31:05.000000Z"
}
],
"refundAmountCents": 1000
}

Samples codes‚Äč

var axios = require('axios');
var data = JSON.stringify({
"clientId": 104,
"customNumber": "1234",
"callbackUrl": "https://payin-test.requestcatcher.com/",
"title": {
"expireDate": "2021-11-29",
"amountInCents": 15000,
"instructions": "PAG√ĀVEL DE QUALQUER BANCO COM QR CODE PIX"
},
"buyer": {
"name": "NAME",
"document": {
"type": "CPF",
"number": "1234567890"
},
"address": {
"street": "ALAMEDA RIO NEGRO",
"number": "500",
"complement": "BLOCO B ANDAR 15 SALA 1503",
"zipCode": "06454000",
"city": "Barueri",
"district": "ALPHAVILLE INDUSTRIAL",
"stateCode": "SP"
}
},
"splits": [
{
"walletUUID": "d953bf82-25a1-4665-807e-4398eb2ebf6b",
"percent": 50
},
{
"walletUUID": "c708f21c-3995-47bd-bbcd-b6c924455e55",
"percent": 50
}
]
});

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

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

Webhook‚Äč

Receive payin status updates.‚Äč

When a charge has its status changed, a post request is fired to the url entered in the callbackUrl attribute of the charge creation.

All charges webhooks are signed with an sha256 hash provided in the x-webhook-wpo-signature header. The hash is sent as a Bearer token. eg.: Bearer {hash} To validate the signature you must concatenate the charge id, key, amountCents and your APIKey used to create the charges and hash this string using the sha256 algorithm.

For example: 1KEY120APIKEY

  • If you don't have a discount, don't send the discount key in the data;
  • If you have discount.percent, then you must send discount.percent and discount.date;
  • If you have discount.amountInCents, then you must send discount.amountInCents and discount.date;
  • If you have discount.dailyAmountInCents, then you DON'T need to send the other fields percent, date and amount;
Payload
{
"id": 0,
"key": "string",
"clientId": 0,
"clientName": "string",
"buyerName": "string",
"buyerDocument": "string",
"customNumber": "string",
"ourNumber": "string",
"digitableLine": "string",
"barCodeNumber": "string",
"status": {
"name": "string",
"id": "string"
},
"typePayin": "string",
"amountCents": 0,
"paidAmountCents": null,
"paidAt": null,
"expiresAt": "2019-08-24T14:15:22Z",
"createdAt": "2019-08-24T14:15:22Z",
"fine": null,
"discount": null,
"splits": [
{
"walletOwner": "string",
"walletUUID": "string",
"percent": 0,
"amountInCents": null
}
],
"statusHistory": [
{
"status": {
"id": 0,
"name": "string"
},
"updatedAt": "string"
}
],
"sender": {
"name": "string",
"document": "string",
"helpdesk": "string"
},
"payinRefunds": [
{
"id": 1,
"payinId": 1,
"statusId": 2,
"user": {
"id": 1,
"name": "Usu√°rio de Teste"
},
"clientId": 1,
"amountCents": 100,
"statuses": [
{
"id": 1,
"statusId": 1,
"name": "Solicitado",
"notification": 1,
"createdAt": "2022-03-11T17:14:47.000000Z"
},
{
"id": 2,
"statusId": 2,
"name": "Pago",
"notification": 1,
"createdAt": "2022-03-11T17:14:49.000000Z"
}
],
"endToEndId": "EFASA321654987456ASAS123",
"reason": "Devolvendo valores de teste",
"callbackUrl": "https://payin-refund.requestcatcher.com/",
"createdAt": "2022-03-11T17:31:03.000000Z",
"updatedAt": "2022-03-11T17:31:05.000000Z"
}
],
"refundAmountCents": 1000
}