List webhook endpoints for the current mode

get/v1/webhook_endpoints

Responses

  • 200Webhook endpointsobject
    Show the fields
    object"list"
    dataarray of WebhookEndpoint
    Fields of data
    idstring (uuid)
    object"webhook_endpoint"
    livemodeboolean
    urlstring (uri)
    eventsarray of payment_intent.successful | payment_intent.failed | payment_intent.abandoned | payment_intent.canceled | refund.succeeded | refund.failed | payout.paid | payout.failed | payout.canceled | dispute.created | dispute.won | dispute.lost | invoice.paid | crypto_payout.paid | crypto_payout.failed | topup.succeeded

    Always empty. Every endpoint receives every event type.

    statusenabled

    Always enabled. Endpoints aren't paused; delete one to stop it, and it leaves the list.

    created_atstring (date-time)
    has_moreboolean
bash
curl https://sandbox.api.biftpay.com/v1/webhook_endpoints \
  -H "Authorization: Bearer bp_test_..."
response
{
  "object": "list",
  "data": [
    {
      "id": "…",
      "object": "webhook_endpoint",
      "livemode": true,
      "url": "https://example.com/biftpay/webhooks",
      "events": [
        "payment_intent.successful"
      ],
      "status": "enabled",
      "created_at": "…"
    }
  ],
  "has_more": true
}

Register a webhook endpoint

post/v1/webhook_endpoints

The signing secret is returned once, here. URLs must be https with a public hostname. Each delivery has headers Biftpay-Event-Id, Biftpay-Timestamp and Biftpay-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<event id>.<body>">. Recompute it with the secret, compare in constant time and reject anything older than 5 minutes. Failed deliveries retry after 1m, 5m, 30m, 2h, 6h and 12h. Every endpoint receives every event type.

Parameters

Idempotency-Keystringin headerrequired

A unique key per logical request, for example a UUID. Up to 255 characters.

up to 255 characters

Body

urlstring (uri)required
eventsarray of payment_intent.successful | payment_intent.failed | payment_intent.abandoned | payment_intent.canceled | refund.succeeded | refund.failed | payout.paid | payout.failed | payout.canceled | dispute.created | dispute.won | dispute.lost | invoice.paid | crypto_payout.paid | crypto_payout.failed | topup.succeeded

Ignored. Every endpoint receives every event type.

Responses

  • 201Createdobject
    Show the fields
    idstring (uuid)
    object"webhook_endpoint"
    livemodeboolean
    urlstring (uri)
    eventsarray of payment_intent.successful | payment_intent.failed | payment_intent.abandoned | payment_intent.canceled | refund.succeeded | refund.failed | payout.paid | payout.failed | payout.canceled | dispute.created | dispute.won | dispute.lost | invoice.paid | crypto_payout.paid | crypto_payout.failed | topup.succeeded

    Always empty. Every endpoint receives every event type.

    statusenabled

    Always enabled. Endpoints aren't paused; delete one to stop it, and it leaves the list.

    created_atstring (date-time)
    secretstring
  • 400Invalid request
bash
curl -X POST https://sandbox.api.biftpay.com/v1/webhook_endpoints \
  -H "Authorization: Bearer bp_test_..." \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://merchant.example.com/biftpay/webhooks"
  }'
response
{
  "id": "…",
  "object": "webhook_endpoint",
  "livemode": true,
  "url": "https://example.com/biftpay/webhooks",
  "events": [
    "payment_intent.successful"
  ],
  "status": "enabled",
  "created_at": "…",
  "secret": "whsec_3jR8kQ2nVt9Lm4Xp7Wc1Zy6Hb0Gf5Sd"
}

Delete an endpoint

post/v1/webhook_endpoints/{id}/delete

Nothing more is sent to it, including deliveries still waiting, and it leaves the list. Its past deliveries stay in the event history. This can't be undone; add the URL again to get a new endpoint (with a new signing secret).

Parameters

idstring (uuid)in pathrequired
Idempotency-Keystringin headerrequired

A unique key per logical request, for example a UUID. Up to 255 characters.

up to 255 characters

Responses

  • 200Deletedobject
    Show the fields
    idstring
    object"webhook_endpoint"
    deletedtrue
  • 404Not found, or not visible to this key
bash
curl -X POST https://sandbox.api.biftpay.com/v1/webhook_endpoints/{id}/delete \
  -H "Authorization: Bearer bp_test_..." \
  -H "Idempotency-Key: $(uuidgen)"
response
{
  "id": "…",
  "object": "webhook_endpoint",
  "deleted": true
}

List events and their delivery status

get/v1/events

Parameters

limitintegerin query

1 to 100 · default 20

starting_afterstring (uuid)in query

The id of the last item on the previous page.

typepayment_intent.successful | payment_intent.failed | payment_intent.abandoned | payment_intent.canceled | refund.succeeded | refund.failed | payout.paid | payout.failed | payout.canceled | dispute.created | dispute.won | dispute.lost | invoice.paid | crypto_payout.paid | crypto_payout.failed | topup.succeededin query
payment_intentstring (uuid)in query

Only this payment's events, including its refunds' and disputes'. Send one again with POST /v1/events/{id}/redeliver.

Responses

  • 200A page of eventsEventList
    Show the fields
    object"list"
    dataarray of Event
    Fields of data
    idstring (uuid)
    object"event"
    typepayment_intent.successful | payment_intent.failed | payment_intent.abandoned | payment_intent.canceled | refund.succeeded | refund.failed | payout.paid | payout.failed | payout.canceled | dispute.created | dispute.won | dispute.lost | invoice.paid | crypto_payout.paid | crypto_payout.failed | topup.succeeded
    livemodeboolean
    created_atstring (date-time)
    dataobject
    deliveriesarray of object
    has_moreboolean
bash
curl https://sandbox.api.biftpay.com/v1/events \
  -H "Authorization: Bearer bp_test_..."
response
{
  "object": "list",
  "data": [
    {
      "id": "…",
      "object": "event",
      "type": "payment_intent.successful",
      "livemode": true,
      "created_at": "…",
      "data": {
        "object": {}
      }
    }
  ],
  "has_more": true
}

Send an event again to its endpoints

post/v1/events/{id}/redeliver

Parameters

idstring (uuid)in pathrequired
Idempotency-Keystringin headerrequired

A unique key per logical request, for example a UUID. Up to 255 characters.

up to 255 characters

Responses

  • 200How many deliveries were queuedobject
    Show the fields
    object"event_redelivery"
    event_idstring
    queuedinteger
bash
curl -X POST https://sandbox.api.biftpay.com/v1/events/{id}/redeliver \
  -H "Authorization: Bearer bp_test_..." \
  -H "Idempotency-Key: $(uuidgen)"
response
{}