Replay an Event Delivery V2
curl --request POST \
--url https://api.spherepay.co/v2/events/replay/{eventDeliveryId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.spherepay.co/v2/events/replay/{eventDeliveryId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.spherepay.co/v2/events/replay/{eventDeliveryId}', 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.spherepay.co/v2/events/replay/{eventDeliveryId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.spherepay.co/v2/events/replay/{eventDeliveryId}"
req, _ := http.NewRequest("POST", url, nil)
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.post("https://api.spherepay.co/v2/events/replay/{eventDeliveryId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spherepay.co/v2/events/replay/{eventDeliveryId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"code": "address/invalid",
"correlationId": "28c61e885c6e5eaa78c1a2183a9b883c",
"detail": "Invalid request parameters",
"status": 400
}{
"code": "resource/not-found",
"correlationId": "28c61e885c6e5eaa78c1a2183a9b883c",
"detail": "Resource not found",
"status": 404
}{
"code": "validation/failed",
"correlationId": "28c61e885c6e5eaa78c1a2183a9b883c",
"detail": "Validation failed",
"errors": [
{
"detail": "Invalid email format",
"pointer": "/email"
},
{
"detail": "Name is required",
"pointer": "/name"
}
],
"status": 422
}Eventos
Reenviar uma Entrega de Evento com Falha
Redeliver an event to its webhook endpoint by the ID of a prior delivery attempt.
Replay an Event Delivery V2
curl --request POST \
--url https://api.spherepay.co/v2/events/replay/{eventDeliveryId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.spherepay.co/v2/events/replay/{eventDeliveryId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.spherepay.co/v2/events/replay/{eventDeliveryId}', 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.spherepay.co/v2/events/replay/{eventDeliveryId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.spherepay.co/v2/events/replay/{eventDeliveryId}"
req, _ := http.NewRequest("POST", url, nil)
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.post("https://api.spherepay.co/v2/events/replay/{eventDeliveryId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spherepay.co/v2/events/replay/{eventDeliveryId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"code": "address/invalid",
"correlationId": "28c61e885c6e5eaa78c1a2183a9b883c",
"detail": "Invalid request parameters",
"status": 400
}{
"code": "resource/not-found",
"correlationId": "28c61e885c6e5eaa78c1a2183a9b883c",
"detail": "Resource not found",
"status": 404
}{
"code": "validation/failed",
"correlationId": "28c61e885c6e5eaa78c1a2183a9b883c",
"detail": "Validation failed",
"errors": [
{
"detail": "Invalid email format",
"pointer": "/email"
},
{
"detail": "Name is required",
"pointer": "/name"
}
],
"status": 422
}Use este endpoint para reenviar uma entrega ao seu endpoint de webhook. O SpherePay faz exatamente uma tentativa automática por evento e por endpoint, e nunca tenta novamente por conta própria, portanto recuperar uma entrega que falhou enquanto seu endpoint estava fora do ar é uma chamada deliberada a este endpoint.
O caminho recebe o ID da entrega, não o ID do evento. Encontre-o no objeto
delivery retornado por listar eventos ou no histórico completo de obter evento, ou leia-o do header Sphere-Delivery-Id da requisição original.
Um replay reenvia o payload idêntico byte a byte com um Sphere-Timestamp e um Sphere-Signature novos, mais os headers Sphere-Delivery-Type: replay e Sphere-Replay-Reason: manual. Seu caminho de código de verificação é o mesmo para originais e replays. Um replay bem-sucedido move a entrega para delivered; um com falha a deixa em failed e registra outra tentativa. O histórico de tentativas é preservado em qualquer caso.
Replays são entregues pelo menos uma vez em cima do que seu endpoint já recebeu, e uma entrega que já teve êxito pode ser reenviada. Deduplique pelo
id do evento e aplique a verificação de obsolescência de sequence para que um replay seja sempre seguro de receber.Autorizações
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Parâmetros de caminho
Resposta
The replay is queued for delivery. No content is returned; poll the event to observe the new attempt.
Última modificação em 27 de agosto de 2026