Atualizar link
curl --request PATCH \
--url https://api.pagstack.com/v1/payment-links/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"active": true,
"allow_coupons": true
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({active: true, allow_coupons: true})
};
fetch('https://api.pagstack.com/v1/payment-links/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pagstack.com/v1/payment-links/{id}"
payload = {
"active": True,
"allow_coupons": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"object": "payment_link",
"livemode": true,
"url": "<string>",
"active": true,
"amount": 0,
"description": "<string>",
"methods": [
"pix"
],
"product_id": "<string>",
"plan_id": "<string>",
"allow_coupons": true,
"created_at": "<string>"
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}Links de pagamento
Ativar ou desativar link
Ativa, desativa ou liga os cupons. O valor de um link não muda depois de criado; para mudar o preço, crie outro link.
Atualizar link
curl --request PATCH \
--url https://api.pagstack.com/v1/payment-links/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"active": true,
"allow_coupons": true
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({active: true, allow_coupons: true})
};
fetch('https://api.pagstack.com/v1/payment-links/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pagstack.com/v1/payment-links/{id}"
payload = {
"active": True,
"allow_coupons": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"object": "payment_link",
"livemode": true,
"url": "<string>",
"active": true,
"amount": 0,
"description": "<string>",
"methods": [
"pix"
],
"product_id": "<string>",
"plan_id": "<string>",
"allow_coupons": true,
"created_at": "<string>"
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}Autorizações
Corpo
application/json
Resposta
Sucesso.
Link de pagamento reutilizável.