Pular para o conteúdo principal

WePayments API (1.2.1)

Download OpenAPI specification:Download

Use this API to access and manage your WePayments account data

All endpoints are available via https and are located at api.wepayout.com/v1/payout/.

Last update: 2023-11-13

Authentication

Authorization

WePayments offers an RFC 6750 Bearer Token authentication method

Security Scheme Type HTTP
HTTP Authorization Scheme bearer

Data Collect

The data collection lasts for 30 days. This process involves making a payment to the beneficiary with the provided bank details. If unsuccessful, we will attempt to contact the beneficiary to inform them about the data collection. Upon receiving a response, we will try to process the payment again to validate the bank details. The data collection will be automatically canceled on the 30th day if we do not receive any response from the beneficiary.

Data Collect Creation

The data collection statuses are:

First status:

  • RECEIVED: First status when the data collection is created;
    • Status ID: 1

Intermediary statuses:

  • COLLECTING_DATA: We are collecting the beneficiary's data; no payment attempts have been made yet.
    • Status ID: 14
  • PROCESSING_PIX_DATA_COLLECTED: Beneficiary's data received; payment attempt made.
    • Status ID: 8
  • PROCESSING_PIX_CPF: Payment processing using CPF as PIX Key.
    • Status ID: 2
  • PROCESSING_PIX_BANK_DATA: Payment processing using Pix with the provided banking information.
    • Status ID: 13
  • PROCESSING_PIX_KEY: Payment processing using Pix with the key of any type that was sent in the field pix_key.
    • Status ID: 15

Finished statuses:

  • CANCELED: Enters this final status after 30 days without successful data collection.
    • Status ID: 11
  • PAID: Data collection successful; payment received."
    • Status ID: 12
Request Body schema: application/json
merchant_id
required
integer

It must be your merchant_id given in the integration.

invoice
required
string <= 45 characters
amount
required
number [ 0.01 .. 150000 ]
name
required
string <= 150 characters
document
required
string

Exactly 11 or 14 numbers.

email
required
string
phone
required
string
pix_key
string

When you have a PIX key, but you don't know the type, you can send it to us, and we will try to make a payment for this key if the field direct_payment is equal to 1.

direct_payment
required
integer
Value: "0 or 1"

If 1, a PIX payment will be created before sending a notification email to collect the beneficiary bank data; if 0, the email will be sent before making the PIX payment.

notification_url
string <= 140 characters

A POST endpoint where the refund status updates will be sent. (under development).

description
string <= 140 characters

The description shown on the payment.

bank_code
string

Exactly 3 digits. mandatory if bank_branch, account, account_digitand account_typeare provided.

bank_branch
string <= 5 characters
account
string <= 16 characters
account_digit
string

Max 1 digit.

account_type
string
Enum: "S" "s" "C" "c" "CHECKING" "SAVINGS"

Responses

Callbacks

Request samples

Content type
application/json
{
  • "merchant_id": 123,
  • "invoice": "invoice2323",
  • "amount": 15000,
  • "name": "Beneficiary's name",
  • "document": "01234567890",
  • "email": "email@gmail.com",
  • "phone": "123456789",
  • "pix_key": "35489217650823194760983471254982",
  • "bank_code": "001",
  • "bank_branch": "1234",
  • "account": "2333",
  • "account_digit": "1",
  • "account_type": "CHECKING",
  • "direct_payment": 1,
}

Response samples

Content type
application/json
{
  • "id": 12345,
  • "direct_payment": 1,
  • "hash": "1803e619-467b-48a0-a6b6-28f0757e3c0d",
  • "merchant": {
    },
  • "status": {
    },
  • "last_event": {
    },
  • "name": "Beneficiary's name",
  • "document": "01234567890",
  • "email": "email@gmail.com",
  • "phone": "123456789",
  • "bank_code": "001",
  • "bank_branch": "1234",
  • "account": "2333",
  • "account_digit": "1",
  • "account_type": "CHECKING",
  • "amount": 15000,
  • "invoice": "42f7df50-b80d-4ae8-b741-bc5bc4a83a65",
  • "description": null,
  • "created_at": "2023-11-24T14:37:39.565469Z",
  • "updated_at": "2023-11-24T14:37:39.565469Z",
  • "bank": {
    },
  • "status_history": [ ]
}

Callback payload samples

Callback
POST: Receive status updates on data collection.
Content type
application/json
{
  • "id": 123,
  • "invoice": "e0dcf1d7-c0f6-43de-a426-ed8d1f5e4863",
  • "status": {
    }
}

Data Collection Retrieval by ID

This endpoint returns your data collection based on the ID provided in the route.

path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": 12345,
  • "direct_payment": 1,
  • "hash": "1803e619-467b-48a0-a6b6-28f0757e3c0d",
  • "merchant": {
    },
  • "status": {
    },
  • "last_event": {
    },
  • "name": "Beneficiary's name",
  • "document": "01234567890",
  • "email": "email@gmail.com",
  • "phone": "123456789",
  • "pix_key": "35489217650823194760983471254982",
  • "bank_code": "001",
  • "bank_branch": "1234",
  • "account": "2333",
  • "account_digit": "1",
  • "account_type": "CHECKING",
  • "amount": 15000,
  • "invoice": "42f7df50-b80d-4ae8-b741-bc5bc4a83a65",
  • "description": null,
  • "created_at": "2023-11-24T14:37:39.565469Z",
  • "updated_at": "2023-11-24T14:39:34.624073Z",
  • "bank": {
    },
  • "status_history": [
    ],
  • "payments": [
    ]
}