Rotate the signing secret of an endpoint
const url = 'https://api.pachapay.io/v1/webhook-endpoints/example/rotate-secret';const options = { method: 'POST', headers: {'Idempotency-Key': 'example', Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.pachapay.io/v1/webhook-endpoints/example/rotate-secret \ --header 'Authorization: Bearer <token>' \ --header 'Idempotency-Key: example'The old secret stays valid for 24 hours. During that time each delivery carries two v1 signatures.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”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.
Responses
Section titled “Responses”Endpoint with the new secret, shown once.
object
Signing secret, shown only once.
Example
{ "id": "whk_0192f3f0", "events": [ "payment.created" ], "status": "active"}Error. See error.code.
object
object
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.
Name of the offending parameter, if any.
Examples
Merchant not approved
{ "error": { "type": "permission_error", "code": "merchant_not_active", "message": "KYB is not approved for this merchant.", "request_id": "req_01" }}Not enough balance
{ "error": { "type": "invalid_state_error", "code": "insufficient_balance", "message": "Available balance is lower than the amount plus fee.", "param": "amount", "request_id": "req_02" }}Error. See error.code.
object
object
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.
Name of the offending parameter, if any.
Examples
Merchant not approved
{ "error": { "type": "permission_error", "code": "merchant_not_active", "message": "KYB is not approved for this merchant.", "request_id": "req_01" }}Not enough balance
{ "error": { "type": "invalid_state_error", "code": "insufficient_balance", "message": "Available balance is lower than the amount plus fee.", "param": "amount", "request_id": "req_02" }}