Create Charge
curl --request POST \
--url https://api.sandbox.wepayout.com.br/v1/payin/payments/credit-card \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"callbackUrl": "<string>",
"customNumber": "<string>",
"clientId": {},
"title": {
"title.expireDate": "<string>",
"title.amountInCents": 123,
"title.instructions": "<string>"
},
"buyer": {
"buyer.name": "<string>",
"buyer.document": {
"buyer.document.number": "<string>",
"buyer.document.type": "<string>"
},
"buyer.address": {
"buyer.address.street": "<string>",
"buyer.address.number": "<string>",
"buyer.address.complement": "<string>",
"buyer.address.zipCode": "<string>",
"buyer.address.city": "<string>",
"buyer.address.district": "<string>",
"buyer.address.stateCode": "<string>"
}
},
"refundMode": "<string>",
"sender": {
"sender.name": "<string>",
"sender.document": "<string>",
"sender.helpdesk": "<string>"
},
"checkout": {
"checkout.token": "<string>",
"checkout.card_id": 123,
"checkout.installments": 123,
"checkout.payment_method_id": "<string>",
"checkout.payer_name": "<string>",
"checkout.payer_phone": "<string>",
"checkout.payer_document": "<string>",
"checkout.payer_address": {
"checkout.payer_address.zip_code": "<string>",
"checkout.payer_address.street_name": "<string>",
"checkout.payer_address.street_number": "<string>"
},
"checkout.payer_email": "<string>",
"checkout.save_card": 123
},
"statement_descriptor": "<string>",
"product_info": {},
"use_3ds": {}
}
'import requests
url = "https://api.sandbox.wepayout.com.br/v1/payin/payments/credit-card"
payload = {
"callbackUrl": "<string>",
"customNumber": "<string>",
"clientId": {},
"title": {
"title.expireDate": "<string>",
"title.amountInCents": 123,
"title.instructions": "<string>"
},
"buyer": {
"buyer.name": "<string>",
"buyer.document": {
"buyer.document.number": "<string>",
"buyer.document.type": "<string>"
},
"buyer.address": {
"buyer.address.street": "<string>",
"buyer.address.number": "<string>",
"buyer.address.complement": "<string>",
"buyer.address.zipCode": "<string>",
"buyer.address.city": "<string>",
"buyer.address.district": "<string>",
"buyer.address.stateCode": "<string>"
}
},
"refundMode": "<string>",
"sender": {
"sender.name": "<string>",
"sender.document": "<string>",
"sender.helpdesk": "<string>"
},
"checkout": {
"checkout.token": "<string>",
"checkout.card_id": 123,
"checkout.installments": 123,
"checkout.payment_method_id": "<string>",
"checkout.payer_name": "<string>",
"checkout.payer_phone": "<string>",
"checkout.payer_document": "<string>",
"checkout.payer_address": {
"checkout.payer_address.zip_code": "<string>",
"checkout.payer_address.street_name": "<string>",
"checkout.payer_address.street_number": "<string>"
},
"checkout.payer_email": "<string>",
"checkout.save_card": 123
},
"statement_descriptor": "<string>",
"product_info": {},
"use_3ds": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
callbackUrl: '<string>',
customNumber: '<string>',
clientId: {},
title: {
'title.expireDate': '<string>',
'title.amountInCents': 123,
'title.instructions': '<string>'
},
buyer: {
'buyer.name': '<string>',
'buyer.document': {'buyer.document.number': '<string>', 'buyer.document.type': '<string>'},
'buyer.address': {
'buyer.address.street': '<string>',
'buyer.address.number': '<string>',
'buyer.address.complement': '<string>',
'buyer.address.zipCode': '<string>',
'buyer.address.city': '<string>',
'buyer.address.district': '<string>',
'buyer.address.stateCode': '<string>'
}
},
refundMode: '<string>',
sender: {
'sender.name': '<string>',
'sender.document': '<string>',
'sender.helpdesk': '<string>'
},
checkout: {
'checkout.token': '<string>',
'checkout.card_id': 123,
'checkout.installments': 123,
'checkout.payment_method_id': '<string>',
'checkout.payer_name': '<string>',
'checkout.payer_phone': '<string>',
'checkout.payer_document': '<string>',
'checkout.payer_address': {
'checkout.payer_address.zip_code': '<string>',
'checkout.payer_address.street_name': '<string>',
'checkout.payer_address.street_number': '<string>'
},
'checkout.payer_email': '<string>',
'checkout.save_card': 123
},
statement_descriptor: '<string>',
product_info: {},
use_3ds: {}
})
};
fetch('https://api.sandbox.wepayout.com.br/v1/payin/payments/credit-card', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.wepayout.com.br/v1/payin/payments/credit-card",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'callbackUrl' => '<string>',
'customNumber' => '<string>',
'clientId' => [
],
'title' => [
'title.expireDate' => '<string>',
'title.amountInCents' => 123,
'title.instructions' => '<string>'
],
'buyer' => [
'buyer.name' => '<string>',
'buyer.document' => [
'buyer.document.number' => '<string>',
'buyer.document.type' => '<string>'
],
'buyer.address' => [
'buyer.address.street' => '<string>',
'buyer.address.number' => '<string>',
'buyer.address.complement' => '<string>',
'buyer.address.zipCode' => '<string>',
'buyer.address.city' => '<string>',
'buyer.address.district' => '<string>',
'buyer.address.stateCode' => '<string>'
]
],
'refundMode' => '<string>',
'sender' => [
'sender.name' => '<string>',
'sender.document' => '<string>',
'sender.helpdesk' => '<string>'
],
'checkout' => [
'checkout.token' => '<string>',
'checkout.card_id' => 123,
'checkout.installments' => 123,
'checkout.payment_method_id' => '<string>',
'checkout.payer_name' => '<string>',
'checkout.payer_phone' => '<string>',
'checkout.payer_document' => '<string>',
'checkout.payer_address' => [
'checkout.payer_address.zip_code' => '<string>',
'checkout.payer_address.street_name' => '<string>',
'checkout.payer_address.street_number' => '<string>'
],
'checkout.payer_email' => '<string>',
'checkout.save_card' => 123
],
'statement_descriptor' => '<string>',
'product_info' => [
],
'use_3ds' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.wepayout.com.br/v1/payin/payments/credit-card"
payload := strings.NewReader("{\n \"callbackUrl\": \"<string>\",\n \"customNumber\": \"<string>\",\n \"clientId\": {},\n \"title\": {\n \"title.expireDate\": \"<string>\",\n \"title.amountInCents\": 123,\n \"title.instructions\": \"<string>\"\n },\n \"buyer\": {\n \"buyer.name\": \"<string>\",\n \"buyer.document\": {\n \"buyer.document.number\": \"<string>\",\n \"buyer.document.type\": \"<string>\"\n },\n \"buyer.address\": {\n \"buyer.address.street\": \"<string>\",\n \"buyer.address.number\": \"<string>\",\n \"buyer.address.complement\": \"<string>\",\n \"buyer.address.zipCode\": \"<string>\",\n \"buyer.address.city\": \"<string>\",\n \"buyer.address.district\": \"<string>\",\n \"buyer.address.stateCode\": \"<string>\"\n }\n },\n \"refundMode\": \"<string>\",\n \"sender\": {\n \"sender.name\": \"<string>\",\n \"sender.document\": \"<string>\",\n \"sender.helpdesk\": \"<string>\"\n },\n \"checkout\": {\n \"checkout.token\": \"<string>\",\n \"checkout.card_id\": 123,\n \"checkout.installments\": 123,\n \"checkout.payment_method_id\": \"<string>\",\n \"checkout.payer_name\": \"<string>\",\n \"checkout.payer_phone\": \"<string>\",\n \"checkout.payer_document\": \"<string>\",\n \"checkout.payer_address\": {\n \"checkout.payer_address.zip_code\": \"<string>\",\n \"checkout.payer_address.street_name\": \"<string>\",\n \"checkout.payer_address.street_number\": \"<string>\"\n },\n \"checkout.payer_email\": \"<string>\",\n \"checkout.save_card\": 123\n },\n \"statement_descriptor\": \"<string>\",\n \"product_info\": {},\n \"use_3ds\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.wepayout.com.br/v1/payin/payments/credit-card")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"callbackUrl\": \"<string>\",\n \"customNumber\": \"<string>\",\n \"clientId\": {},\n \"title\": {\n \"title.expireDate\": \"<string>\",\n \"title.amountInCents\": 123,\n \"title.instructions\": \"<string>\"\n },\n \"buyer\": {\n \"buyer.name\": \"<string>\",\n \"buyer.document\": {\n \"buyer.document.number\": \"<string>\",\n \"buyer.document.type\": \"<string>\"\n },\n \"buyer.address\": {\n \"buyer.address.street\": \"<string>\",\n \"buyer.address.number\": \"<string>\",\n \"buyer.address.complement\": \"<string>\",\n \"buyer.address.zipCode\": \"<string>\",\n \"buyer.address.city\": \"<string>\",\n \"buyer.address.district\": \"<string>\",\n \"buyer.address.stateCode\": \"<string>\"\n }\n },\n \"refundMode\": \"<string>\",\n \"sender\": {\n \"sender.name\": \"<string>\",\n \"sender.document\": \"<string>\",\n \"sender.helpdesk\": \"<string>\"\n },\n \"checkout\": {\n \"checkout.token\": \"<string>\",\n \"checkout.card_id\": 123,\n \"checkout.installments\": 123,\n \"checkout.payment_method_id\": \"<string>\",\n \"checkout.payer_name\": \"<string>\",\n \"checkout.payer_phone\": \"<string>\",\n \"checkout.payer_document\": \"<string>\",\n \"checkout.payer_address\": {\n \"checkout.payer_address.zip_code\": \"<string>\",\n \"checkout.payer_address.street_name\": \"<string>\",\n \"checkout.payer_address.street_number\": \"<string>\"\n },\n \"checkout.payer_email\": \"<string>\",\n \"checkout.save_card\": 123\n },\n \"statement_descriptor\": \"<string>\",\n \"product_info\": {},\n \"use_3ds\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.wepayout.com.br/v1/payin/payments/credit-card")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"callbackUrl\": \"<string>\",\n \"customNumber\": \"<string>\",\n \"clientId\": {},\n \"title\": {\n \"title.expireDate\": \"<string>\",\n \"title.amountInCents\": 123,\n \"title.instructions\": \"<string>\"\n },\n \"buyer\": {\n \"buyer.name\": \"<string>\",\n \"buyer.document\": {\n \"buyer.document.number\": \"<string>\",\n \"buyer.document.type\": \"<string>\"\n },\n \"buyer.address\": {\n \"buyer.address.street\": \"<string>\",\n \"buyer.address.number\": \"<string>\",\n \"buyer.address.complement\": \"<string>\",\n \"buyer.address.zipCode\": \"<string>\",\n \"buyer.address.city\": \"<string>\",\n \"buyer.address.district\": \"<string>\",\n \"buyer.address.stateCode\": \"<string>\"\n }\n },\n \"refundMode\": \"<string>\",\n \"sender\": {\n \"sender.name\": \"<string>\",\n \"sender.document\": \"<string>\",\n \"sender.helpdesk\": \"<string>\"\n },\n \"checkout\": {\n \"checkout.token\": \"<string>\",\n \"checkout.card_id\": 123,\n \"checkout.installments\": 123,\n \"checkout.payment_method_id\": \"<string>\",\n \"checkout.payer_name\": \"<string>\",\n \"checkout.payer_phone\": \"<string>\",\n \"checkout.payer_document\": \"<string>\",\n \"checkout.payer_address\": {\n \"checkout.payer_address.zip_code\": \"<string>\",\n \"checkout.payer_address.street_name\": \"<string>\",\n \"checkout.payer_address.street_number\": \"<string>\"\n },\n \"checkout.payer_email\": \"<string>\",\n \"checkout.save_card\": 123\n },\n \"statement_descriptor\": \"<string>\",\n \"product_info\": {},\n \"use_3ds\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "28018",
"key": "e1ebf9d914174902a76a5af436f091d09cca0b1e9ad8984b5dcdfeead67ce6b8",
"clientId": 1,
"clientName": "Your company",
"senderName": null,
"senderHelpdesk": null,
"buyerName": "Maria da Silva",
"buyerDocument": "34960826312",
"buyerEmail": "buyer-email@wepayments.com.br",
"customNumber": "YOUR-CODE1234",
"ourNumber": null,
"digitableLine": null,
"barCodeNumber": null,
"status": {
"id": 1,
"name": "awaiting approval"
},
"sender": {
"name": null,
"document": null,
"helpdesk": null
},
"typePayin": "credit-card",
"instructions": "Esse Pagamento é referente ao pedido 123 na loja abcd",
"amountCents": 8652,
"paidAmountCents": null,
"paidAt": null,
"expiresAt": "2024-12-31 23:59:59",
"createdAt": "2024-02-21T19:15:00.000000Z",
"fine": null,
"discount": null,
"statusHistory": [
{
"status": {
"id": 1,
"name": "Created"
}
},
{
"status": {
"id": 6,
"name": "awaiting approval"
},
"id": 48859,
"updatedAt": "2024-02-21T19:15:04.000000Z"
}
],
"refundMode": "FULL_REFUND_CLIENT",
"refundAmountCents": 0,
"payinRefunds": [],
"payin_substatus": null,
"kyc": null,
"installments": [],
"hasAdvancement": true,
"use3ds": false
}
{
"message": "Bad Resquest message"
}
{
"error": "Unauthorized"
}
{
"error": "Forbidden resource"
}
{
"status": false,
"message": "Payin not found",
"data": "No result were found for the given parameters. Please try again using other suported keys: id, key, ourNumber or end_to_end"
}
{
"status": false,
"message": "Validation error",
"data": {
"title.expireDate": [
"The title.expire date must be a date after now."
],
"product_info": [
"The product info field is required."
]
}
}
{
"status": false,
"message": "Server error"
}
CreditCard
Create Charge
Create a new credit card charge with payment page or transparent checkout
POST
/
v1
/
payin
/
payments
/
credit-card
Create Charge
curl --request POST \
--url https://api.sandbox.wepayout.com.br/v1/payin/payments/credit-card \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"callbackUrl": "<string>",
"customNumber": "<string>",
"clientId": {},
"title": {
"title.expireDate": "<string>",
"title.amountInCents": 123,
"title.instructions": "<string>"
},
"buyer": {
"buyer.name": "<string>",
"buyer.document": {
"buyer.document.number": "<string>",
"buyer.document.type": "<string>"
},
"buyer.address": {
"buyer.address.street": "<string>",
"buyer.address.number": "<string>",
"buyer.address.complement": "<string>",
"buyer.address.zipCode": "<string>",
"buyer.address.city": "<string>",
"buyer.address.district": "<string>",
"buyer.address.stateCode": "<string>"
}
},
"refundMode": "<string>",
"sender": {
"sender.name": "<string>",
"sender.document": "<string>",
"sender.helpdesk": "<string>"
},
"checkout": {
"checkout.token": "<string>",
"checkout.card_id": 123,
"checkout.installments": 123,
"checkout.payment_method_id": "<string>",
"checkout.payer_name": "<string>",
"checkout.payer_phone": "<string>",
"checkout.payer_document": "<string>",
"checkout.payer_address": {
"checkout.payer_address.zip_code": "<string>",
"checkout.payer_address.street_name": "<string>",
"checkout.payer_address.street_number": "<string>"
},
"checkout.payer_email": "<string>",
"checkout.save_card": 123
},
"statement_descriptor": "<string>",
"product_info": {},
"use_3ds": {}
}
'import requests
url = "https://api.sandbox.wepayout.com.br/v1/payin/payments/credit-card"
payload = {
"callbackUrl": "<string>",
"customNumber": "<string>",
"clientId": {},
"title": {
"title.expireDate": "<string>",
"title.amountInCents": 123,
"title.instructions": "<string>"
},
"buyer": {
"buyer.name": "<string>",
"buyer.document": {
"buyer.document.number": "<string>",
"buyer.document.type": "<string>"
},
"buyer.address": {
"buyer.address.street": "<string>",
"buyer.address.number": "<string>",
"buyer.address.complement": "<string>",
"buyer.address.zipCode": "<string>",
"buyer.address.city": "<string>",
"buyer.address.district": "<string>",
"buyer.address.stateCode": "<string>"
}
},
"refundMode": "<string>",
"sender": {
"sender.name": "<string>",
"sender.document": "<string>",
"sender.helpdesk": "<string>"
},
"checkout": {
"checkout.token": "<string>",
"checkout.card_id": 123,
"checkout.installments": 123,
"checkout.payment_method_id": "<string>",
"checkout.payer_name": "<string>",
"checkout.payer_phone": "<string>",
"checkout.payer_document": "<string>",
"checkout.payer_address": {
"checkout.payer_address.zip_code": "<string>",
"checkout.payer_address.street_name": "<string>",
"checkout.payer_address.street_number": "<string>"
},
"checkout.payer_email": "<string>",
"checkout.save_card": 123
},
"statement_descriptor": "<string>",
"product_info": {},
"use_3ds": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
callbackUrl: '<string>',
customNumber: '<string>',
clientId: {},
title: {
'title.expireDate': '<string>',
'title.amountInCents': 123,
'title.instructions': '<string>'
},
buyer: {
'buyer.name': '<string>',
'buyer.document': {'buyer.document.number': '<string>', 'buyer.document.type': '<string>'},
'buyer.address': {
'buyer.address.street': '<string>',
'buyer.address.number': '<string>',
'buyer.address.complement': '<string>',
'buyer.address.zipCode': '<string>',
'buyer.address.city': '<string>',
'buyer.address.district': '<string>',
'buyer.address.stateCode': '<string>'
}
},
refundMode: '<string>',
sender: {
'sender.name': '<string>',
'sender.document': '<string>',
'sender.helpdesk': '<string>'
},
checkout: {
'checkout.token': '<string>',
'checkout.card_id': 123,
'checkout.installments': 123,
'checkout.payment_method_id': '<string>',
'checkout.payer_name': '<string>',
'checkout.payer_phone': '<string>',
'checkout.payer_document': '<string>',
'checkout.payer_address': {
'checkout.payer_address.zip_code': '<string>',
'checkout.payer_address.street_name': '<string>',
'checkout.payer_address.street_number': '<string>'
},
'checkout.payer_email': '<string>',
'checkout.save_card': 123
},
statement_descriptor: '<string>',
product_info: {},
use_3ds: {}
})
};
fetch('https://api.sandbox.wepayout.com.br/v1/payin/payments/credit-card', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.wepayout.com.br/v1/payin/payments/credit-card",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'callbackUrl' => '<string>',
'customNumber' => '<string>',
'clientId' => [
],
'title' => [
'title.expireDate' => '<string>',
'title.amountInCents' => 123,
'title.instructions' => '<string>'
],
'buyer' => [
'buyer.name' => '<string>',
'buyer.document' => [
'buyer.document.number' => '<string>',
'buyer.document.type' => '<string>'
],
'buyer.address' => [
'buyer.address.street' => '<string>',
'buyer.address.number' => '<string>',
'buyer.address.complement' => '<string>',
'buyer.address.zipCode' => '<string>',
'buyer.address.city' => '<string>',
'buyer.address.district' => '<string>',
'buyer.address.stateCode' => '<string>'
]
],
'refundMode' => '<string>',
'sender' => [
'sender.name' => '<string>',
'sender.document' => '<string>',
'sender.helpdesk' => '<string>'
],
'checkout' => [
'checkout.token' => '<string>',
'checkout.card_id' => 123,
'checkout.installments' => 123,
'checkout.payment_method_id' => '<string>',
'checkout.payer_name' => '<string>',
'checkout.payer_phone' => '<string>',
'checkout.payer_document' => '<string>',
'checkout.payer_address' => [
'checkout.payer_address.zip_code' => '<string>',
'checkout.payer_address.street_name' => '<string>',
'checkout.payer_address.street_number' => '<string>'
],
'checkout.payer_email' => '<string>',
'checkout.save_card' => 123
],
'statement_descriptor' => '<string>',
'product_info' => [
],
'use_3ds' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.wepayout.com.br/v1/payin/payments/credit-card"
payload := strings.NewReader("{\n \"callbackUrl\": \"<string>\",\n \"customNumber\": \"<string>\",\n \"clientId\": {},\n \"title\": {\n \"title.expireDate\": \"<string>\",\n \"title.amountInCents\": 123,\n \"title.instructions\": \"<string>\"\n },\n \"buyer\": {\n \"buyer.name\": \"<string>\",\n \"buyer.document\": {\n \"buyer.document.number\": \"<string>\",\n \"buyer.document.type\": \"<string>\"\n },\n \"buyer.address\": {\n \"buyer.address.street\": \"<string>\",\n \"buyer.address.number\": \"<string>\",\n \"buyer.address.complement\": \"<string>\",\n \"buyer.address.zipCode\": \"<string>\",\n \"buyer.address.city\": \"<string>\",\n \"buyer.address.district\": \"<string>\",\n \"buyer.address.stateCode\": \"<string>\"\n }\n },\n \"refundMode\": \"<string>\",\n \"sender\": {\n \"sender.name\": \"<string>\",\n \"sender.document\": \"<string>\",\n \"sender.helpdesk\": \"<string>\"\n },\n \"checkout\": {\n \"checkout.token\": \"<string>\",\n \"checkout.card_id\": 123,\n \"checkout.installments\": 123,\n \"checkout.payment_method_id\": \"<string>\",\n \"checkout.payer_name\": \"<string>\",\n \"checkout.payer_phone\": \"<string>\",\n \"checkout.payer_document\": \"<string>\",\n \"checkout.payer_address\": {\n \"checkout.payer_address.zip_code\": \"<string>\",\n \"checkout.payer_address.street_name\": \"<string>\",\n \"checkout.payer_address.street_number\": \"<string>\"\n },\n \"checkout.payer_email\": \"<string>\",\n \"checkout.save_card\": 123\n },\n \"statement_descriptor\": \"<string>\",\n \"product_info\": {},\n \"use_3ds\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.wepayout.com.br/v1/payin/payments/credit-card")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"callbackUrl\": \"<string>\",\n \"customNumber\": \"<string>\",\n \"clientId\": {},\n \"title\": {\n \"title.expireDate\": \"<string>\",\n \"title.amountInCents\": 123,\n \"title.instructions\": \"<string>\"\n },\n \"buyer\": {\n \"buyer.name\": \"<string>\",\n \"buyer.document\": {\n \"buyer.document.number\": \"<string>\",\n \"buyer.document.type\": \"<string>\"\n },\n \"buyer.address\": {\n \"buyer.address.street\": \"<string>\",\n \"buyer.address.number\": \"<string>\",\n \"buyer.address.complement\": \"<string>\",\n \"buyer.address.zipCode\": \"<string>\",\n \"buyer.address.city\": \"<string>\",\n \"buyer.address.district\": \"<string>\",\n \"buyer.address.stateCode\": \"<string>\"\n }\n },\n \"refundMode\": \"<string>\",\n \"sender\": {\n \"sender.name\": \"<string>\",\n \"sender.document\": \"<string>\",\n \"sender.helpdesk\": \"<string>\"\n },\n \"checkout\": {\n \"checkout.token\": \"<string>\",\n \"checkout.card_id\": 123,\n \"checkout.installments\": 123,\n \"checkout.payment_method_id\": \"<string>\",\n \"checkout.payer_name\": \"<string>\",\n \"checkout.payer_phone\": \"<string>\",\n \"checkout.payer_document\": \"<string>\",\n \"checkout.payer_address\": {\n \"checkout.payer_address.zip_code\": \"<string>\",\n \"checkout.payer_address.street_name\": \"<string>\",\n \"checkout.payer_address.street_number\": \"<string>\"\n },\n \"checkout.payer_email\": \"<string>\",\n \"checkout.save_card\": 123\n },\n \"statement_descriptor\": \"<string>\",\n \"product_info\": {},\n \"use_3ds\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.wepayout.com.br/v1/payin/payments/credit-card")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"callbackUrl\": \"<string>\",\n \"customNumber\": \"<string>\",\n \"clientId\": {},\n \"title\": {\n \"title.expireDate\": \"<string>\",\n \"title.amountInCents\": 123,\n \"title.instructions\": \"<string>\"\n },\n \"buyer\": {\n \"buyer.name\": \"<string>\",\n \"buyer.document\": {\n \"buyer.document.number\": \"<string>\",\n \"buyer.document.type\": \"<string>\"\n },\n \"buyer.address\": {\n \"buyer.address.street\": \"<string>\",\n \"buyer.address.number\": \"<string>\",\n \"buyer.address.complement\": \"<string>\",\n \"buyer.address.zipCode\": \"<string>\",\n \"buyer.address.city\": \"<string>\",\n \"buyer.address.district\": \"<string>\",\n \"buyer.address.stateCode\": \"<string>\"\n }\n },\n \"refundMode\": \"<string>\",\n \"sender\": {\n \"sender.name\": \"<string>\",\n \"sender.document\": \"<string>\",\n \"sender.helpdesk\": \"<string>\"\n },\n \"checkout\": {\n \"checkout.token\": \"<string>\",\n \"checkout.card_id\": 123,\n \"checkout.installments\": 123,\n \"checkout.payment_method_id\": \"<string>\",\n \"checkout.payer_name\": \"<string>\",\n \"checkout.payer_phone\": \"<string>\",\n \"checkout.payer_document\": \"<string>\",\n \"checkout.payer_address\": {\n \"checkout.payer_address.zip_code\": \"<string>\",\n \"checkout.payer_address.street_name\": \"<string>\",\n \"checkout.payer_address.street_number\": \"<string>\"\n },\n \"checkout.payer_email\": \"<string>\",\n \"checkout.save_card\": 123\n },\n \"statement_descriptor\": \"<string>\",\n \"product_info\": {},\n \"use_3ds\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "28018",
"key": "e1ebf9d914174902a76a5af436f091d09cca0b1e9ad8984b5dcdfeead67ce6b8",
"clientId": 1,
"clientName": "Your company",
"senderName": null,
"senderHelpdesk": null,
"buyerName": "Maria da Silva",
"buyerDocument": "34960826312",
"buyerEmail": "buyer-email@wepayments.com.br",
"customNumber": "YOUR-CODE1234",
"ourNumber": null,
"digitableLine": null,
"barCodeNumber": null,
"status": {
"id": 1,
"name": "awaiting approval"
},
"sender": {
"name": null,
"document": null,
"helpdesk": null
},
"typePayin": "credit-card",
"instructions": "Esse Pagamento é referente ao pedido 123 na loja abcd",
"amountCents": 8652,
"paidAmountCents": null,
"paidAt": null,
"expiresAt": "2024-12-31 23:59:59",
"createdAt": "2024-02-21T19:15:00.000000Z",
"fine": null,
"discount": null,
"statusHistory": [
{
"status": {
"id": 1,
"name": "Created"
}
},
{
"status": {
"id": 6,
"name": "awaiting approval"
},
"id": 48859,
"updatedAt": "2024-02-21T19:15:04.000000Z"
}
],
"refundMode": "FULL_REFUND_CLIENT",
"refundAmountCents": 0,
"payinRefunds": [],
"payin_substatus": null,
"kyc": null,
"installments": [],
"hasAdvancement": true,
"use3ds": false
}
{
"message": "Bad Resquest message"
}
{
"error": "Unauthorized"
}
{
"error": "Forbidden resource"
}
{
"status": false,
"message": "Payin not found",
"data": "No result were found for the given parameters. Please try again using other suported keys: id, key, ourNumber or end_to_end"
}
{
"status": false,
"message": "Validation error",
"data": {
"title.expireDate": [
"The title.expire date must be a date after now."
],
"product_info": [
"The product info field is required."
]
}
}
{
"status": false,
"message": "Server error"
}
Request Body
string
required
The url where we will submit the callbacks.
string
required
Your identification number, it must be unique on our database.
integer or null
The use of clientID to create payments. Is mandatory if there is more than one account under the same clientId.
object
required
object
required
The person that you are charging object.
Show buyer properties
Show buyer properties
string
required
Buyer’s full name
object
required
string
Default:
FULL_REFUND_CLIENTEnum: FULL_REFUND_CLIENT, FULL_REFUND_RECIPIENT, REFUND_BY_SPLITEnum of some refund options.object
required
REQUIRED FOR CREDIT-CARD CHARGES.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.
object
Payer informations for transparent checkout. Use
token for new card payment or card_id for saved card payment.Show checkout properties
Show checkout properties
string
Card token generated by the tokenization process. Required if
card_id is not provided. Max length: 190 characters.integer
ID of a previously saved credit card. Required if
token is not provided.integer
required
Number of installments (1 for single payment). Required unless checkout is null.
string
Payment method identifier (e.g., “master”, “visa”, “elo”). Max length: 30 characters. Required if
card_id is not provided.string
required
Payer’s full name. Max length: 100 characters. Required unless checkout is null.
string
Payer’s phone number. Must be numeric with 5 to 45 digits.
string
Payer’s CPF or CNPJ number. Must be a valid tax number.
object
Show payer_address properties
Show payer_address properties
string
Payer’s email address. Required if
save_card is set to 1.integer
Flag to save card for future use.
0 = do not save, 1 = save card. Must be 0 or 1.string
Short description shown at the credit-card bill.
array of objects
Array with product metadata.
integer or null
Default:
nullEnum: 0, 1, nullFlag to inform that the charge must validate through three d secure modeResponse
string
Charge ID
string
Unique key for payment page access
integer
Client ID
string
Client name
string or null
Sender name
string or null
Sender helpdesk
string
Buyer name
string
Buyer document
string
Buyer email
string
Your custom number
string or null
Our internal number
string or null
Digitable line (for boleto)
string or null
Bar code number (for boleto)
object
Sender information
string
Type of payment (e.g., “credit-card”)
string
Payment instructions
integer
Amount in cents
integer or null
Paid amount in cents
string or null
Payment date
string
Expiration date
string
Creation date
object or null
Fine information
object or null
Discount information
array
Status change history
string
Refund mode
integer
Refunded amount in cents
array
Refund records
string or null
Sub-status
object or null
KYC information
array
Installment information
boolean
Has advancement flag
boolean
3D Secure flag
{
"id": "28018",
"key": "e1ebf9d914174902a76a5af436f091d09cca0b1e9ad8984b5dcdfeead67ce6b8",
"clientId": 1,
"clientName": "Your company",
"senderName": null,
"senderHelpdesk": null,
"buyerName": "Maria da Silva",
"buyerDocument": "34960826312",
"buyerEmail": "buyer-email@wepayments.com.br",
"customNumber": "YOUR-CODE1234",
"ourNumber": null,
"digitableLine": null,
"barCodeNumber": null,
"status": {
"id": 1,
"name": "awaiting approval"
},
"sender": {
"name": null,
"document": null,
"helpdesk": null
},
"typePayin": "credit-card",
"instructions": "Esse Pagamento é referente ao pedido 123 na loja abcd",
"amountCents": 8652,
"paidAmountCents": null,
"paidAt": null,
"expiresAt": "2024-12-31 23:59:59",
"createdAt": "2024-02-21T19:15:00.000000Z",
"fine": null,
"discount": null,
"statusHistory": [
{
"status": {
"id": 1,
"name": "Created"
}
},
{
"status": {
"id": 6,
"name": "awaiting approval"
},
"id": 48859,
"updatedAt": "2024-02-21T19:15:04.000000Z"
}
],
"refundMode": "FULL_REFUND_CLIENT",
"refundAmountCents": 0,
"payinRefunds": [],
"payin_substatus": null,
"kyc": null,
"installments": [],
"hasAdvancement": true,
"use3ds": false
}
{
"message": "Bad Resquest message"
}
{
"error": "Unauthorized"
}
{
"error": "Forbidden resource"
}
{
"status": false,
"message": "Payin not found",
"data": "No result were found for the given parameters. Please try again using other suported keys: id, key, ourNumber or end_to_end"
}
{
"status": false,
"message": "Validation error",
"data": {
"title.expireDate": [
"The title.expire date must be a date after now."
],
"product_info": [
"The product info field is required."
]
}
}
{
"status": false,
"message": "Server error"
}
Was this page helpful?
⌘I

