Atualizar método de pagamento
curl --request POST \
--url https://api.uvvipay.com.br/v1/subscriptions/{subscriptionId}/payment-method \
--header 'Content-Type: application/json' \
--header 'client-id: <api-key>' \
--header 'client-secret: <api-key>' \
--data '
{
"payment_methods": {
"number": "4111111111111111",
"holder_name": "JOAO DA SILVA",
"security_code": "123",
"expiration_month": 12,
"expiration_year": 2030,
"type": "credit_card",
"main_payment_method": true
}
}
'import requests
url = "https://api.uvvipay.com.br/v1/subscriptions/{subscriptionId}/payment-method"
payload = { "payment_methods": {
"number": "4111111111111111",
"holder_name": "JOAO DA SILVA",
"security_code": "123",
"expiration_month": 12,
"expiration_year": 2030,
"type": "credit_card",
"main_payment_method": True
} }
headers = {
"client-id": "<api-key>",
"client-secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'client-id': '<api-key>',
'client-secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
payment_methods: {
number: '4111111111111111',
holder_name: 'JOAO DA SILVA',
security_code: '123',
expiration_month: 12,
expiration_year: 2030,
type: 'credit_card',
main_payment_method: true
}
})
};
fetch('https://api.uvvipay.com.br/v1/subscriptions/{subscriptionId}/payment-method', 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.uvvipay.com.br/v1/subscriptions/{subscriptionId}/payment-method",
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([
'payment_methods' => [
'number' => '4111111111111111',
'holder_name' => 'JOAO DA SILVA',
'security_code' => '123',
'expiration_month' => 12,
'expiration_year' => 2030,
'type' => 'credit_card',
'main_payment_method' => true
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"client-id: <api-key>",
"client-secret: <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.uvvipay.com.br/v1/subscriptions/{subscriptionId}/payment-method"
payload := strings.NewReader("{\n \"payment_methods\": {\n \"number\": \"4111111111111111\",\n \"holder_name\": \"JOAO DA SILVA\",\n \"security_code\": \"123\",\n \"expiration_month\": 12,\n \"expiration_year\": 2030,\n \"type\": \"credit_card\",\n \"main_payment_method\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("client-id", "<api-key>")
req.Header.Add("client-secret", "<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.uvvipay.com.br/v1/subscriptions/{subscriptionId}/payment-method")
.header("client-id", "<api-key>")
.header("client-secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"payment_methods\": {\n \"number\": \"4111111111111111\",\n \"holder_name\": \"JOAO DA SILVA\",\n \"security_code\": \"123\",\n \"expiration_month\": 12,\n \"expiration_year\": 2030,\n \"type\": \"credit_card\",\n \"main_payment_method\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.uvvipay.com.br/v1/subscriptions/{subscriptionId}/payment-method")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["client-id"] = '<api-key>'
request["client-secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"payment_methods\": {\n \"number\": \"4111111111111111\",\n \"holder_name\": \"JOAO DA SILVA\",\n \"security_code\": \"123\",\n \"expiration_month\": 12,\n \"expiration_year\": 2030,\n \"type\": \"credit_card\",\n \"main_payment_method\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"subscription_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"payment_method": {
"type": "card",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_four": "1111",
"first_six": "411111"
}
}Assinaturas
Atualizar método de pagamento
Atualiza o método de pagamento de uma assinatura.
POST
/
v1
/
subscriptions
/
{subscriptionId}
/
payment-method
Atualizar método de pagamento
curl --request POST \
--url https://api.uvvipay.com.br/v1/subscriptions/{subscriptionId}/payment-method \
--header 'Content-Type: application/json' \
--header 'client-id: <api-key>' \
--header 'client-secret: <api-key>' \
--data '
{
"payment_methods": {
"number": "4111111111111111",
"holder_name": "JOAO DA SILVA",
"security_code": "123",
"expiration_month": 12,
"expiration_year": 2030,
"type": "credit_card",
"main_payment_method": true
}
}
'import requests
url = "https://api.uvvipay.com.br/v1/subscriptions/{subscriptionId}/payment-method"
payload = { "payment_methods": {
"number": "4111111111111111",
"holder_name": "JOAO DA SILVA",
"security_code": "123",
"expiration_month": 12,
"expiration_year": 2030,
"type": "credit_card",
"main_payment_method": True
} }
headers = {
"client-id": "<api-key>",
"client-secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'client-id': '<api-key>',
'client-secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
payment_methods: {
number: '4111111111111111',
holder_name: 'JOAO DA SILVA',
security_code: '123',
expiration_month: 12,
expiration_year: 2030,
type: 'credit_card',
main_payment_method: true
}
})
};
fetch('https://api.uvvipay.com.br/v1/subscriptions/{subscriptionId}/payment-method', 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.uvvipay.com.br/v1/subscriptions/{subscriptionId}/payment-method",
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([
'payment_methods' => [
'number' => '4111111111111111',
'holder_name' => 'JOAO DA SILVA',
'security_code' => '123',
'expiration_month' => 12,
'expiration_year' => 2030,
'type' => 'credit_card',
'main_payment_method' => true
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"client-id: <api-key>",
"client-secret: <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.uvvipay.com.br/v1/subscriptions/{subscriptionId}/payment-method"
payload := strings.NewReader("{\n \"payment_methods\": {\n \"number\": \"4111111111111111\",\n \"holder_name\": \"JOAO DA SILVA\",\n \"security_code\": \"123\",\n \"expiration_month\": 12,\n \"expiration_year\": 2030,\n \"type\": \"credit_card\",\n \"main_payment_method\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("client-id", "<api-key>")
req.Header.Add("client-secret", "<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.uvvipay.com.br/v1/subscriptions/{subscriptionId}/payment-method")
.header("client-id", "<api-key>")
.header("client-secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"payment_methods\": {\n \"number\": \"4111111111111111\",\n \"holder_name\": \"JOAO DA SILVA\",\n \"security_code\": \"123\",\n \"expiration_month\": 12,\n \"expiration_year\": 2030,\n \"type\": \"credit_card\",\n \"main_payment_method\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.uvvipay.com.br/v1/subscriptions/{subscriptionId}/payment-method")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["client-id"] = '<api-key>'
request["client-secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"payment_methods\": {\n \"number\": \"4111111111111111\",\n \"holder_name\": \"JOAO DA SILVA\",\n \"security_code\": \"123\",\n \"expiration_month\": 12,\n \"expiration_year\": 2030,\n \"type\": \"credit_card\",\n \"main_payment_method\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"subscription_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"payment_method": {
"type": "card",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_four": "1111",
"first_six": "411111"
}
}Atualiza o método de pagamento padrão da assinatura.
Permitido quando a assinatura está em
TRIAL, PENDING, ACTIVE ou PAST_DUE.
Se a assinatura estiver PAST_DUE e houver fatura em aberto (OPEN), a atualização com cartão dispara uma nova tentativa de cobrança dessa fatura. Em ACTIVE, TRIAL ou PENDING, ou ao definir PIX, apenas o método padrão é atualizado — a cobrança segue o ciclo da fatura.Headers
ID público da credencial do merchant
Secret da credencial do merchant
Path Parameters
Body
application/json
Novo método de pagamento (credit_card ou pix) a definir como padrão.
- Option 1
- Option 2
Show child attributes
Show child attributes
⌘I

