Criar link de pagamento
curl --request POST \
--url https://api.rivoopay.com/charge/payment-link \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"total": 100000,
"customerId": "customer_123456",
"successUrl": "https://example.com/success",
"failedUrl": "https://example.com/failed",
"needShipping": false,
"notifyCustomer": true,
"devMode": false,
"externalId": "ext_123456",
"items": [
{
"productId": "prod_123456",
"quantity": 2
}
]
}
'import requests
url = "https://api.rivoopay.com/charge/payment-link"
payload = {
"total": 100000,
"customerId": "customer_123456",
"successUrl": "https://example.com/success",
"failedUrl": "https://example.com/failed",
"needShipping": False,
"notifyCustomer": True,
"devMode": False,
"externalId": "ext_123456",
"items": [
{
"productId": "prod_123456",
"quantity": 2
}
]
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
total: 100000,
customerId: 'customer_123456',
successUrl: 'https://example.com/success',
failedUrl: 'https://example.com/failed',
needShipping: false,
notifyCustomer: true,
devMode: false,
externalId: 'ext_123456',
items: [{productId: 'prod_123456', quantity: 2}]
})
};
fetch('https://api.rivoopay.com/charge/payment-link', 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.rivoopay.com/charge/payment-link",
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([
'total' => 100000,
'customerId' => 'customer_123456',
'successUrl' => 'https://example.com/success',
'failedUrl' => 'https://example.com/failed',
'needShipping' => false,
'notifyCustomer' => true,
'devMode' => false,
'externalId' => 'ext_123456',
'items' => [
[
'productId' => 'prod_123456',
'quantity' => 2
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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.rivoopay.com/charge/payment-link"
payload := strings.NewReader("{\n \"total\": 100000,\n \"customerId\": \"customer_123456\",\n \"successUrl\": \"https://example.com/success\",\n \"failedUrl\": \"https://example.com/failed\",\n \"needShipping\": false,\n \"notifyCustomer\": true,\n \"devMode\": false,\n \"externalId\": \"ext_123456\",\n \"items\": [\n {\n \"productId\": \"prod_123456\",\n \"quantity\": 2\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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.rivoopay.com/charge/payment-link")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"total\": 100000,\n \"customerId\": \"customer_123456\",\n \"successUrl\": \"https://example.com/success\",\n \"failedUrl\": \"https://example.com/failed\",\n \"needShipping\": false,\n \"notifyCustomer\": true,\n \"devMode\": false,\n \"externalId\": \"ext_123456\",\n \"items\": [\n {\n \"productId\": \"prod_123456\",\n \"quantity\": 2\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rivoopay.com/charge/payment-link")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"total\": 100000,\n \"customerId\": \"customer_123456\",\n \"successUrl\": \"https://example.com/success\",\n \"failedUrl\": \"https://example.com/failed\",\n \"needShipping\": false,\n \"notifyCustomer\": true,\n \"devMode\": false,\n \"externalId\": \"ext_123456\",\n \"items\": [\n {\n \"productId\": \"prod_123456\",\n \"quantity\": 2\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": 123,
"message": "<string>",
"data": {
"id": "charge_123456",
"url": "https://pay.rivoopay.com/c/charge_123456",
"devMode": false,
"total": 100000,
"externalId": "woovi_123456"
}
}Link de Pagamento
Criar Link de Pagamento
Cria um link de pagamento para uma cobrança. Suporta idempotência via header Idempotency-Key.
POST
/
charge
/
payment-link
Criar link de pagamento
curl --request POST \
--url https://api.rivoopay.com/charge/payment-link \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"total": 100000,
"customerId": "customer_123456",
"successUrl": "https://example.com/success",
"failedUrl": "https://example.com/failed",
"needShipping": false,
"notifyCustomer": true,
"devMode": false,
"externalId": "ext_123456",
"items": [
{
"productId": "prod_123456",
"quantity": 2
}
]
}
'import requests
url = "https://api.rivoopay.com/charge/payment-link"
payload = {
"total": 100000,
"customerId": "customer_123456",
"successUrl": "https://example.com/success",
"failedUrl": "https://example.com/failed",
"needShipping": False,
"notifyCustomer": True,
"devMode": False,
"externalId": "ext_123456",
"items": [
{
"productId": "prod_123456",
"quantity": 2
}
]
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
total: 100000,
customerId: 'customer_123456',
successUrl: 'https://example.com/success',
failedUrl: 'https://example.com/failed',
needShipping: false,
notifyCustomer: true,
devMode: false,
externalId: 'ext_123456',
items: [{productId: 'prod_123456', quantity: 2}]
})
};
fetch('https://api.rivoopay.com/charge/payment-link', 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.rivoopay.com/charge/payment-link",
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([
'total' => 100000,
'customerId' => 'customer_123456',
'successUrl' => 'https://example.com/success',
'failedUrl' => 'https://example.com/failed',
'needShipping' => false,
'notifyCustomer' => true,
'devMode' => false,
'externalId' => 'ext_123456',
'items' => [
[
'productId' => 'prod_123456',
'quantity' => 2
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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.rivoopay.com/charge/payment-link"
payload := strings.NewReader("{\n \"total\": 100000,\n \"customerId\": \"customer_123456\",\n \"successUrl\": \"https://example.com/success\",\n \"failedUrl\": \"https://example.com/failed\",\n \"needShipping\": false,\n \"notifyCustomer\": true,\n \"devMode\": false,\n \"externalId\": \"ext_123456\",\n \"items\": [\n {\n \"productId\": \"prod_123456\",\n \"quantity\": 2\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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.rivoopay.com/charge/payment-link")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"total\": 100000,\n \"customerId\": \"customer_123456\",\n \"successUrl\": \"https://example.com/success\",\n \"failedUrl\": \"https://example.com/failed\",\n \"needShipping\": false,\n \"notifyCustomer\": true,\n \"devMode\": false,\n \"externalId\": \"ext_123456\",\n \"items\": [\n {\n \"productId\": \"prod_123456\",\n \"quantity\": 2\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rivoopay.com/charge/payment-link")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"total\": 100000,\n \"customerId\": \"customer_123456\",\n \"successUrl\": \"https://example.com/success\",\n \"failedUrl\": \"https://example.com/failed\",\n \"needShipping\": false,\n \"notifyCustomer\": true,\n \"devMode\": false,\n \"externalId\": \"ext_123456\",\n \"items\": [\n {\n \"productId\": \"prod_123456\",\n \"quantity\": 2\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": 123,
"message": "<string>",
"data": {
"id": "charge_123456",
"url": "https://pay.rivoopay.com/c/charge_123456",
"devMode": false,
"total": 100000,
"externalId": "woovi_123456"
}
}Authorizations
Headers
Chave de Idempotência.
Body
application/json
Valor total em centavos. Mínimo: R$ 5,00 (500 centavos). Se não informado, será calculado a partir dos produtos
Example:
100000
ID do cliente existente
Example:
"customer_123456"
Dados do cliente para criar nova conta
Show child attributes
Show child attributes
URL de redirecionamento em caso de sucesso
Example:
"https://example.com/success"
URL de redirecionamento em caso de falha
Example:
"https://example.com/failed"
Se precisa de envio
Example:
false
Se deve notificar o cliente
Example:
true
Se está em modo desenvolvimento
Example:
false
ID externo para rastreamento da charge
Example:
"ext_123456"
Itens da cobrança (opcional)
Show child attributes
Show child attributes
Response
Link de pagamento já existe (resposta cacheada via idempotência)
⌘I