WePayOut's Payin API (1.1)

Download OpenAPI specification:Download

Use this API to create payin in operations

Authentication

bearerAuth

Security Scheme Type HTTP
HTTP Authorization Scheme bearer

Charge

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 boleto operations

object

Available only for boletooperations

Array of objects

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

Content type
application/json
Example
{
  • "customNumber": "1234",
  • "title": {
    },
  • "buyer": {
    }
}

Response samples

Content type
application/json
{
  • "key": "string",
  • "clientId": 0,
  • "clientName": "string",
  • "buyerName": "string",
  • "buyerDocument": "string",
  • "customNumber": "string",
  • "ourNumber": "string",
  • "digitableLine": "string",
  • "barCodeNumber": "string",
  • "status": {
    },
  • "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": [
    ],
  • "statusHistory": [
    ],
  • "sender": {
    },
  • "payinRefunds": [
    ],
  • "refundAmountCents": 1000
}

Callback payload samples

Callback
POST: Receive payin status updates.
Content type
application/json
{
  • "key": "string",
  • "clientId": 0,
  • "clientName": "string",
  • "buyerName": "string",
  • "buyerDocument": "string",
  • "customNumber": "string",
  • "ourNumber": "string",
  • "digitableLine": "string",
  • "barCodeNumber": "string",
  • "status": {
    },
  • "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": [
    ],
  • "statusHistory": [
    ],
  • "sender": {
    },
  • "payinRefunds": [
    ],
  • "refundAmountCents": 1000
}

Returns a payin by KEY.

Returns the charge using one of it's identifications parameters

Authorizations:
path Parameters
keyTipe
required
string

Should be ourNumber, id or key

key
required
integer

The Key of the payin.

Responses

Response samples

Content type
application/json
{
  • "key": "string",
  • "clientId": 0,
  • "clientName": "string",
  • "buyerName": "string",
  • "buyerDocument": "string",
  • "customNumber": "string",
  • "ourNumber": "string",
  • "digitableLine": "string",
  • "barCodeNumber": "string",
  • "status": {
    },
  • "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": [
    ],
  • "statusHistory": [
    ],
  • "sender": {
    },
  • "payinRefunds": [
    ],
  • "refundAmountCents": 1000
}

Returns a the printable payin HTML from a provided KEY.

Available only for boleto charges.

Authorizations:
path Parameters
key
required
integer

The Key of the payin.

Responses

Response samples

Content type
application/json
"\"<style></style><div>here will be the charge html</div>\""

Recipient

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

Content type
application/json
{
  • "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

Content type
application/json
{
  • "status": true,
  • "data": {
    },
  • "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

Content type
application/json
{
  • "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

Content type
application/json
{
  • "status": true,
  • "data": {
    },
  • "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

Content type
application/json
{
  • "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"
}

Create withdrawal for recipient

Authorizations:
path Parameters
clientId
required
string

Responses

Client Balance

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

Content type
application/json
{
  • "status": true,
  • "data": {
    },
  • "message": "Client balance amount in cents"
}

Payin Refund

Get Refund by id

Returns the refund using its unique identifier

Authorizations:
path Parameters
payinRefundId
required
string

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "payinId": 1,
  • "statusId": 2,
  • "user": {
    },
  • "clientId": 1,
  • "amountCents": 100,
  • "statuses": [
    ],
  • "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
payinId
required
string

Identification of the charge to be refunded

Request Body schema: application/json
amountCents
required
integer [ 0 .. 10000000 ]

Amount to be refunded

reason
string [ 1 .. 191 ] characters

Reason for refund

callbackUrl
string [ 1 .. 191 ] characters

URL for sending the webhook

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "id": 1,
  • "payinId": 1,
  • "statusId": 2,
  • "user": {
    },
  • "clientId": 1,
  • "amountCents": 100,
  • "statuses": [
    ],
  • "endToEndId": "EFASA321654987456ASAS123",
  • "reason": "Devolvendo valores de teste",
  • "createdAt": "2022-03-11T17:31:03.000000Z",
  • "updatedAt": "2022-03-11T17:31:05.000000Z"
}

Subscription

List Subscription

List the subscriptions

Authorizations:
query Parameters
id
number

Subscription code

buyer_document
string

Buyer Document

invoice
string

Invoice

status_id
string
Enum: "21" "22" "23"

Subscription Status Id

client_id
string

Client Code

created_before
string

Created before

created_after
string

Created after

per_page
string

Per page

page
string

Page

sort
string
Enum: "ASC" "DESC"

sort

order_by
string

Order By

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create Subscription

Create a new subscription

Attention points

  • When selecting WEEKLY for subscription frequency, the maximum value allowed for the dateFirt field is 7
  • When selecting MONTHLY for subscription frequency, the maximum value allowed for the dateFirt field is 30
  • The charges generated from the subscription are of the PIX type
  • Subscription only sends webhook to expired status.
  • The same value entered for callbackUrl will be used to notify billing and subscription statuses.
Authorizations:
Request Body schema: application/json
invoice
required
string non-empty
callbackUrl
string non-empty
instructions
required
string non-empty
amountCents
required
integer
object
required
object
dateFirst
required
string <date> non-empty
daysBeforeExpiration
required
integer
frequency
required
string non-empty
Enum: "WEEKLY" "MONTHLY"
quantity
integer >= 2
clientId
required
integer

Responses

Request samples

Content type
application/json
{
  • "invoice": "string",
  • "callbackUrl": "string",
  • "instructions": "string",
  • "amountCents": 0,
  • "sender": {
    },
  • "buyer": {
    },
  • "dateFirst": "string",
  • "daysBeforeExpiration": 0,
  • "frequency": "string",
  • "quantity": "string",
  • "clientId": 0
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "invoice": "string",
  • "callbackUrl": "string",
  • "client": {
    },
  • "status": {
    },
  • "instructions": "string",
  • "amountCents": 0,
  • "sender": {
    },
  • "buyer": {
    },
  • "dateNextIssue": "2019-08-24",
  • "dateLastPaid": "2019-08-24",
  • "dateFirst": "2019-08-24",
  • "daysBeforeExpiration": 0,
  • "frequency": "MONTHLY",
  • "quantity": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Get Subscription By ID

Authorizations:
path Parameters
id
required
string

Subscription Code

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "invoice": "string",
  • "callbackUrl": "string",
  • "client": {
    },
  • "status": {
    },
  • "instructions": "string",
  • "amountCents": 0,
  • "sender": {
    },
  • "buyer": {
    },
  • "dateNextIssue": "2019-08-24",
  • "dateLastPaid": "2019-08-24",
  • "dateFirst": "2019-08-24",
  • "daysBeforeExpiration": 0,
  • "frequency": "MONTHLY",
  • "quantity": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Cancel Subscription By ID

Authorizations:
path Parameters
id
required
string

Subscription Code

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "invoice": "string",
  • "callbackUrl": "string",
  • "client": {
    },
  • "status": {
    },
  • "instructions": "string",
  • "amountCents": 0,
  • "sender": {
    },
  • "buyer": {
    },
  • "dateNextIssue": "2019-08-24",
  • "dateLastPaid": "2019-08-24",
  • "dateFirst": "2019-08-24",
  • "daysBeforeExpiration": 0,
  • "frequency": "MONTHLY",
  • "quantity": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Get Preview

Preview

Creates preview of the due date and generation date of future charges.
A total of maximum 6 charges will be returned.

Authorizations:
Request Body schema: application/json
dateFirst
required
string <date> non-empty
daysBeforeExpiration
required
integer
frequency
required
string non-empty
Enum: "WEEKLY" "MONTHLY"
quantity
integer

Responses

Request samples

Content type
application/json
{
  • "dateFirst": "string",
  • "daysBeforeExpiration": 0,
  • "frequency": "string",
  • "quantity": "string"
}

Response samples

Content type
application/json
[
  • {
    }
]