Skip to content

Send a test event

POST
/webhook-endpoints/{id}/test
curl --request POST \
--url https://api.paywithnablr.com/v1/webhook-endpoints/whe_01M3XX9QZ6J4B1M2N3P4Q5R6S7/test \
--header 'Authorization: Bearer <token>'

Sends a signed test.ping event to the endpoint now and returns the delivery with the outcome. A failed test is not retried.

id
required
string
/^whe_[0-9A-Z]{26}$/
Example
whe_01M3XX9QZ6J4B1M2N3P4Q5R6S7

The delivery.

Media typeapplication/json
object
data
required
object
id
required
string
object
required
string
Allowed value: webhook_delivery
endpoint_id
required
string
endpoint_url
required
string
event_id
required
string
event_type
required

An event type, or test.ping for a test.

string
status
required
string
Allowed values: pending delivered failed
response_code
required

The HTTP status your endpoint answered with last time.

integer | null
attempts
required
integer
next_retry_at
required
string | null format: date-time
duration_ms
required
integer | null
payment_id

For payment.* and payment_link.paid events, the payment (for payment_link.paid, data.payment.id). Absent otherwise.

string
last_error
required

Why the last attempt failed, in plain words: Couldn't connect, Timed out after 10 s, TLS certificate problem, Your endpoint answered 500, Your endpoint answered 301. Redirects are not followed, Couldn't find the host (DNS lookup failed), The URL points to a private or internal address. null after a success.

string | null
delivered_at
required
string | null format: date-time
created_at
required
string format: date-time
meta
required
object
request_id
required

This request’s id, also in the X-Request-Id header.

string
Example
{
"data": {
"id": "whd_01M3XXA1B2C3D4E5F6G7H8J9K0",
"object": "webhook_delivery",
"event_id": "evt_01M3XXB7W2K9QF3N8D4H6J1T5R",
"event_type": "payment.succeeded",
"status": "pending",
"last_error": "Your endpoint answered 500"
}
}

UNAUTHENTICATED: no Authorization: Bearer header. The message says what to send: your secret key (Bearer sk_test_… or sk_live_…). INVALID_API_KEY: the key is unknown, malformed or revoked.

Media typeapplication/json
object
error
required
object
message
required

A sentence for a person. Safe to show to your user.

string
code
required
string
Allowed values: VALIDATION_FAILED MALFORMED_REQUEST UNAUTHENTICATED INVALID_API_KEY SECRET_KEY_REQUIRED LIVE_MODE_NOT_ENABLED ACCOUNT_RESTRICTED TEST_MODE_ONLY NOT_FOUND METHOD_NOT_ALLOWED CONFLICT DUPLICATE_REFERENCE IDEMPOTENCY_KEY_REUSED REQUEST_IN_PROGRESS INVALID_STATE_TRANSITION PAYLOAD_TOO_LARGE UNSUPPORTED_MEDIA_TYPE RATE_LIMITED INTERNAL_ERROR SERVICE_UNAVAILABLE
title
required

The code in words, for example Validation failed.

string
reference

A quotable reference for some failures.

string
details

One entry per field that is wrong.

Array<object>
object
field
required
string
code
required

For example required, invalid, format, length, unknown, type.

string
message
required
string
meta

Extra context, such as retry_after_seconds on RATE_LIMITED.

object
key
additional properties
any
meta
required
object
request_id
required

This request’s id, also in the X-Request-Id header.

string
Example
{
"error": {
"message": "The API key provided is not valid.",
"code": "INVALID_API_KEY",
"title": "Invalid API key"
},
"meta": {
"request_id": "01a0fbd4-3b68-75e0-bd33-0b950ddc99a5"
}
}

SECRET_KEY_REQUIRED: you sent a publishable key. LIVE_MODE_NOT_ENABLED: a live key before your business is verified. ACCOUNT_RESTRICTED: the account is suspended.

Media typeapplication/json
object
error
required
object
message
required

A sentence for a person. Safe to show to your user.

string
code
required
string
Allowed values: VALIDATION_FAILED MALFORMED_REQUEST UNAUTHENTICATED INVALID_API_KEY SECRET_KEY_REQUIRED LIVE_MODE_NOT_ENABLED ACCOUNT_RESTRICTED TEST_MODE_ONLY NOT_FOUND METHOD_NOT_ALLOWED CONFLICT DUPLICATE_REFERENCE IDEMPOTENCY_KEY_REUSED REQUEST_IN_PROGRESS INVALID_STATE_TRANSITION PAYLOAD_TOO_LARGE UNSUPPORTED_MEDIA_TYPE RATE_LIMITED INTERNAL_ERROR SERVICE_UNAVAILABLE
title
required

The code in words, for example Validation failed.

string
reference

A quotable reference for some failures.

string
details

One entry per field that is wrong.

Array<object>
object
field
required
string
code
required

For example required, invalid, format, length, unknown, type.

string
message
required
string
meta

Extra context, such as retry_after_seconds on RATE_LIMITED.

object
key
additional properties
any
meta
required
object
request_id
required

This request’s id, also in the X-Request-Id header.

string
Example
{
"error": {
"message": "This request needs your secret key. Publishable keys can only be used from a checkout.",
"code": "SECRET_KEY_REQUIRED",
"title": "Secret key required"
},
"meta": {
"request_id": "01a0fbd4-3b68-75e0-bd33-0b950ddc99a5"
}
}

NOT_FOUND: no such object in this mode, or it is not yours.

Media typeapplication/json
object
error
required
object
message
required

A sentence for a person. Safe to show to your user.

string
code
required
string
Allowed values: VALIDATION_FAILED MALFORMED_REQUEST UNAUTHENTICATED INVALID_API_KEY SECRET_KEY_REQUIRED LIVE_MODE_NOT_ENABLED ACCOUNT_RESTRICTED TEST_MODE_ONLY NOT_FOUND METHOD_NOT_ALLOWED CONFLICT DUPLICATE_REFERENCE IDEMPOTENCY_KEY_REUSED REQUEST_IN_PROGRESS INVALID_STATE_TRANSITION PAYLOAD_TOO_LARGE UNSUPPORTED_MEDIA_TYPE RATE_LIMITED INTERNAL_ERROR SERVICE_UNAVAILABLE
title
required

The code in words, for example Validation failed.

string
reference

A quotable reference for some failures.

string
details

One entry per field that is wrong.

Array<object>
object
field
required
string
code
required

For example required, invalid, format, length, unknown, type.

string
message
required
string
meta

Extra context, such as retry_after_seconds on RATE_LIMITED.

object
key
additional properties
any
meta
required
object
request_id
required

This request’s id, also in the X-Request-Id header.

string
Example
{
"error": {
"message": "This payment could not be found.",
"code": "NOT_FOUND",
"title": "Not found"
},
"meta": {
"request_id": "01a0fbd4-5df3-7308-8497-51f8ed8d7c77"
}
}

RATE_LIMITED: wait Retry-After seconds, then retry.

Media typeapplication/json
object
error
required
object
message
required

A sentence for a person. Safe to show to your user.

string
code
required
string
Allowed values: VALIDATION_FAILED MALFORMED_REQUEST UNAUTHENTICATED INVALID_API_KEY SECRET_KEY_REQUIRED LIVE_MODE_NOT_ENABLED ACCOUNT_RESTRICTED TEST_MODE_ONLY NOT_FOUND METHOD_NOT_ALLOWED CONFLICT DUPLICATE_REFERENCE IDEMPOTENCY_KEY_REUSED REQUEST_IN_PROGRESS INVALID_STATE_TRANSITION PAYLOAD_TOO_LARGE UNSUPPORTED_MEDIA_TYPE RATE_LIMITED INTERNAL_ERROR SERVICE_UNAVAILABLE
title
required

The code in words, for example Validation failed.

string
reference

A quotable reference for some failures.

string
details

One entry per field that is wrong.

Array<object>
object
field
required
string
code
required

For example required, invalid, format, length, unknown, type.

string
message
required
string
meta

Extra context, such as retry_after_seconds on RATE_LIMITED.

object
key
additional properties
any
meta
required
object
request_id
required

This request’s id, also in the X-Request-Id header.

string
Example
{
"error": {
"message": "Too many attempts. Please wait a moment and try again.",
"code": "RATE_LIMITED",
"title": "Rate limited",
"meta": {
"retry_after_seconds": 12
}
},
"meta": {
"request_id": "01a0fbd4-3b68-75e0-bd33-0b950ddc99a5"
}
}
Retry-After
integer

Seconds to wait.

X-RateLimit-Reset
integer

Unix time when a request will be allowed again.