Consultar webhook
curl --request GET \
--url https://api.pagstack.com/v1/webhook-endpoints/{id} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.pagstack.com/v1/webhook-endpoints/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pagstack.com/v1/webhook-endpoints/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"id": "<string>",
"object": "webhook_endpoint",
"livemode": true,
"url": "<string>",
"events": [
"transaction.paid"
],
"status": "enabled",
"previous_secret_expires_at": "<string>",
"created_at": "<string>",
"secret": "<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>"
}
}Webhooks
Consultar webhook
Devolve um webhook pelo ID, sem o segredo.
Consultar webhook
curl --request GET \
--url https://api.pagstack.com/v1/webhook-endpoints/{id} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.pagstack.com/v1/webhook-endpoints/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pagstack.com/v1/webhook-endpoints/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"id": "<string>",
"object": "webhook_endpoint",
"livemode": true,
"url": "<string>",
"events": [
"transaction.paid"
],
"status": "enabled",
"previous_secret_expires_at": "<string>",
"created_at": "<string>",
"secret": "<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
Resposta
Sucesso.
Webhook: URL que recebe os eventos da conta.
Eventos assinados. Lista vazia recebe todos.
Opções disponíveis:
transaction.paid, transaction.expired, transaction.canceled, transaction.refunded, transaction.disputed, transaction.dispute_released, checkout.completed, checkout.expired, withdrawal.completed, withdrawal.failed, subscription.created, subscription.renewed, subscription.past_due, subscription.canceled