Checkout
Redirect checkout
To generate a transaction through PayMee, it is necessary to send a request using the POST method to the checkout resource, as shown. This example covers the minimum of submitted fields required for authorization.
POST
/
v1.1
/
checkout
Redirect checkout
curl --request POST \
--url https://api.paymee.com.br/v1.1/checkout \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-api-token: <x-api-token>' \
--data '
{
"amount": 1.99,
"callbackURL": "https://foo.bar/paymeeListener",
"currency": "BRL",
"maxAge": 120,
"paymentMethod": "ITAU_TRANSFER_PFF",
"referenceCode": "refcode12345",
"shopper": {
"bankDetails": {
"account": "12345-6",
"branch": "1234"
},
"document": {
"number": "00000000000",
"type": "CPF"
},
"email": "foo@bar.com.br",
"name": "JOHN DOE",
"phone": {
"number": "11999990000",
"type": "WORK"
}
}
}
'import requests
url = "https://api.paymee.com.br/v1.1/checkout"
payload = {
"amount": 1.99,
"callbackURL": "https://foo.bar/paymeeListener",
"currency": "BRL",
"maxAge": 120,
"paymentMethod": "ITAU_TRANSFER_PFF",
"referenceCode": "refcode12345",
"shopper": {
"bankDetails": {
"account": "12345-6",
"branch": "1234"
},
"document": {
"number": "00000000000",
"type": "CPF"
},
"email": "foo@bar.com.br",
"name": "JOHN DOE",
"phone": {
"number": "11999990000",
"type": "WORK"
}
}
}
headers = {
"x-api-key": "<x-api-key>",
"x-api-token": "<x-api-token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-key': '<x-api-key>',
'x-api-token': '<x-api-token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: 1.99,
callbackURL: 'https://foo.bar/paymeeListener',
currency: 'BRL',
maxAge: 120,
paymentMethod: 'ITAU_TRANSFER_PFF',
referenceCode: 'refcode12345',
shopper: {
bankDetails: {account: '12345-6', branch: '1234'},
document: {number: '00000000000', type: 'CPF'},
email: 'foo@bar.com.br',
name: 'JOHN DOE',
phone: {number: '11999990000', type: 'WORK'}
}
})
};
fetch('https://api.paymee.com.br/v1.1/checkout', 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.paymee.com.br/v1.1/checkout",
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([
'amount' => 1.99,
'callbackURL' => 'https://foo.bar/paymeeListener',
'currency' => 'BRL',
'maxAge' => 120,
'paymentMethod' => 'ITAU_TRANSFER_PFF',
'referenceCode' => 'refcode12345',
'shopper' => [
'bankDetails' => [
'account' => '12345-6',
'branch' => '1234'
],
'document' => [
'number' => '00000000000',
'type' => 'CPF'
],
'email' => 'foo@bar.com.br',
'name' => 'JOHN DOE',
'phone' => [
'number' => '11999990000',
'type' => 'WORK'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-api-key>",
"x-api-token: <x-api-token>"
],
]);
$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.paymee.com.br/v1.1/checkout"
payload := strings.NewReader("{\n \"amount\": 1.99,\n \"callbackURL\": \"https://foo.bar/paymeeListener\",\n \"currency\": \"BRL\",\n \"maxAge\": 120,\n \"paymentMethod\": \"ITAU_TRANSFER_PFF\",\n \"referenceCode\": \"refcode12345\",\n \"shopper\": {\n \"bankDetails\": {\n \"account\": \"12345-6\",\n \"branch\": \"1234\"\n },\n \"document\": {\n \"number\": \"00000000000\",\n \"type\": \"CPF\"\n },\n \"email\": \"foo@bar.com.br\",\n \"name\": \"JOHN DOE\",\n \"phone\": {\n \"number\": \"11999990000\",\n \"type\": \"WORK\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("x-api-token", "<x-api-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.paymee.com.br/v1.1/checkout")
.header("x-api-key", "<x-api-key>")
.header("x-api-token", "<x-api-token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 1.99,\n \"callbackURL\": \"https://foo.bar/paymeeListener\",\n \"currency\": \"BRL\",\n \"maxAge\": 120,\n \"paymentMethod\": \"ITAU_TRANSFER_PFF\",\n \"referenceCode\": \"refcode12345\",\n \"shopper\": {\n \"bankDetails\": {\n \"account\": \"12345-6\",\n \"branch\": \"1234\"\n },\n \"document\": {\n \"number\": \"00000000000\",\n \"type\": \"CPF\"\n },\n \"email\": \"foo@bar.com.br\",\n \"name\": \"JOHN DOE\",\n \"phone\": {\n \"number\": \"11999990000\",\n \"type\": \"WORK\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paymee.com.br/v1.1/checkout")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["x-api-token"] = '<x-api-token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 1.99,\n \"callbackURL\": \"https://foo.bar/paymeeListener\",\n \"currency\": \"BRL\",\n \"maxAge\": 120,\n \"paymentMethod\": \"ITAU_TRANSFER_PFF\",\n \"referenceCode\": \"refcode12345\",\n \"shopper\": {\n \"bankDetails\": {\n \"account\": \"12345-6\",\n \"branch\": \"1234\"\n },\n \"document\": {\n \"number\": \"00000000000\",\n \"type\": \"CPF\"\n },\n \"email\": \"foo@bar.com.br\",\n \"name\": \"JOHN DOE\",\n \"phone\": {\n \"number\": \"11999990000\",\n \"type\": \"WORK\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"status": 0,
"message": "success",
"response": {
"amount": 1.99,
"gatewayURL": "https://secure.paymee.com.br/redir/55f6bb4e-d1aa-361e-bce3-758fd57ab6d0",
"referenceCode": "refcode12345",
"saleCode": "0002405",
"shopper": {
"bankDetails": {
"account": "12345-6",
"branch": "1234"
},
"document": {
"number": "00000000000",
"type": "CPF"
},
"email": "foo@bar.com.br",
"name": "JOHN DOE",
"phone": {
"number": "11999990000",
"type": "MOBILE"
}
},
"uuid": "55f6bb4e-d1aa-361e-bce3-758fd57ab6d0"
}
}Headers
Example:
"your-x-api-key"
Example:
"your-x-api-token"
Body
application/json
ISO-4217 currency code
Maximum string length:
3Example:
"BRL"
Order Amount
Example:
1.99
Unique order identifier
Maximum string length:
50Example:
"refcode12345"
Show child attributes
Show child attributes
Sale max age in minutes
Required range:
x <= 43200Example:
120
Chosen payment method
Example:
"ITAU_TRANSFER_PFF"
Callback URL for transaction updates
Maximum string length:
255Example:
"https://foo.bar/paymeeListener"
Any internal reference
Maximum string length:
255Previous
Individual payout requestPayouts at PayMee are cash-out transactions;
Before we start, there are some important tips:
1. you must have sufficient funds;
2. you shoud provide a valid and complete beneficiary details
3. Register your server CIDR for production enviroment
Next
⌘I
Redirect checkout
curl --request POST \
--url https://api.paymee.com.br/v1.1/checkout \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-api-token: <x-api-token>' \
--data '
{
"amount": 1.99,
"callbackURL": "https://foo.bar/paymeeListener",
"currency": "BRL",
"maxAge": 120,
"paymentMethod": "ITAU_TRANSFER_PFF",
"referenceCode": "refcode12345",
"shopper": {
"bankDetails": {
"account": "12345-6",
"branch": "1234"
},
"document": {
"number": "00000000000",
"type": "CPF"
},
"email": "foo@bar.com.br",
"name": "JOHN DOE",
"phone": {
"number": "11999990000",
"type": "WORK"
}
}
}
'import requests
url = "https://api.paymee.com.br/v1.1/checkout"
payload = {
"amount": 1.99,
"callbackURL": "https://foo.bar/paymeeListener",
"currency": "BRL",
"maxAge": 120,
"paymentMethod": "ITAU_TRANSFER_PFF",
"referenceCode": "refcode12345",
"shopper": {
"bankDetails": {
"account": "12345-6",
"branch": "1234"
},
"document": {
"number": "00000000000",
"type": "CPF"
},
"email": "foo@bar.com.br",
"name": "JOHN DOE",
"phone": {
"number": "11999990000",
"type": "WORK"
}
}
}
headers = {
"x-api-key": "<x-api-key>",
"x-api-token": "<x-api-token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-key': '<x-api-key>',
'x-api-token': '<x-api-token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: 1.99,
callbackURL: 'https://foo.bar/paymeeListener',
currency: 'BRL',
maxAge: 120,
paymentMethod: 'ITAU_TRANSFER_PFF',
referenceCode: 'refcode12345',
shopper: {
bankDetails: {account: '12345-6', branch: '1234'},
document: {number: '00000000000', type: 'CPF'},
email: 'foo@bar.com.br',
name: 'JOHN DOE',
phone: {number: '11999990000', type: 'WORK'}
}
})
};
fetch('https://api.paymee.com.br/v1.1/checkout', 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.paymee.com.br/v1.1/checkout",
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([
'amount' => 1.99,
'callbackURL' => 'https://foo.bar/paymeeListener',
'currency' => 'BRL',
'maxAge' => 120,
'paymentMethod' => 'ITAU_TRANSFER_PFF',
'referenceCode' => 'refcode12345',
'shopper' => [
'bankDetails' => [
'account' => '12345-6',
'branch' => '1234'
],
'document' => [
'number' => '00000000000',
'type' => 'CPF'
],
'email' => 'foo@bar.com.br',
'name' => 'JOHN DOE',
'phone' => [
'number' => '11999990000',
'type' => 'WORK'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-api-key>",
"x-api-token: <x-api-token>"
],
]);
$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.paymee.com.br/v1.1/checkout"
payload := strings.NewReader("{\n \"amount\": 1.99,\n \"callbackURL\": \"https://foo.bar/paymeeListener\",\n \"currency\": \"BRL\",\n \"maxAge\": 120,\n \"paymentMethod\": \"ITAU_TRANSFER_PFF\",\n \"referenceCode\": \"refcode12345\",\n \"shopper\": {\n \"bankDetails\": {\n \"account\": \"12345-6\",\n \"branch\": \"1234\"\n },\n \"document\": {\n \"number\": \"00000000000\",\n \"type\": \"CPF\"\n },\n \"email\": \"foo@bar.com.br\",\n \"name\": \"JOHN DOE\",\n \"phone\": {\n \"number\": \"11999990000\",\n \"type\": \"WORK\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("x-api-token", "<x-api-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.paymee.com.br/v1.1/checkout")
.header("x-api-key", "<x-api-key>")
.header("x-api-token", "<x-api-token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 1.99,\n \"callbackURL\": \"https://foo.bar/paymeeListener\",\n \"currency\": \"BRL\",\n \"maxAge\": 120,\n \"paymentMethod\": \"ITAU_TRANSFER_PFF\",\n \"referenceCode\": \"refcode12345\",\n \"shopper\": {\n \"bankDetails\": {\n \"account\": \"12345-6\",\n \"branch\": \"1234\"\n },\n \"document\": {\n \"number\": \"00000000000\",\n \"type\": \"CPF\"\n },\n \"email\": \"foo@bar.com.br\",\n \"name\": \"JOHN DOE\",\n \"phone\": {\n \"number\": \"11999990000\",\n \"type\": \"WORK\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paymee.com.br/v1.1/checkout")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["x-api-token"] = '<x-api-token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 1.99,\n \"callbackURL\": \"https://foo.bar/paymeeListener\",\n \"currency\": \"BRL\",\n \"maxAge\": 120,\n \"paymentMethod\": \"ITAU_TRANSFER_PFF\",\n \"referenceCode\": \"refcode12345\",\n \"shopper\": {\n \"bankDetails\": {\n \"account\": \"12345-6\",\n \"branch\": \"1234\"\n },\n \"document\": {\n \"number\": \"00000000000\",\n \"type\": \"CPF\"\n },\n \"email\": \"foo@bar.com.br\",\n \"name\": \"JOHN DOE\",\n \"phone\": {\n \"number\": \"11999990000\",\n \"type\": \"WORK\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"status": 0,
"message": "success",
"response": {
"amount": 1.99,
"gatewayURL": "https://secure.paymee.com.br/redir/55f6bb4e-d1aa-361e-bce3-758fd57ab6d0",
"referenceCode": "refcode12345",
"saleCode": "0002405",
"shopper": {
"bankDetails": {
"account": "12345-6",
"branch": "1234"
},
"document": {
"number": "00000000000",
"type": "CPF"
},
"email": "foo@bar.com.br",
"name": "JOHN DOE",
"phone": {
"number": "11999990000",
"type": "MOBILE"
}
},
"uuid": "55f6bb4e-d1aa-361e-bce3-758fd57ab6d0"
}
}
