Z Zise Developers 简体中文

Redeliver (only dead / failed / no_subscriber)

POST /v1/webhooks/deliveries/{id}/redeliver scope: merchant:read
Merchant account Requires x-idempotency-key

sent cannot be redelivered: pushing an already delivered event again would create a duplicate unilaterally. pending cannot be redelivered either: it is already queued and resetting it would merely clear backoff. Both return state_invalid.

no_subscriber records fan out to all endpoints currently subscribed to the event, with one delivery record per endpoint and the original event_id. You may be retrying precisely because you have just configured an endpoint. If no endpoint still matches, returns state_invalid as well.

queued: true means queued, not delivered. Check results through GET /v1/webhooks/deliveries.

The path parameter accepts the ID with or without the whd_ prefix.

Prerequisites

  • The delivery record belongs to this merchant.
  • Status is one of dead / failed / no_subscriber.

Path Parameters

FieldTypeRequiredDescription
id string Required Delivery record ID, with an optional whd_ prefix.
FieldTypeRequiredDescription
x-idempotency-key string Required UUID v4

Response

200Queued, not delivered.
{
  "id": "whd_7c31a0f2-58bd-4f0a-9a1e-0d2c6b4e7a55",
  "queued": true
}
400state_invalid: the same response for two cases: current status cannot be redelivered, or no endpoint currently subscribes to this event. Internal state names are not returned, as doing so would turn an internal state machine into a public contract.
404not_found: the record does not exist or does not belong to this merchant.
409idempotency_key_reused · idempotency_in_progress
Request
curl -X POST 'https://api.zinfra.vip/v1/webhooks/deliveries/{id}/redeliver' \
  -H 'x-auth-token: Bearer $TOKEN' \
  -H 'x-idempotency-key: $IDEMPOTENCY_KEY'
const res = await fetch("https://api.zinfra.vip/v1/webhooks/deliveries/{id}/redeliver", {
  method: "POST",
  headers: {
    "x-auth-token": "Bearer $TOKEN",
    "x-idempotency-key": "$IDEMPOTENCY_KEY",
  },
});
// Keep monetary amounts as strings, never numbers.
const data = await res.json();
import requests

res = requests.post(
    "https://api.zinfra.vip/v1/webhooks/deliveries/{id}/redeliver",
    headers={
        "x-auth-token": "Bearer $TOKEN",
        "x-idempotency-key": "$IDEMPOTENCY_KEY",
    },
)
# Use Decimal(str(...)) for amounts, not float.
data = res.json()
req, _ := http.NewRequest("POST", "https://api.zinfra.vip/v1/webhooks/deliveries/{id}/redeliver",
    nil)
req.Header.Set("x-auth-token", "Bearer $TOKEN")
req.Header.Set("x-idempotency-key", "$IDEMPOTENCY_KEY")
res, err := http.DefaultClient.Do(req)
// Decode amount fields as string, not float64.
HttpRequest req = HttpRequest.newBuilder()
    .uri(URI.create("https://api.zinfra.vip/v1/webhooks/deliveries/{id}/redeliver"))
    .header("x-auth-token", "Bearer $TOKEN")
    .header("x-idempotency-key", "$IDEMPOTENCY_KEY")
    .method("POST", HttpRequest.BodyPublishers.noBody())
    .build();
// Use String / BigDecimal for amounts, not double.
$ch = curl_init('https://api.zinfra.vip/v1/webhooks/deliveries/{id}/redeliver');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    'x-auth-token: Bearer $TOKEN',
    'x-idempotency-key: $IDEMPOTENCY_KEY',
  ],
]);
$res = curl_exec($ch);
// Use bcmath / strings for amounts, not floatval.
200
{
  "id": "whd_7c31a0f2-58bd-4f0a-9a1e-0d2c6b4e7a55",
  "queued": true
}