Skip to content
HisarPay

API reference

Webhooks and events

Manage endpoints, read the event history and resend events. Details in the guide →

GET/v1/webhook-endpoints

List webhook endpoints

Scope: readKey: live or test

Responses

  • 200 OKJSON response
Example request
curl https://hisarpay.com/v1/webhook-endpoints \
  -H "Authorization: Bearer $HISARPAY_API_KEY"
POST/v1/webhook-endpoints

Add a webhook endpoint (the signing secret is returned once)

Scope: webhooksKey: live only

Request body

  • urlstring (url)required

    ≤ 2048 chars

  • eventsarray<string>optional

    Values:invoice.paidinvoice.overpaidinvoice.partialinvoice.expiredinvoice.cancelledinvoice.payment_receivedwithdrawal.completedwithdrawal.failedwithdrawal.rejectedtest.ping

    ≤ 10 items

  • descriptionstringoptional

    ≤ 200 chars

Responses

  • 200 OKJSON response
Example request
curl -X POST https://hisarpay.com/v1/webhook-endpoints \
  -H "Authorization: Bearer $HISARPAY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "url": "https://shop.example/webhooks/hisarpay",
    "events": [
      "invoice.paid",
      "invoice.expired"
    ]
  }'

Details in the guide

GET/v1/webhook-endpoints/{id}

Retrieve a webhook endpoint

Scope: readKey: live or test

Path parameters

  • idstring (uuid)required

    The record id.

Responses

  • 200 OKJSON response
Example request
curl https://hisarpay.com/v1/webhook-endpoints/0b6a3f52-3c1d-4a7e-8f4b-1d2c3e4f5a6b \
  -H "Authorization: Bearer $HISARPAY_API_KEY"
PATCH/v1/webhook-endpoints/{id}

Update a webhook endpoint

Scope: webhooksKey: live only

Path parameters

  • idstring (uuid)required

    The record id.

Request body

  • urlstring (url)optional

    ≤ 2048 chars

  • eventsarray<string>optional

    Values:invoice.paidinvoice.overpaidinvoice.partialinvoice.expiredinvoice.cancelledinvoice.payment_receivedwithdrawal.completedwithdrawal.failedwithdrawal.rejectedtest.ping

    ≤ 10 items

  • descriptionstringoptional

    ≤ 200 chars

  • enabledbooleanoptional

Responses

  • 200 OKJSON response
Example request
curl -X PATCH https://hisarpay.com/v1/webhook-endpoints/0b6a3f52-3c1d-4a7e-8f4b-1d2c3e4f5a6b \
  -H "Authorization: Bearer $HISARPAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": false
  }'
DELETE/v1/webhook-endpoints/{id}

Delete a webhook endpoint

Scope: webhooksKey: live only

Path parameters

  • idstring (uuid)required

    The record id.

Responses

  • 200 OKEmpty response
Example request
curl -X DELETE https://hisarpay.com/v1/webhook-endpoints/0b6a3f52-3c1d-4a7e-8f4b-1d2c3e4f5a6b \
  -H "Authorization: Bearer $HISARPAY_API_KEY"
POST/v1/webhook-endpoints/{id}/rotate-secret

Rotate the signing secret (old secret keeps signing for 24 h)

Scope: webhooksKey: live only

Path parameters

  • idstring (uuid)required

    The record id.

Responses

  • 200 OKJSON response
Example request
curl -X POST https://hisarpay.com/v1/webhook-endpoints/0b6a3f52-3c1d-4a7e-8f4b-1d2c3e4f5a6b/rotate-secret \
  -H "Authorization: Bearer $HISARPAY_API_KEY"

Details in the guide

GET/v1/events

List events

Scope: readKey: live or test

Query parameters

  • typestringoptional

    Only events of this type.

    Values:invoice.paidinvoice.overpaidinvoice.partialinvoice.expiredinvoice.cancelledinvoice.payment_receivedwithdrawal.completedwithdrawal.failedwithdrawal.rejectedtest.ping

  • limitintegeroptional

    Page size.

    1–100

  • beforestring (date-time)optional

    next_before from the previous response, for the next page.

    pattern ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$

Responses

  • 200 OKJSON response
Example request
curl "https://hisarpay.com/v1/events?limit=20" \
  -H "Authorization: Bearer $HISARPAY_API_KEY"
POST/v1/events/{id}/resend

Re-deliver an event to all matching endpoints

At most 30 resends per minute per account; more answer rate_limited.

Scope: webhooksKey: live only

Path parameters

  • idstring (uuid)required

    The record id.

Responses

  • 200 OKJSON response
Example request
curl -X POST https://hisarpay.com/v1/events/0b6a3f52-3c1d-4a7e-8f4b-1d2c3e4f5a6b/resend \
  -H "Authorization: Bearer $HISARPAY_API_KEY"

Details in the guide