Ativar ou silenciar webhook
curl --request PATCH \
--url https://api.speedsellx.io/v2/public/webhooks/{id}/toggle \
--header 'Authorization: Bearer <token>' \
--header 'Idempotency-Key: <idempotency-key>'import requests
url = "https://api.speedsellx.io/v2/public/webhooks/{id}/toggle"
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.patch(url, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Idempotency-Key': '<idempotency-key>', Authorization: 'Bearer <token>'}
};
fetch('https://api.speedsellx.io/v2/public/webhooks/{id}/toggle', 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.speedsellx.io/v2/public/webhooks/{id}/toggle",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Idempotency-Key: <idempotency-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"
"net/http"
"io"
)
func main() {
url := "https://api.speedsellx.io/v2/public/webhooks/{id}/toggle"
req, _ := http.NewRequest("PATCH", url, nil)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
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.speedsellx.io/v2/public/webhooks/{id}/toggle")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.speedsellx.io/v2/public/webhooks/{id}/toggle")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"user_id": 123,
"url": "<string>",
"token": "<string>",
"product_id": 123,
"active": true,
"order_payment_approved": true,
"order_payment_pending": true,
"order_payment_failed": true,
"order_payment_refunded": true,
"order_subscription_approved": true,
"order_subscription_pending": true,
"order_subscription_failed": true,
"order_subscription_refunded": true,
"order_subscription_canceled": true,
"order_subscription_trial_started": true,
"created_at": "<string>",
"updated_at": "<string>"
}
}{
"status": "error",
"error": "unauthenticated"
}{
"status": "error",
"error": "insufficient_scope"
}{
"status": "error",
"error": "not_found"
}{
"status": "error",
"error": "idempotency_in_progress"
}Webhooks
Ativar ou silenciar webhook
Inverte o campo active de uma assinatura da conta da chave. Uma assinatura de outra conta responde 404. Exige o escopo webhooks:create e o header Idempotency-Key.
PATCH
/
public
/
webhooks
/
{id}
/
toggle
Ativar ou silenciar webhook
curl --request PATCH \
--url https://api.speedsellx.io/v2/public/webhooks/{id}/toggle \
--header 'Authorization: Bearer <token>' \
--header 'Idempotency-Key: <idempotency-key>'import requests
url = "https://api.speedsellx.io/v2/public/webhooks/{id}/toggle"
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.patch(url, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Idempotency-Key': '<idempotency-key>', Authorization: 'Bearer <token>'}
};
fetch('https://api.speedsellx.io/v2/public/webhooks/{id}/toggle', 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.speedsellx.io/v2/public/webhooks/{id}/toggle",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Idempotency-Key: <idempotency-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"
"net/http"
"io"
)
func main() {
url := "https://api.speedsellx.io/v2/public/webhooks/{id}/toggle"
req, _ := http.NewRequest("PATCH", url, nil)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
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.speedsellx.io/v2/public/webhooks/{id}/toggle")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.speedsellx.io/v2/public/webhooks/{id}/toggle")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"user_id": 123,
"url": "<string>",
"token": "<string>",
"product_id": 123,
"active": true,
"order_payment_approved": true,
"order_payment_pending": true,
"order_payment_failed": true,
"order_payment_refunded": true,
"order_subscription_approved": true,
"order_subscription_pending": true,
"order_subscription_failed": true,
"order_subscription_refunded": true,
"order_subscription_canceled": true,
"order_subscription_trial_started": true,
"created_at": "<string>",
"updated_at": "<string>"
}
}{
"status": "error",
"error": "unauthenticated"
}{
"status": "error",
"error": "insufficient_scope"
}{
"status": "error",
"error": "not_found"
}{
"status": "error",
"error": "idempotency_in_progress"
}Authorizations
A chave de API da conta, no formato sk_{modo}_{prefixo}.{segredo}.
Headers
Chave única da operação. Obrigatória em toda requisição que altera dados; sem ela a resposta é 422 idempotency_key_required. Um reenvio com a mesma chave e o mesmo corpo repete a resposta guardada.
Maximum string length:
255Path Parameters
Response
ApiWebhookResource
Show child attributes
Show child attributes
⌘I