Atualizar pagamento
curl --request PATCH \
--url https://api.valorapayments.com.br/v1/payments/{payment_id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"amount": 7500,
"metadata": "{\"order_id\": \"ord_123\"}"
}
'import requests
url = "https://api.valorapayments.com.br/v1/payments/{payment_id}"
payload = {
"amount": 7500,
"metadata": "{\"order_id\": \"ord_123\"}"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({amount: 7500, metadata: '{"order_id": "ord_123"}'})
};
fetch('https://api.valorapayments.com.br/v1/payments/{payment_id}', 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.valorapayments.com.br/v1/payments/{payment_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 7500,
'metadata' => '{"order_id": "ord_123"}'
]),
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.valorapayments.com.br/v1/payments/{payment_id}"
payload := strings.NewReader("{\n \"amount\": 7500,\n \"metadata\": \"{\\\"order_id\\\": \\\"ord_123\\\"}\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.valorapayments.com.br/v1/payments/{payment_id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 7500,\n \"metadata\": \"{\\\"order_id\\\": \\\"ord_123\\\"}\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.valorapayments.com.br/v1/payments/{payment_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 7500,\n \"metadata\": \"{\\\"order_id\\\": \\\"ord_123\\\"}\"\n}"
response = http.request(request)
puts response.read_body{
"payment_id": "<string>",
"amount": 123,
"fee_brl": 123,
"net_amount_brl": 123,
"status": "pending",
"pix": {
"qr_code": "<string>",
"copia_e_cola": "<string>"
},
"crypto": {
"currency": "<string>",
"network": "<string>",
"qr_code": "<string>",
"payment_link": "<string>",
"wallet_address": "<string>",
"amount": 123,
"expires_at": "2023-11-07T05:31:56Z"
}
}Pagamentos
Atualizar Pagamento
Atualiza o valor ou metadados de um pagamento com status pending ou processing.
- Para PIX: atualiza a cobrança na EFI e gera um novo QR Code.
- Para crypto: gera um novo endereço Solana Pay com o novo valor.
Somente campos enviados são alterados.
PATCH
/
v1
/
payments
/
{payment_id}
Atualizar pagamento
curl --request PATCH \
--url https://api.valorapayments.com.br/v1/payments/{payment_id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"amount": 7500,
"metadata": "{\"order_id\": \"ord_123\"}"
}
'import requests
url = "https://api.valorapayments.com.br/v1/payments/{payment_id}"
payload = {
"amount": 7500,
"metadata": "{\"order_id\": \"ord_123\"}"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({amount: 7500, metadata: '{"order_id": "ord_123"}'})
};
fetch('https://api.valorapayments.com.br/v1/payments/{payment_id}', 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.valorapayments.com.br/v1/payments/{payment_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 7500,
'metadata' => '{"order_id": "ord_123"}'
]),
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.valorapayments.com.br/v1/payments/{payment_id}"
payload := strings.NewReader("{\n \"amount\": 7500,\n \"metadata\": \"{\\\"order_id\\\": \\\"ord_123\\\"}\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.valorapayments.com.br/v1/payments/{payment_id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 7500,\n \"metadata\": \"{\\\"order_id\\\": \\\"ord_123\\\"}\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.valorapayments.com.br/v1/payments/{payment_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 7500,\n \"metadata\": \"{\\\"order_id\\\": \\\"ord_123\\\"}\"\n}"
response = http.request(request)
puts response.read_body{
"payment_id": "<string>",
"amount": 123,
"fee_brl": 123,
"net_amount_brl": 123,
"status": "pending",
"pix": {
"qr_code": "<string>",
"copia_e_cola": "<string>"
},
"crypto": {
"currency": "<string>",
"network": "<string>",
"qr_code": "<string>",
"payment_link": "<string>",
"wallet_address": "<string>",
"amount": 123,
"expires_at": "2023-11-07T05:31:56Z"
}
}Authorizations
Chave de API gerada no painel Valora. Envie em todas as requisições.
Path Parameters
ID do pagamento (formato: pay_xxxxxxxx-xxxx)
Example:
"pay_3f1a8b2c-4d5e"
Body
application/json
Response
Pagamento atualizado
pending— criado, aguardando açãoprocessing— QR Code PIX gerado, aguardando pagamentopaid— pagamento confirmadofailed— falhouexpired— expirou sem pagamento (cripto: 30min)cancelled— cancelado
Available options:
pending, processing, paid, failed, expired, cancelled Novo QR Code (apenas para pagamentos PIX)
Show child attributes
Show child attributes
Novo endereço Solana Pay (apenas para pagamentos cripto com amount alterado)
Show child attributes
Show child attributes