WePayOut's Payin API (1.1)
Download OpenAPI specification:Download
Use this API to create payin in operations
Create a new payment charge.
Create a new payment charge order
Types of charge
The route parameter {chargeType}
should be boleto
or pix
.
When you choose boleto a new payment slip will be generated. When PIX is chosen a QRCode payment charge will be created.
Pix has a payment confirmation time much faster than boleto. You will receive a payment notification in less than 1 minute after the qr code is paid.
Expiration date format differences between pix and boleto
The expireDate
field in Boleto is formatted as "YYYY-MM-DD". Ex.: 2021-12-31
The expireDate
field in PIX is formatted as "YYYY-MM-DDTH:I:S". Ex.: 2021-12-31T23:59:59
Possible charge statuses
- PAYIN_CREATED :
1
; The first status when the payin is created. - PAYIN_CANCELED :
2
; Payin canceled due to expiration. - PAYIN_PAID :
3
; Payin was paid. - PAYIN_CREDITED :
4
; Payin was paid and the amount was credited on your wallet. - PAYIN_DROP_REQUESTED :
5
; Payin expiration requested.
Payment page
We provide you a simple payment page that renders the boleto or pix qr code so the user can access it and view the instructions to pay the charge.
To use the page you will need the key
field that is returned in this method.
The payment page url is: https://pagar.goboleto.com/?hash={key}
.
In sandbox environment the page url is: https://pagar.sandbox.goboleto.com/?hash={key}
Authorizations:
path Parameters
chargeType required | string Should be "pix" or "boleto" |
Request Body schema: application/json
callbackUrl | string <uri> The url where we will submit the callbacks |
customNumber required | string <= 255 characters Your identification number, it must be unique on our database. |
required | object |
required | object The person that you are charging object |
object This is only available for | |
object Available only for | |
Array of objects[ items ] Splits are avaiable if you want to credit more than one wallet with the charged paid amount | |
required | object Use this object to inform the legal name of the final beneficiary, it could be your company’s name or the company you are proving a service for. Final Beneficiary is a person or a company that will receive the amount paid trough the boleto. |
Responses
Callbacks
Request samples
- Payload
{- "customNumber": "1234",
- "title": {
- "expireDate": "2020-04-20",
- "amountInCents": 8652,
- "instructions": "Esse payin é referente à compra do produto X"
}, - "buyer": {
- "name": "Josefino da Silva",
- "document": {
- "number": "01234567890",
- "type": "CPF"
}, - "address": {
- "street": "Rua Antonio Carlos",
- "number": "191",
- "complement": "oitavo andar",
- "zipCode": "71540072",
- "city": "Porto Velho",
- "district": "Centro",
- "stateCode": "PR"
}
}
}
Response samples
- 201
- 403
- 422
{- "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",
- "createdAt": "2022-03-11T17:31:03.000000Z",
- "updatedAt": "2022-03-11T17:31:05.000000Z"
}
]
], - "refundAmountCents": 1000
}
Callback payload samples
{- "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",
- "createdAt": "2022-03-11T17:31:03.000000Z",
- "updatedAt": "2022-03-11T17:31:05.000000Z"
}
]
], - "refundAmountCents": 1000
}
Returns a payin by KEY.
Returns the charge using one of it's identifications parameters
Authorizations:
path Parameters
keyType required | string |
key required | integer The Key of the payin. |
Responses
Response samples
- 200
- 403
{- "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",
- "createdAt": "2022-03-11T17:31:03.000000Z",
- "updatedAt": "2022-03-11T17:31:05.000000Z"
}
]
], - "refundAmountCents": 1000
}
Creates a recipient to be used on splits.
Authorizations:
path Parameters
clientId required | integer The Client ID. |
Request Body schema: application/json
name required | string |
bank_code required | string |
bank_branch required | string |
bank_branch_digit required | string |
account required | string |
account_digit required | string |
account_type required | string |
pix_key required | string |
email required | string |
document required | string |
document_type required | string |
Responses
Request samples
- Payload
{- "name": "My Recipient",
- "bank_code": "001",
- "bank_branch": "6955",
- "bank_branch_digit": "0",
- "account": "1146208",
- "account_digit": "6",
- "account_type": "c",
- "pix_key": "01234567890",
- "email": "recipient1@gmail.com",
- "document": "01234567890",
- "document_type": "cpf"
}
Response samples
- 200
- 403
- 422
{- "status": true,
- "data": {
- "id": 5,
- "wallet_uuid": "3e40f8f1-9f70-4f5d-97f9-90483027dfaa",
- "name": "My Recipient",
- "bank_code": "001",
- "bank_name": "001 - BANCO DO BRASIL S/A",
- "bank_branch": "6955",
- "bank_branch_digit": "0",
- "account": "1146208",
- "account_digit": "6",
- "account_type": "c",
- "pix_key": "01234567890",
- "document": "01234567890",
- "document_type": "cpf",
- "email": "recipient1@gmail.com",
- "created_at": "2020-07-20T13:19:10.000000Z",
- "updated_at": "2020-07-20T13:19:10.000000Z"
}, - "message": "Recipient created"
}
Updates a recipient.
Authorizations:
path Parameters
clientId required | integer The Client ID. |
recipientId required | integer The Recipient ID. |
Request Body schema: application/json
name required | string |
bank_code required | string |
bank_branch required | string |
bank_branch_digit required | string |
account required | string |
account_digit required | string |
account_type required | string |
pix_key required | string |
email required | string |
document required | string |
document_type required | string |
Responses
Request samples
- Payload
{- "name": "My Recipient",
- "bank_code": "001",
- "bank_branch": "6955",
- "bank_branch_digit": "0",
- "account": "1146208",
- "account_digit": "6",
- "account_type": "c",
- "pix_key": "01234567890",
- "email": "recipient1@gmail.com",
- "document": "01234567890",
- "document_type": "cpf"
}
Response samples
- 200
- 403
- 422
{- "status": true,
- "data": {
- "id": 5,
- "wallet_uuid": "3e40f8f1-9f70-4f5d-97f9-90483027dfaa",
- "name": "My Recipient",
- "bank_code": "001",
- "bank_name": "001 - BANCO DO BRASIL S/A",
- "bank_branch": "6955",
- "bank_branch_digit": "0",
- "account": "1146208",
- "account_digit": "6",
- "account_type": "c",
- "pix_key": "01234567890",
- "document": "01234567890",
- "document_type": "cpf",
- "email": "recipient1@gmail.com",
- "created_at": "2020-07-20T13:19:10.000000Z",
- "updated_at": "2020-07-20T13:19:10.000000Z"
}, - "message": "Recipient created"
}
Get recipient by ID.
Return a recipient information using it's ID
Authorizations:
path Parameters
clientId required | integer The Client ID. |
recipientId required | integer The Recipient ID. |
Responses
Response samples
- 200
- 403
- 404
{- "id": 5,
- "wallet_uuid": "3e40f8f1-9f70-4f5d-97f9-90483027dfaa",
- "name": "My Recipient",
- "bank_code": "001",
- "bank_name": "001 - BANCO DO BRASIL S/A",
- "bank_branch": "6955",
- "bank_branch_digit": "0",
- "account": "1146208",
- "account_digit": "6",
- "account_type": "c",
- "pix_key": "01234567890",
- "document": "01234567890",
- "document_type": "cpf",
- "email": "recipient1@gmail.com",
- "created_at": "2020-07-20T13:19:10.000000Z",
- "updated_at": "2020-07-20T13:19:10.000000Z"
}
Response samples
- 200
- 400
- 403
{- "id": 0,
- "client": {
- "id": 0,
- "name": "string",
- "type": "string"
}, - "status": {
- "id": 0,
- "name": "string"
}, - "amount_cents": 0,
- "bank_branch": "string",
- "bank_branch_digit": "string",
- "pix_key": "string",
- "account": "string",
- "account_digit": "string",
- "payout_sent": 0,
- "notes": "string",
- "custom_code": "string",
- "converted_amount_cents": "string",
- "exchange_rate": "string",
- "exchange_bank": "string",
- "file_location": "string",
- "created_at": "string",
- "updated_at": "string"
}
Get client balance by ID.
Returns a client or recipient balance
Authorizations:
path Parameters
clientId required | integer The Client ID. |
query Parameters
recipient_id | string Use this if you want to retrieve a specific recipient balance |
Responses
Response samples
- 200
- 403
- 404
{- "status": true,
- "data": {
- "balance": 10000,
- "available_balance_cents": 9319,
- "updated_at": "2020-07-20T10:55:38-03:00"
}, - "message": "Client balance amount in cents"
}
Get Refund by id
Returns the refund using its unique identifier
Authorizations:
path Parameters
payinRefundId required | string |
Responses
Response samples
- 200
- 403
{- "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": true,
- "createdAt": "2022-03-11T17:14:47.000000Z"
}, - {
- "id": 2,
- "statusId": 2,
- "name": "Pago",
- "notification": true,
- "createdAt": "2022-03-11T17:14:49.000000Z"
}
], - "endToEndId": "EFASA321654987456ASAS123",
- "reason": "Devolvendo valores",
- "createdAt": "2022-03-11T17:31:03.000000Z",
- "updatedAt": "2022-03-11T17:31:05.000000Z"
}
Create Refund by payin id
Create a new refund.
To initiate a refund, the unique identifier of the pix payment must be informed in the "payinId" parameter.
Possible refunds statuses
- REQUESTED :
1
; Refund requested. - PAID :
2
; Refund was paid. - ERROR :
3
; Refund Error.
Some important rules
- Only charges credited to the wallet can be refunded.
- The customer must have at least the refund amount available in the wallet
- Only charges paid for 90 days or less can be refunded.
- The total amount of the refund will be deducted from the customer's wallet, even if the charge contains a split.
- The reason field is optional, its value is not forwarded to the end customer.
Authorizations:
path Parameters
payinRefundId required | string |
Request Body schema: application/json
amountCents required | number |
reason required | string non-empty |
callbackUrl required | string non-empty |
Responses
Request samples
- Payload
{- "amountCents": 10000,
- "reason": "refund reason",
}
Response samples
- 201
- 403
{- "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": true,
- "createdAt": "2022-03-11T17:14:47.000000Z"
}, - {
- "id": 2,
- "statusId": 2,
- "name": "Pago",
- "notification": true,
- "createdAt": "2022-03-11T17:14:49.000000Z"
}
], - "endToEndId": "EFASA321654987456ASAS123",
- "reason": "Devolvendo valores de teste",
- "createdAt": "2022-03-11T17:31:03.000000Z",
- "updatedAt": "2022-03-11T17:31:05.000000Z"
}