Skip to content
Draft: the API is under development and may change before the first release

Register a webhook endpoint

POST
/webhook-endpoints
curl --request POST \
--url https://api.pachapay.io/v1/webhook-endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: example' \
--data '{ "url": "https://example.com", "events": [ "payment.created" ] }'
Idempotency-Key
required
string
<= 255 characters

Unique key per logical operation, up to 255 characters. Keys are kept for 24 hours. Same key with a different body returns 409 idempotency_conflict, and the same key while the first request is still running returns 409 idempotency_in_progress.

Media typeapplication/json
object
url
required

HTTPS only.

string format: uri
/^https:///
events
required
Array<string>
>= 1 items
Allowed values: payment.created payment.requires_action payment.succeeded payment.failed payment.expired payment.canceled payment.partially_paid payment.overpaid payment.chargeback payout.created payout.succeeded payout.failed payout.canceled payout.returned refund.succeeded refund.failed payment.processing payment.on_hold payout.processing payout.on_hold payout.delayed refund.created refund.processing refund.returned balance.updated

Endpoint created. The signing secret is shown once.

Media typeapplication/json
object
id
required
string
url
required
string format: uri
/^https:///
events
required
Array<string>
Allowed values: payment.created payment.requires_action payment.succeeded payment.failed payment.expired payment.canceled payment.partially_paid payment.overpaid payment.chargeback payout.created payout.succeeded payout.failed payout.canceled payout.returned refund.succeeded refund.failed payment.processing payment.on_hold payout.processing payout.on_hold payout.delayed refund.created refund.processing refund.returned balance.updated
status
required
string
Allowed values: active disabled
created_at
string format: date-time
secret
required

Signing secret, shown only once.

string

Example

{
"id": "whk_0192f3f0",
"events": [
"payment.created"
],
"status": "active"
}

Error. See error.code.

Media typeapplication/json
object
error
required
object
type
required
string
Allowed values: invalid_request_error authentication_error permission_error not_found_error invalid_state_error idempotency_error rate_limit_error api_error
code
required

Stable machine-readable code that does not change within a major version. Examples are parameter_invalid, parameter_missing, amount_out_of_range, api_key_invalid, api_key_revoked, merchant_not_active, method_not_allowed, country_not_allowed, resource_not_found, idempotency_conflict, idempotency_in_progress, invalid_state, insufficient_balance, method_not_available, blocked_payer, limit_exceeded, rate_limited, internal_error, provider_unavailable, service_unavailable.

string
message
required
string
param

Name of the offending parameter, if any.

string
request_id
required
string

Examples

Merchant not approved

{
"error": {
"type": "permission_error",
"code": "merchant_not_active",
"message": "KYB is not approved for this merchant.",
"request_id": "req_01"
}
}

Error. See error.code.

Media typeapplication/json
object
error
required
object
type
required
string
Allowed values: invalid_request_error authentication_error permission_error not_found_error invalid_state_error idempotency_error rate_limit_error api_error
code
required

Stable machine-readable code that does not change within a major version. Examples are parameter_invalid, parameter_missing, amount_out_of_range, api_key_invalid, api_key_revoked, merchant_not_active, method_not_allowed, country_not_allowed, resource_not_found, idempotency_conflict, idempotency_in_progress, invalid_state, insufficient_balance, method_not_available, blocked_payer, limit_exceeded, rate_limited, internal_error, provider_unavailable, service_unavailable.

string
message
required
string
param

Name of the offending parameter, if any.

string
request_id
required
string

Examples

Merchant not approved

{
"error": {
"type": "permission_error",
"code": "merchant_not_active",
"message": "KYB is not approved for this merchant.",
"request_id": "req_01"
}
}