curl --request PUT \
--url http://localhost:7701/api/v1/payment-links/{token} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--header 'x-client-id: <x-client-id>' \
--data '
{
"title": "Curso Premium",
"description": "<string>",
"amount": 2,
"plan_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"currency": "BRL",
"items": [
{
"name": "Curso Premium",
"quantity": 1,
"unit_price": 29900,
"description": "Acesso vitalício",
"image_url": "<string>"
}
],
"slug": "<string>",
"success_url": "<string>",
"cancel_url": "<string>",
"is_active": true,
"expires_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "http://localhost:7701/api/v1/payment-links/{token}"
payload = {
"title": "Curso Premium",
"description": "<string>",
"amount": 2,
"plan_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"currency": "BRL",
"items": [
{
"name": "Curso Premium",
"quantity": 1,
"unit_price": 29900,
"description": "Acesso vitalício",
"image_url": "<string>"
}
],
"slug": "<string>",
"success_url": "<string>",
"cancel_url": "<string>",
"is_active": True,
"expires_at": "2023-11-07T05:31:56Z"
}
headers = {
"x-client-id": "<x-client-id>",
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'x-client-id': '<x-client-id>',
'X-API-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
title: 'Curso Premium',
description: '<string>',
amount: 2,
plan_uuid: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
currency: 'BRL',
items: [
{
name: 'Curso Premium',
quantity: 1,
unit_price: 29900,
description: 'Acesso vitalício',
image_url: '<string>'
}
],
slug: '<string>',
success_url: '<string>',
cancel_url: '<string>',
is_active: true,
expires_at: '2023-11-07T05:31:56Z'
})
};
fetch('http://localhost:7701/api/v1/payment-links/{token}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "7701",
CURLOPT_URL => "http://localhost:7701/api/v1/payment-links/{token}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'title' => 'Curso Premium',
'description' => '<string>',
'amount' => 2,
'plan_uuid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'currency' => 'BRL',
'items' => [
[
'name' => 'Curso Premium',
'quantity' => 1,
'unit_price' => 29900,
'description' => 'Acesso vitalício',
'image_url' => '<string>'
]
],
'slug' => '<string>',
'success_url' => '<string>',
'cancel_url' => '<string>',
'is_active' => true,
'expires_at' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>",
"x-client-id: <x-client-id>"
],
]);
$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 := "http://localhost:7701/api/v1/payment-links/{token}"
payload := strings.NewReader("{\n \"title\": \"Curso Premium\",\n \"description\": \"<string>\",\n \"amount\": 2,\n \"plan_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"currency\": \"BRL\",\n \"items\": [\n {\n \"name\": \"Curso Premium\",\n \"quantity\": 1,\n \"unit_price\": 29900,\n \"description\": \"Acesso vitalício\",\n \"image_url\": \"<string>\"\n }\n ],\n \"slug\": \"<string>\",\n \"success_url\": \"<string>\",\n \"cancel_url\": \"<string>\",\n \"is_active\": true,\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-client-id", "<x-client-id>")
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.put("http://localhost:7701/api/v1/payment-links/{token}")
.header("x-client-id", "<x-client-id>")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Curso Premium\",\n \"description\": \"<string>\",\n \"amount\": 2,\n \"plan_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"currency\": \"BRL\",\n \"items\": [\n {\n \"name\": \"Curso Premium\",\n \"quantity\": 1,\n \"unit_price\": 29900,\n \"description\": \"Acesso vitalício\",\n \"image_url\": \"<string>\"\n }\n ],\n \"slug\": \"<string>\",\n \"success_url\": \"<string>\",\n \"cancel_url\": \"<string>\",\n \"is_active\": true,\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:7701/api/v1/payment-links/{token}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["x-client-id"] = '<x-client-id>'
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Curso Premium\",\n \"description\": \"<string>\",\n \"amount\": 2,\n \"plan_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"currency\": \"BRL\",\n \"items\": [\n {\n \"name\": \"Curso Premium\",\n \"quantity\": 1,\n \"unit_price\": 29900,\n \"description\": \"Acesso vitalício\",\n \"image_url\": \"<string>\"\n }\n ],\n \"slug\": \"<string>\",\n \"success_url\": \"<string>\",\n \"cancel_url\": \"<string>\",\n \"is_active\": true,\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"token": "pl_live_a1b2c3d4e5f6",
"slug": "curso-premium",
"title": "Curso Premium",
"description": "<string>",
"amount": 29900,
"currency": "BRL",
"plan_id": 123,
"plan_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"items": [
{
"name": "Curso Premium",
"quantity": 1,
"unit_price": 29900,
"description": "Acesso vitalício",
"image_url": "<string>"
}
],
"success_url": "<string>",
"cancel_url": "<string>",
"is_active": true,
"expires_at": "2023-11-07T05:31:56Z",
"checkout_url": "https://checkout.plugtopay.com/minha-empresa/curso-premium",
"created_at": "2023-11-07T05:31:56Z"
}Update a payment link
Todos os campos são opcionais. O campo type não pode ser alterado após a criação.
curl --request PUT \
--url http://localhost:7701/api/v1/payment-links/{token} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--header 'x-client-id: <x-client-id>' \
--data '
{
"title": "Curso Premium",
"description": "<string>",
"amount": 2,
"plan_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"currency": "BRL",
"items": [
{
"name": "Curso Premium",
"quantity": 1,
"unit_price": 29900,
"description": "Acesso vitalício",
"image_url": "<string>"
}
],
"slug": "<string>",
"success_url": "<string>",
"cancel_url": "<string>",
"is_active": true,
"expires_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "http://localhost:7701/api/v1/payment-links/{token}"
payload = {
"title": "Curso Premium",
"description": "<string>",
"amount": 2,
"plan_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"currency": "BRL",
"items": [
{
"name": "Curso Premium",
"quantity": 1,
"unit_price": 29900,
"description": "Acesso vitalício",
"image_url": "<string>"
}
],
"slug": "<string>",
"success_url": "<string>",
"cancel_url": "<string>",
"is_active": True,
"expires_at": "2023-11-07T05:31:56Z"
}
headers = {
"x-client-id": "<x-client-id>",
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'x-client-id': '<x-client-id>',
'X-API-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
title: 'Curso Premium',
description: '<string>',
amount: 2,
plan_uuid: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
currency: 'BRL',
items: [
{
name: 'Curso Premium',
quantity: 1,
unit_price: 29900,
description: 'Acesso vitalício',
image_url: '<string>'
}
],
slug: '<string>',
success_url: '<string>',
cancel_url: '<string>',
is_active: true,
expires_at: '2023-11-07T05:31:56Z'
})
};
fetch('http://localhost:7701/api/v1/payment-links/{token}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "7701",
CURLOPT_URL => "http://localhost:7701/api/v1/payment-links/{token}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'title' => 'Curso Premium',
'description' => '<string>',
'amount' => 2,
'plan_uuid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'currency' => 'BRL',
'items' => [
[
'name' => 'Curso Premium',
'quantity' => 1,
'unit_price' => 29900,
'description' => 'Acesso vitalício',
'image_url' => '<string>'
]
],
'slug' => '<string>',
'success_url' => '<string>',
'cancel_url' => '<string>',
'is_active' => true,
'expires_at' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>",
"x-client-id: <x-client-id>"
],
]);
$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 := "http://localhost:7701/api/v1/payment-links/{token}"
payload := strings.NewReader("{\n \"title\": \"Curso Premium\",\n \"description\": \"<string>\",\n \"amount\": 2,\n \"plan_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"currency\": \"BRL\",\n \"items\": [\n {\n \"name\": \"Curso Premium\",\n \"quantity\": 1,\n \"unit_price\": 29900,\n \"description\": \"Acesso vitalício\",\n \"image_url\": \"<string>\"\n }\n ],\n \"slug\": \"<string>\",\n \"success_url\": \"<string>\",\n \"cancel_url\": \"<string>\",\n \"is_active\": true,\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-client-id", "<x-client-id>")
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.put("http://localhost:7701/api/v1/payment-links/{token}")
.header("x-client-id", "<x-client-id>")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Curso Premium\",\n \"description\": \"<string>\",\n \"amount\": 2,\n \"plan_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"currency\": \"BRL\",\n \"items\": [\n {\n \"name\": \"Curso Premium\",\n \"quantity\": 1,\n \"unit_price\": 29900,\n \"description\": \"Acesso vitalício\",\n \"image_url\": \"<string>\"\n }\n ],\n \"slug\": \"<string>\",\n \"success_url\": \"<string>\",\n \"cancel_url\": \"<string>\",\n \"is_active\": true,\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:7701/api/v1/payment-links/{token}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["x-client-id"] = '<x-client-id>'
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Curso Premium\",\n \"description\": \"<string>\",\n \"amount\": 2,\n \"plan_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"currency\": \"BRL\",\n \"items\": [\n {\n \"name\": \"Curso Premium\",\n \"quantity\": 1,\n \"unit_price\": 29900,\n \"description\": \"Acesso vitalício\",\n \"image_url\": \"<string>\"\n }\n ],\n \"slug\": \"<string>\",\n \"success_url\": \"<string>\",\n \"cancel_url\": \"<string>\",\n \"is_active\": true,\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"token": "pl_live_a1b2c3d4e5f6",
"slug": "curso-premium",
"title": "Curso Premium",
"description": "<string>",
"amount": 29900,
"currency": "BRL",
"plan_id": 123,
"plan_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"items": [
{
"name": "Curso Premium",
"quantity": 1,
"unit_price": 29900,
"description": "Acesso vitalício",
"image_url": "<string>"
}
],
"success_url": "<string>",
"cancel_url": "<string>",
"is_active": true,
"expires_at": "2023-11-07T05:31:56Z",
"checkout_url": "https://checkout.plugtopay.com/minha-empresa/curso-premium",
"created_at": "2023-11-07T05:31:56Z"
}Authorizations
Company API key. Send in the X-API-Key header.
Headers
Client identifier for the company in the request.
"client_abc123"
Path Parameters
"pl_live_a1b2c3d4e5f6"
Body
255"Curso Premium"
Centavos. Obrigatório em one_time, proibido em subscription.
x >= 1Obrigatório em subscription, proibido em one_time.
3"BRL"
Omitir aceita ambos. Forçado para card em assinaturas.
card, pix Show child attributes
Show child attributes
Único por empresa. Habilita a URL legível do checkout.
3 - 100^[a-z0-9]+(?:-[a-z0-9]+)*$A checagem de https/host seguro roda apenas na criação; a atualização não revalida.
20482048Precisa ser futura. Sem valor = nunca expira.
Response
Link atualizado
"pl_live_a1b2c3d4e5f6"
"curso-premium"
"Curso Premium"
one_time, subscription Centavos. Nulo em links de assinatura.
29900
"BRL"
Nulo aceita cartão e PIX.
card, pix Show child attributes
Show child attributes
true
"https://checkout.plugtopay.com/minha-empresa/curso-premium"