Skip to content

Docs: by job

Events and webhooks

Every answer the claims sandbox makes, and every change to an enrollment request, posted to you as a signed event and kept for 30 days.

Read as markdown

Payerworks writes and explains files; it sends nothing to a payer. What that means

An event is a row before it is sent: every answer the claims sandbox makes, and every change to an enrollment request, is recorded on your account and posted to your webhook, and to each webhook destination you add, signed with a secret only you and Payerworks hold. Every event is kept for 30 days, to list and to send again.

Your server may receive an event more than once. Each event carries one id in the webhook-id header: keep the ids you have handled and skip one you have seen.

New here? Start with Following an event.

Routes

Each route shows its call with curl and with the two clients, then its real answer, shortened, and the fields it holds. The client calls assume one client made once, const pw = new Payerworks() in JavaScript or pw = payerworks.Payerworks() in Python, each reading PAYERWORKS_API_KEY and PAYERWORKS_BASE_URL, and body is the request.json shown.

PUT/v1/account/webhook

Set your webhook

The https address Payerworks posts your events to. The first answer carries the signing secret, once. Setting the address again keeps the secret; send rotate: true for a new one, and the previous secret keeps signing beside it for overlap_hours (0 to 720, 24 by default).

Request

curl -sS -X PUT "$PAYERWORKS_BASE_URL/v1/account/webhook" \
  -H "Authorization: Bearer $PAYERWORKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d @request.json
request.jsonJSON
{
  "url": "https://hooks.example.com/payerworks/events"
}
The answer (200)JSON
{
  "url": "https://hooks.example.com/payerworks/events",
  "secret": "whsec_bTqF5EiMSt1kZ4Sh577Ya/UQMCWse+eDI5CyF9JdOsk=",
  "secret_last_four": "Osk=",
  "created_at": "2026-10-19T15:00:00.000Z",
  "rotated": false,
  "previous_secret_expires_at": null
}
Field, Type, What it is
FieldTypeWhat it is
urlTypestring
secretTypestring or nullWhat it iswhsec_ and the secret. Set only when this request made one (the first set, or rotate: true); null otherwise.
secret_last_fourTypestring
created_atTypestring
rotatedTypeboolean
previous_secret_expires_atTypestring or null

DELETE/v1/account/webhook

Remove your webhook

No more events are sent. Removing a webhook that is not there is not an error.

Request

curl -sS -X DELETE "$PAYERWORKS_BASE_URL/v1/account/webhook" \
  -H "Authorization: Bearer $PAYERWORKS_API_KEY"
The answer (200)JSON
{
  "deleted": true
}
Field, Type, What it is
FieldTypeWhat it is
deletedTypethe value true

POST/v1/account/webhook/test

Send a test event

One ping event queued for your webhook, signed like every other. The answer is 202 with the event’s id; GET /v1/events/{id} says a moment later what your server did with it.

Request

curl -sS -X POST "$PAYERWORKS_BASE_URL/v1/account/webhook/test" \
  -H "Authorization: Bearer $PAYERWORKS_API_KEY"
The answer (202)JSON
{
  "queued": true,
  "event_id": "evt_7cb356efb22e856293c87091"
}
Field, Type, What it is
FieldTypeWhat it is
queuedTypethe value true
event_idTypestringWhat it isThe event’s id: GET /v1/events/{id} says what your server did with it.
destination_idTypestringWhat it isA redelivery to a webhook destination: which one.

GET/v1/events

List your events

Every webhook event queued for your key that is still kept (each is kept 30 days), newest first, each as it was sent with what delivering it did. Page with limit (up to 100) and starting_after (the next_cursor of the page before, or an event id), and filter with type, delivery_state (none: recorded for your webhook destinations only, with no account webhook set) and created_gte and created_lt.

Request

curl -sS -X GET "$PAYERWORKS_BASE_URL/v1/events" \
  -H "Authorization: Bearer $PAYERWORKS_API_KEY"
The answer (200)JSON
{
  "data": [
    {
      "id": "evt_4fbc127e84a0331dfb743e10",
      "type": "sandbox.remittance.received",
      "created": 1792422000,
      "mode": "test",
      "data": {
        "check_number": "PWSANDBOX-000000003-1",
        "payment_date": "20261019",
        "total": 1392,
        "claims": [
          {
            "reference": "PW-SBX-PAID",
            "payer_claim_number": "PWS2292711347",
            "status_code": "1",
            "status": "processed as primary",
            "paid": 1392
          }
        ]
      },
      "delivery": {
        "state": "delivered",
        "attempts": 1,
        "last_status": 200,
        "last_attempt_at": "2026-10-19T15:00:00.000Z",
        "last_error": null,
        "delivered_at": "2026-10-19T15:00:00.000Z"
      }
    },
    {
      "id": "evt_e38518c4523f2dcd24e34de2",
      "type": "sandbox.claim.acknowledged",
      "created": 1792422000,
      "mode": "test",
      "data": {
        "reference": "PW-SBX-PAID",
        "payer_claim_number": "PWS2292711347",
        "verdict": "A",
        "fixes": [
          "The claim was accepted into the payer's adjudication system: accepted for processing (STC A2:20). Nothing to fix."
        ]
      },
      "delivery": {
        "state": "delivered",
        "attempts": 1,
        "last_status": 200,
        "last_attempt_at": "2026-10-19T15:00:00.000Z",
        "last_error": null,
        "delivered_at": "2026-10-19T15:00:00.000Z"
      }
    }
  ],
  "has_more": true,
  "next_cursor": "cur_45233137393234313634363138393523303031236576745f376362333536656662323265383536323933633837303931"
}
Field, Type, What it is
FieldTypeWhat it is
dataTypelist of EventWhat it isNewest first.
has_moreTypeboolean
next_cursorTypestring or nullWhat it isPass as starting_after for the next page.

GET/v1/events/{id}

One event

One event by its id, as it was sent, with its delivery: pending, delivered or failed, how many times it was posted, the last status and the last error.

Request

curl -sS -X GET "$PAYERWORKS_BASE_URL/v1/events/evt_4ba3d86a9cb07e1b79f6e144" \
  -H "Authorization: Bearer $PAYERWORKS_API_KEY"
The answer (200)JSON
{
  "id": "evt_4fbc127e84a0331dfb743e10",
  "type": "sandbox.remittance.received",
  "created": 1792422000,
  "mode": "test",
  "data": {
    "check_number": "PWSANDBOX-000000003-1",
    "payment_date": "20261019",
    "total": 1392,
    "claims": [
      {
        "reference": "PW-SBX-PAID",
        "payer_claim_number": "PWS2292711347",
        "status_code": "1",
        "status": "processed as primary",
        "paid": 1392
      }
    ]
  },
  "delivery": {
    "state": "delivered",
    "attempts": 1,
    "last_status": 200,
    "last_attempt_at": "2026-10-19T15:00:00.000Z",
    "last_error": null,
    "delivered_at": "2026-10-19T15:00:00.000Z"
  }
}
Field, Type, What it is
FieldTypeWhat it is
idTypestringWhat it isevt_ and hex. The same each time the same event is sent.
typeTypeone of "ping", "sandbox.file.acknowledged", "sandbox.claim.acknowledged", "sandbox.remittance.received", "enrollment.updated", "enrollment.live", "enrollment.rejected", "enrollment.canceled", "enrollment.ended", "enrollment.task.assigned", "enrollment.task.completed", "enrollment.task.deleted", "job.completed", "job.failed", "submission.file.acknowledged", "submission.claim.acknowledged", "submission.remittance.received"
createdTypeintegerWhat it isUnix seconds.
modeTypeone of "test", "live"What it isThe key’s: an enrollment event of a live key is live, and a submission event always is; a ping and the sandbox payer’s events are always test.
dataTypeobjectWhat it isThe event’s own facts: for a sandbox event, invented answers, your claim references and your file’s control numbers; for an enrollment event, ids, statuses and words only; for a submission event, your references, the control numbers and the partner’s verdicts and amounts, never a name or a member ID.
deliveryTypeEventDelivery

POST/v1/events/{id}/redeliver

Send an event again

The event queued once more for the address your webhook has now, signed the same way and with the same id. The answer is 202, and the event’s delivery then says what your server did. It counts against your key’s six deliveries a minute. Send destination_id to send it to that webhook destination instead, as a manual attempt that starts its retries again from the first.

Request

curl -sS -X POST "$PAYERWORKS_BASE_URL/v1/events/evt_4ba3d86a9cb07e1b79f6e144/redeliver" \
  -H "Authorization: Bearer $PAYERWORKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d @request.json
request.jsonJSON
{
  "destination_id": "wd_41a29f8a49c92190"
}
The answer (202)JSON
{
  "queued": true,
  "event_id": "evt_4fbc127e84a0331dfb743e10",
  "destination_id": "wd_41a29f8a49c92190"
}
Field, Type, What it is
FieldTypeWhat it is
queuedTypethe value true
event_idTypestringWhat it isThe event’s id: GET /v1/events/{id} says what your server did with it.
destination_idTypestringWhat it isA redelivery to a webhook destination: which one.

GET/v1/events/{id}/attempts

Every attempt for an event

Each post made for one event at your webhook destinations: its number, automatic or manual, the status your server answered and when. destination_id narrows it to one.

Request

curl -sS -X GET "$PAYERWORKS_BASE_URL/v1/events/evt_d22bb79c06aa5cfbd67b6362/attempts" \
  -H "Authorization: Bearer $PAYERWORKS_API_KEY"
The answer (200)JSON
{
  "event_id": "evt_d22bb79c06aa5cfbd67b6362",
  "data": [
    {
      "event_id": "evt_d22bb79c06aa5cfbd67b6362",
      "destination_id": "wd_41a29f8a49c92190",
      "number": 1,
      "type": "automatic",
      "delivered": false,
      "status": 503,
      "error": "The endpoint answered 503; only a 2xx counts as delivered.",
      "at": "2026-11-11T02:55:51.870Z"
    }
  ]
}
Field, Type, What it is
FieldTypeWhat it is
event_idTypestring
dataTypelist of objectWhat it isEach post: its headers carry Payerworks-Attempt-Number, Payerworks-Attempt-Type, Payerworks-Destination-Id.

GET/v1/webhook-destinations

List your webhook destinations

Every destination your key posts events to, besides your account webhook: up to ten, each with its name, address, the event types it takes, whether it is enabled, how many deliveries it takes at once, and the last four characters of its secret.

Request

curl -sS -X GET "$PAYERWORKS_BASE_URL/v1/webhook-destinations" \
  -H "Authorization: Bearer $PAYERWORKS_API_KEY"
The answer (200)JSON
{
  "data": [
    {
      "id": "wd_41a29f8a49c92190",
      "name": "Primary",
      "url": "https://hooks.example.com/payerworks/primary",
      "event_types": [
        "sandbox.claim.acknowledged",
        "sandbox.remittance.received"
      ],
      "enabled": true,
      "concurrency": 2,
      "secret_last_four": "WYw=",
      "previous_secret_expires_at": null,
      "disabled_at": null,
      "disabled_reason": null,
      "failing_since": null,
      "notices": [],
      "created_at": "2026-11-11T02:55:51.817Z",
      "updated_at": "2026-11-11T02:55:51.817Z"
    }
  ]
}
Field, Type, What it is
FieldTypeWhat it is
dataTypelist of WebhookDestinationWhat it isAt most 10.

POST/v1/webhook-destinations

Add a webhook destination

A named https address with its own signing secret, shown once in this answer. event_types narrows what it receives (leave it out for every type), enabled turns it off and on, and concurrency (1 to 10, 2 by default) is how many deliveries it takes at once. Only events Payerworks makes are sent. A delivery that fails is tried again 5 minutes, 30 minutes, 2 hours, 8 hours, 24 hours and 48 hours later; after the seventh attempt fails, the destination is disabled.

Request

curl -sS -X POST "$PAYERWORKS_BASE_URL/v1/webhook-destinations" \
  -H "Authorization: Bearer $PAYERWORKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d @request.json
request.jsonJSON
{
  "name": "Primary",
  "url": "https://hooks.example.com/payerworks/primary",
  "event_types": [
    "sandbox.claim.acknowledged",
    "sandbox.remittance.received"
  ],
  "concurrency": 2
}
The answer (201)JSON
{
  "id": "wd_41a29f8a49c92190",
  "name": "Primary",
  "url": "https://hooks.example.com/payerworks/primary",
  "event_types": [
    "sandbox.claim.acknowledged",
    "sandbox.remittance.received"
  ],
  "enabled": true,
  "concurrency": 2,
  "secret_last_four": "WYw=",
  "previous_secret_expires_at": null,
  "disabled_at": null,
  "disabled_reason": null,
  "failing_since": null,
  "notices": [],
  "created_at": "2026-11-11T02:55:51.817Z",
  "updated_at": "2026-11-11T02:55:51.817Z",
  "secret": "whsec_ygf1wt5bTlUFJ6Sig274rsn27dEs3KBJDQrYfiVqWYw="
}
Field, Type, What it is
FieldTypeWhat it is
idTypestringWhat it iswd_ and 16 hexadecimal characters.
nameTypestring
urlTypestring
event_typesTypelist of one of "ping", "sandbox.file.acknowledged", "sandbox.claim.acknowledged", "sandbox.remittance.received", "enrollment.updated", "enrollment.live", "enrollment.rejected", "enrollment.canceled", "enrollment.ended", "enrollment.task.assigned", "enrollment.task.completed", "enrollment.task.deleted", "job.completed", "job.failed", "submission.file.acknowledged", "submission.claim.acknowledged", "submission.remittance.received"What it isEmpty: every type.
enabledTypeboolean
concurrencyTypeinteger
secret_last_fourTypestring
previous_secret_expires_atTypestring or null
disabled_atTypestring or null
disabled_reasonTypestring or nullWhat it isretries_exhausted, when Payerworks disabled it.
failing_sinceTypestring or null
noticesTypelist of object
created_atTypestring
updated_atTypestring
secretTypestringWhat it iswhsec_ and the secret: only in the answer that made it (the create, or rotate: true).

GET/v1/webhook-destinations/{id}

One webhook destination

One destination, with when it started failing and the notices sent about it. Never its secret.

Request

curl -sS -X GET "$PAYERWORKS_BASE_URL/v1/webhook-destinations/wd_41a29f8a49c92190" \
  -H "Authorization: Bearer $PAYERWORKS_API_KEY"
The answer (200)JSON
{
  "id": "wd_41a29f8a49c92190",
  "name": "Primary",
  "url": "https://hooks.example.com/payerworks/primary",
  "event_types": [
    "sandbox.claim.acknowledged",
    "sandbox.remittance.received"
  ],
  "enabled": true,
  "concurrency": 2,
  "secret_last_four": "WYw=",
  "previous_secret_expires_at": null,
  "disabled_at": null,
  "disabled_reason": null,
  "failing_since": null,
  "notices": [],
  "created_at": "2026-11-11T02:55:51.817Z",
  "updated_at": "2026-11-11T02:55:51.817Z"
}
Field, Type, What it is
FieldTypeWhat it is
idTypestringWhat it iswd_ and 16 hexadecimal characters.
nameTypestring
urlTypestring
event_typesTypelist of one of "ping", "sandbox.file.acknowledged", "sandbox.claim.acknowledged", "sandbox.remittance.received", "enrollment.updated", "enrollment.live", "enrollment.rejected", "enrollment.canceled", "enrollment.ended", "enrollment.task.assigned", "enrollment.task.completed", "enrollment.task.deleted", "job.completed", "job.failed", "submission.file.acknowledged", "submission.claim.acknowledged", "submission.remittance.received"What it isEmpty: every type.
enabledTypeboolean
concurrencyTypeinteger
secret_last_fourTypestring
previous_secret_expires_atTypestring or null
disabled_atTypestring or null
disabled_reasonTypestring or nullWhat it isretries_exhausted, when Payerworks disabled it.
failing_sinceTypestring or null
noticesTypelist of object
created_atTypestring
updated_atTypestring
secretTypestringWhat it iswhsec_ and the secret: only in the answer that made it (the create, or rotate: true).

PUT/v1/webhook-destinations/{id}

Change a webhook destination

Change any of its fields, turn it on again after it was disabled, or send rotate: true for a new secret (shown once); the old one keeps signing beside it for overlap_hours, 0 to 720, 24 by default.

Request

curl -sS -X PUT "$PAYERWORKS_BASE_URL/v1/webhook-destinations/wd_41a29f8a49c92190" \
  -H "Authorization: Bearer $PAYERWORKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d @request.json
request.jsonJSON
{
  "rotate": true,
  "overlap_hours": 48
}
The answer (200)JSON
{
  "id": "wd_41a29f8a49c92190",
  "name": "Primary",
  "url": "https://hooks.example.com/payerworks/primary",
  "event_types": [
    "sandbox.claim.acknowledged",
    "sandbox.remittance.received"
  ],
  "enabled": true,
  "concurrency": 2,
  "secret_last_four": "zkg=",
  "previous_secret_expires_at": "2026-11-13T02:55:51.826Z",
  "disabled_at": null,
  "disabled_reason": null,
  "failing_since": null,
  "notices": [],
  "created_at": "2026-11-11T02:55:51.817Z",
  "updated_at": "2026-11-11T02:55:51.826Z",
  "secret": "whsec_UjO0WmiT6vdIEM4PrHJDu55wnQs2VkqdWPqR8u2Yzkg="
}
Field, Type, What it is
FieldTypeWhat it is
idTypestringWhat it iswd_ and 16 hexadecimal characters.
nameTypestring
urlTypestring
event_typesTypelist of one of "ping", "sandbox.file.acknowledged", "sandbox.claim.acknowledged", "sandbox.remittance.received", "enrollment.updated", "enrollment.live", "enrollment.rejected", "enrollment.canceled", "enrollment.ended", "enrollment.task.assigned", "enrollment.task.completed", "enrollment.task.deleted", "job.completed", "job.failed", "submission.file.acknowledged", "submission.claim.acknowledged", "submission.remittance.received"What it isEmpty: every type.
enabledTypeboolean
concurrencyTypeinteger
secret_last_fourTypestring
previous_secret_expires_atTypestring or null
disabled_atTypestring or null
disabled_reasonTypestring or nullWhat it isretries_exhausted, when Payerworks disabled it.
failing_sinceTypestring or null
noticesTypelist of object
created_atTypestring
updated_atTypestring
secretTypestringWhat it iswhsec_ and the secret: only in the answer that made it (the create, or rotate: true).

DELETE/v1/webhook-destinations/{id}

Remove a webhook destination

No more events are sent to it, and its retries already scheduled are skipped. Removing one that is not there is not an error.

Request

curl -sS -X DELETE "$PAYERWORKS_BASE_URL/v1/webhook-destinations/wd_41a29f8a49c92190" \
  -H "Authorization: Bearer $PAYERWORKS_API_KEY"
The answer (200)JSON
{
  "id": "wd_41a29f8a49c92190",
  "deleted": true
}
Field, Type, What it is
FieldTypeWhat it is
idTypestring
deletedTypethe value true

POST/v1/webhook-destinations/{id}/ping

Ping a webhook destination

One signed ping event to this destination alone, whatever event types it takes. The answer is 202 with the event’s id.

Request

curl -sS -X POST "$PAYERWORKS_BASE_URL/v1/webhook-destinations/wd_41a29f8a49c92190/ping" \
  -H "Authorization: Bearer $PAYERWORKS_API_KEY"
The answer (202)JSON
{
  "queued": true,
  "event_id": "evt_30c0f632ee63e19233b6974f",
  "destination_id": "wd_41a29f8a49c92190"
}
Field, Type, What it is
FieldTypeWhat it is
queuedTypethe value true
event_idTypestring
destination_idTypestring

GET/v1/webhook-destinations/{id}/deliveries

What a destination received

Each event’s delivery at this destination, newest first: pending, scheduled (failed, with the next automatic attempt’s time), delivered or failed, how many attempts, the last status and error. Filter with state, created_gte and created_lt; page with limit and starting_after.

Request

curl -sS -X GET "$PAYERWORKS_BASE_URL/v1/webhook-destinations/wd_41a29f8a49c92190/deliveries" \
  -H "Authorization: Bearer $PAYERWORKS_API_KEY"
The answer (200)JSON
{
  "data": [
    {
      "event_id": "evt_d22bb79c06aa5cfbd67b6362",
      "event_type": "sandbox.remittance.received",
      "destination_id": "wd_41a29f8a49c92190",
      "created_at": "2026-11-11T02:55:51.837Z",
      "state": "scheduled",
      "attempts": 1,
      "next_attempt_at": "2026-11-11T03:00:51.870Z",
      "last_attempt_at": "2026-11-11T02:55:51.870Z",
      "last_status": 503,
      "last_error": "The endpoint answered 503; only a 2xx counts as delivered.",
      "delivered_at": null
    },
    {
      "event_id": "evt_005a15b6387e29df7393eac0",
      "event_type": "sandbox.claim.acknowledged",
      "destination_id": "wd_41a29f8a49c92190",
      "created_at": "2026-11-11T02:55:51.837Z",
      "state": "scheduled",
      "attempts": 1,
      "next_attempt_at": "2026-11-11T03:00:51.870Z",
      "last_attempt_at": "2026-11-11T02:55:51.870Z",
      "last_status": 503,
      "last_error": "The endpoint answered 503; only a 2xx counts as delivered.",
      "delivered_at": null
    }
  ],
  "has_more": false,
  "next_cursor": null
}

Shortened here: lists show their first two items and long strings are cut. The whole answer is this route’s example in /openapi.json.

Field, Type, What it is
FieldTypeWhat it is
dataTypelist of DestinationDeliveryWhat it isNewest first.
has_moreTypeboolean
next_cursorTypestring or nullWhat it isPass as starting_after.

Reading the answer

  • Each delivery carries the Standard Webhooks headers (webhook-id, webhook-timestamp, webhook-signature) and Payerworks-Signature. Check either with the clients’ verifiers, over the raw body, before you parse it.
  • GET /v1/events lists newest first, filtered by type, by delivery state and by when it was made; GET /v1/events/{id}/attempts lists every attempt, automatic or by hand.

Troubleshooting

  • invalid_webhook_url (400): A webhook address is https, at a public hostname, on port 443, with no login.
  • event_limit_reached (429): An account keeps at most its daily number of events; past it, nothing more is recorded until 00:00 UTC.
  • not_at_destination (404): That event was never sent to this destination: it was made before the destination was added, or its type is filtered out.
  • A signature that does not verify is almost always a body that was parsed and written again before the check. Check the raw bytes as they arrived.

Every refusal these routes may answer, with its status. Any route may also answer the codes every route shares, on Every error.

Code, Status, What it means
CodeStatusWhat it means
invalid_concurrencyStatus400What it meansconcurrency is a whole number from 1 to 10: how many deliveries this destination takes at once.
invalid_contact_emailStatus400What it meansemail is an address of at most 254 characters, or null to remove it.
invalid_createdStatus400What it meanscreated_gte and created_lt are instants written like 2026-10-19T14:00:00Z, and created_gte comes before created_lt.
invalid_cursorStatus400What it meansstarting_after is the next_cursor of an earlier page, or the id of one of this key's events.
invalid_delivery_stateStatus400What it meansThe delivery state filter names one of the states the developers page lists.
invalid_destination_idStatus400What it meansA destination id is wd_ followed by 16 lowercase hexadecimal characters.
invalid_destination_nameStatus400What it meansA destination's name is 1 to 80 characters.
invalid_enabledStatus400What it meansenabled is true or false, or left out.
invalid_event_idStatus400What it meansAn event id is evt_ followed by 16 to 64 lowercase hexadecimal characters.
invalid_event_typeStatus400What it meanstype is one of the event types the developers page lists.
invalid_event_typesStatus400What it meansevent_types is a list of the event types the developers page lists; an empty list, or leaving it out, receives every type.
invalid_expires_in_daysStatus400What it meansexpires_in_days is a whole number from 1 to 365, or left out for a key that does not expire.
invalid_key_idStatus400What it meansA key id is pwk_ followed by 16 to 40 letters and digits.
invalid_key_nameStatus400What it meansA key's name is 1 to 80 characters.
invalid_limitStatus400What it meanslimit is a whole number from 1 to 100.
invalid_overlap_hoursStatus400What it meansoverlap_hours is a whole number from 0 to 720: how long the old secret is still accepted after a rotation.
invalid_rotateStatus400What it meansrotate is true or false, or left out.
invalid_webhook_urlStatus400What it meansA webhook address is https, at a public hostname, on port 443, with no login, at most 500 characters.
contact_not_provedStatus403What it meansNotices go only to an address Payerworks has proved: the one that asked for this account's test key by email and opened the link we sent. Send that address, or null to stop the notices. To use another, write to us from it.
destination_not_foundStatus404What it meansThis key has no webhook destination with that id.
event_not_foundStatus404What it meansNo event of this key has that id. Events are kept for 30 days.
key_not_foundStatus404What it meansThis account has no key with that id.
not_at_destinationStatus404What it meansThat event was never sent to this destination (it was made before the destination was added, or its type is filtered out). A ping or a new event will be.
destination_conflictStatus409What it meansThe destination changed while this request ran, so nothing was saved. Send the request again.
destination_disabledStatus409What it meansThis destination is disabled. Enable it with PUT /v1/webhook-destinations/{id} and enabled: true first.
destination_limit_reachedStatus409What it meansA key holds at most 10 webhook destinations. Remove one to add another.
key_last_usableStatus409What it meansThat is the account's last usable key of its mode, so it was not revoked: without one, no key can be made and the audit log cannot be read. Make a replacement with POST /v1/keys first, then revoke this one.
key_limit_reachedStatus409What it meansAn account holds at most 3 test keys or 25 live keys that are not revoked. Revoke one to make another.
key_revokedStatus409What it meansThat key is revoked, so it cannot be rotated. Make a new key with POST /v1/keys.
key_rotation_conflictStatus409What it meansAnother rotation of this key finished while this one ran, so this one made nothing: the secret that other request showed is the key's current one. List the keys with GET /v1/keys, and rotate again if that secret was lost.
key_settings_out_of_rangeStatus409What it meansThe key's stored rate or account name is outside what a key may hold, so nothing was made or rotated; reason says which. Ask Payerworks to correct the key: sending the request again answers the same.
no_webhookStatus409What it meansThis key has no webhook yet: set one with PUT /v1/account/webhook first.
webhook_conflictStatus409What it meansThe webhook changed while this request ran, so nothing was saved. Send the request again.
too_many_eventsStatus413What it meansThis run made more events than one delivery carries, so none were queued. Send fewer claims a call.
event_limit_reachedStatus429What it meansThis account's keys have recorded the 2,000 events an account keeps in a UTC day, so no more are recorded or sent this UTC day. Events are recorded again from 00:00 UTC; an event refused before then is never sent by itself.
webhook_rate_limitedStatus429What it meansOver this key's webhook deliveries a minute, so nothing was queued. Wait for the next minute.
queue_unavailableStatus503What it meansWe could not queue the events for delivery just now. Retry in a moment.

Code lists

The event types

Type, When it is sent
TypeWhen it is sent
pingWhen it is sentSent when you ask for a test event, from the console or POST /v1/account/webhook/test. It carries no claim.
sandbox.file.acknowledgedWhen it is sentThe 999 for your file: its verdict, how many transaction sets were received and accepted, and the control numbers of the interchange, the group and each set.
sandbox.claim.acknowledgedWhen it is sentOne for each claim, from the 277CA: your reference, the payer claim number, accepted or rejected, and every fix as a sentence.
sandbox.remittance.receivedWhen it is sentOne for each check in the 835, once the payer adjudicated anything (an 835 pays each billing provider by its own check): the check number, its date and total, and each claim that check paid, with its reference, status and amount paid.
enrollment.updatedWhen it is sentAn enrollment request changed: a status change no type below names, or its fields, tasks, documents or notes. It carries the status, the previous status, whose turn it is, the reason, the fields that changed and the sequence.
enrollment.liveWhen it is sentThe payer confirmed the request: files of this kind may flow. It adds when, and the payer’s reference.
enrollment.rejectedWhen it is sentThe request was refused. It adds the rejection: the payer’s words whole, and the remedy.
enrollment.canceledWhen it is sentThe request was canceled, or you asked to cancel one that is with the payer or live (cancel_requested says which).
enrollment.endedWhen it is sentA live route ended: the payer ended it, or a cancel you asked for while it was live went through (in the sandbox, at the next advance).
enrollment.task.assignedWhen it is sentA task was added: its id, rank, who holds it, its title and its fields.
enrollment.task.completedWhen it is sentA task was finished, by the provider, or by Payerworks for its own.
enrollment.task.deletedWhen it is sentA task was replaced by another (superseded_by names it).
job.completedWhen it is sentA batch job finished, every call answered or, when it ran out of time, partly: its id, route, state and counts, and until when its result is kept. Never the result or a link to it: ask GET /v1/jobs/{id} for the link.
job.failedWhen it is sentA batch job failed, or was stopped: its id, route, state, counts and the failure’s code. Nothing of the file you uploaded.
submission.file.acknowledgedWhen it is sentThe partner’s 999 for a file you sent with POST /v1/claims/submit: accepted, rejected or partial, with each refused claim’s fix in words.
submission.claim.acknowledgedWhen it is sentThe partner’s 277CA verdict on one claim you sent, with the payer’s claim number when it gives one, and each fix in words.
submission.remittance.receivedWhen it is sentAn 835 whose every claim you sent: the check, and each claim’s billed, paid and patient share. An 835 that also pays claims you did not send is held, and reaches no one.

A delivery’s state

pending, scheduled, delivered, failed

When a destination’s delivery is tried again

After a failed attempt, a destination is tried again after 5 minutes, then 30 minutes, then 2 hours, then 8 hours, then 1 day, then 2 days: 7 attempts in all, then it is said failed, and you can send it again by hand.

In detail

Webhooks

Set an https address in the console and every answer the 837P claims sandbox (POST /v1/sandbox/claims) makes, and every change to an enrollment request, is posted to it as an event, the moment it is made, signed with a secret only you and Payerworks hold. An event your server does not take is tried again, and every event is kept for 30 days, to list and to send again.

Every event is a POST of JSON in one shape. In it, created is the time in Unix seconds, mode is the key’s (a sandbox event is always test), and id is the same each time the same event is sent, a retry and a resend included, so you can ignore one you already handled.

An eventJSON
POST /your/webhook
Content-Type: application/json
User-Agent: Payerworks-Webhooks/1
webhook-id: evt_8a1c…
webhook-timestamp: 1792324800
webhook-signature: v1,K5oZfzN95Z9UVu1EsfQmfVNQhnkZ2pj9o9NDN/H/pI4=
Payerworks-Signature: t=1792324800,v1=5f0c…

{ "id": "evt_8a1c…", "type": "sandbox.claim.acknowledged", "created": 1792324800, "mode": "test",
  "data": { "reference": "PW-SBX-REJ", "verdict": "R", "fixes": [ "The claim was rejected…" ] } }

Each POST is signed under the Standard Webhooks specification, so any of its libraries checks it: webhook-id is the event’s id, webhook-timestamp the time it was signed in Unix seconds, and webhook-signature is v1, a comma and the signature in base64.

That signature is HMAC-SHA256 over the id, a period, the timestamp, a period and the raw body exactly as it arrived, keyed with your signing secret’s bytes: the part after whsec_, decoded from base64.

Each POST also carries the Payerworks-Signature header the first receivers were built on: t, the time it was signed in Unix seconds, and v1, HMAC-SHA256 keyed with your whole signing secret over the time, a period and the raw body, written in hex.

Check one of them before you trust the body: compute the same HMAC, compare the two in constant time, and refuse a time more than five minutes from your clock, so a captured event cannot be sent to you again.

Checking the Standard Webhooks signature, in three languages:

Node.jsJavaScript
import crypto from "node:crypto";

// headers: the headers of the request (Node gives their names in lowercase);
// rawBody: the request body exactly as it arrived, before any JSON parsing.
export function verifyWebhook(secret, headers, rawBody, toleranceSeconds = 300) {
  const id = headers["webhook-id"];
  const timestamp = String(headers["webhook-timestamp"] || "");
  if (!id || !/^\d+$/.test(timestamp)) return false;
  if (Math.abs(Date.now() / 1000 - Number(timestamp)) > toleranceSeconds) return false;
  const key = Buffer.from(secret.replace(/^whsec_/, ""), "base64");
  const expected = crypto.createHmac("sha256", key).update(`${id}.${timestamp}.`).update(rawBody).digest();
  return String(headers["webhook-signature"] || "").split(" ").some((entry) => {
    const [version, signature] = entry.split(",");
    const given = Buffer.from(signature || "", "base64");
    return version === "v1" && given.length === expected.length && crypto.timingSafeEqual(given, expected);
  });
}
PythonPython
import base64, hashlib, hmac, re, time

# headers: the headers of the request, names in lowercase; raw_body: the body exactly as it arrived, as bytes.
# Never raises on a forged or garbled header: it answers False.
def verify_webhook(secret: str, headers: dict, raw_body: bytes, tolerance: int = 300) -> bool:
    msg_id = headers.get("webhook-id", "")
    timestamp = headers.get("webhook-timestamp", "")
    if not msg_id or not re.fullmatch(r"[0-9]{1,12}", timestamp) or abs(time.time() - int(timestamp)) > tolerance:
        return False
    encoded = secret.removeprefix("whsec_").replace("-", "+").replace("_", "/")
    key = base64.b64decode(encoded + "=" * (-len(encoded) % 4))
    signed = f"{msg_id}.{timestamp}.".encode() + raw_body
    expected = base64.b64encode(hmac.new(key, signed, hashlib.sha256).digest())
    return any(
        hmac.compare_digest(expected, entry[3:].encode())
        for entry in headers.get("webhook-signature", "").split(" ")
        if entry.startswith("v1,") and entry.isascii()
    )
Shellcurl
# A quick check by hand. $WEBHOOK_ID, $WEBHOOK_TIMESTAMP and $WEBHOOK_SIGNATURE hold the three
# headers; body.json is the body as it arrived.
key=$(printf '%s' "${PAYERWORKS_WEBHOOK_SECRET#whsec_}" | tr '_-' '/+')
while [ $(( ${#key} % 4 )) -ne 0 ]; do key="$key="; done
hexkey=$(printf '%s' "$key" | openssl base64 -d -A | od -An -v -tx1 | tr -d ' \n')
expected=$({ printf '%s.%s.' "$WEBHOOK_ID" "$WEBHOOK_TIMESTAMP"; cat body.json; } | openssl dgst -sha256 -mac HMAC -macopt "hexkey:$hexkey" -binary | openssl base64 -A)
case " $WEBHOOK_SIGNATURE " in *" v1,$expected "*) echo "signature ok" ;; *) echo "signature does not match" ;; esac

Checking the Payerworks-Signature header instead, for a receiver built on it:

Node.jsJavaScript
import crypto from "node:crypto";

// rawBody: the request body exactly as it arrived, before any JSON parsing.
export function verifyPayerworks(secret, header, rawBody, toleranceSeconds = 300) {
  const fields = { v1: [] };
  for (const part of String(header || "").split(",")) {
    const at = part.indexOf("=");
    if (at < 1) continue;
    const name = part.slice(0, at).trim();
    const value = part.slice(at + 1).trim();
    if (name === "v1") fields.v1.push(value); else fields[name] = value;
  }
  const t = fields.t || "";
  if (!/^\d+$/.test(t) || Math.abs(Date.now() / 1000 - Number(t)) > toleranceSeconds) return false;
  const expected = crypto.createHmac("sha256", secret).update(`${t}.`).update(rawBody).digest();
  return fields.v1.some((v) => {
    const given = Buffer.from(v, "hex");
    return given.length === expected.length && crypto.timingSafeEqual(given, expected);
  });
}
PythonPython
import hashlib, hmac, re, time

# raw_body: the request body exactly as it arrived, as bytes. Never raises on a garbled header: it answers False.
def verify_payerworks(secret: str, header: str, raw_body: bytes, tolerance: int = 300) -> bool:
    parts = [p.strip().split("=", 1) for p in header.split(",") if "=" in p]
    t = next((v for k, v in parts if k == "t"), "")
    if not re.fullmatch(r"[0-9]{1,12}", t) or abs(time.time() - int(t)) > tolerance:
        return False
    expected = hmac.new(secret.encode(), t.encode() + b"." + raw_body, hashlib.sha256).hexdigest()
    return any(hmac.compare_digest(expected, v) for k, v in parts if k == "v1" and v.isascii())
Shellcurl
# A quick check by hand. $SIGNATURE holds the value of the header; body.json is the body as it arrived.
t=$(printf '%s' "$SIGNATURE" | sed -E 's/.*t=([0-9]+).*/\1/')
expected=$({ printf '%s.' "$t"; cat body.json; } | openssl dgst -sha256 -hmac "$PAYERWORKS_WEBHOOK_SECRET" | sed 's/^.*= //')
case ",$SIGNATURE," in *",v1=$expected,"*) echo "signature ok" ;; *) echo "signature does not match" ;; esac
  • Events are queued when the call is answered and posted a moment later, so your call never waits on your server. The call’s answer says how many were queued. A key may queue six deliveries a minute.
  • Answer with any 2xx within four seconds and the event is delivered. A redirect, a timeout or any other answer is not, and Payerworks tries again: twice more, one and then two minutes later, sending only the events not yet delivered. All of one try’s events share ten seconds, and an endpoint that could not be reached is not asked again in that try.
  • An event can arrive more than once, so ignore one whose webhook-id you already handled.
  • Your address must be https, at a hostname rather than an IP address, on the standard port, with no user name or password in it.
  • The signing secret begins whsec_ and is shown once, when it is made (and again to a retry of that same request with the same Idempotency-Key, within 24 hours). Setting the address again keeps it. Ask for a new one with rotate: true; the previous secret then signs every event beside the new one for 24 hours, or the overlap_hours you send (0 to 720), so a header carries two signatures and your server can switch over without missing one.
  • A secret made before 10/19/2026 is written in an older alphabet (base64url, without padding). It keeps working, and the samples below read both; rotate it for one every Standard Webhooks library reads as it is.

Setting the address, rotating its secret and sending a test event from your own system:

curlcurl
# Set the address. The first answer carries the signing secret once: store it.
curl -X PUT "$PAYERWORKS_BASE_URL/v1/account/webhook" \
  -H "Authorization: Bearer $PAYERWORKS_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{ "url": "https://example.com/payerworks/events" }'

# Rotate the secret: a new one, shown once; the old one signs beside it for 24 hours.
curl -X PUT "$PAYERWORKS_BASE_URL/v1/account/webhook" \
  -H "Authorization: Bearer $PAYERWORKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://example.com/payerworks/events", "rotate": true }'

# Queue one ping event for it (202, with the event id).
curl -X POST "$PAYERWORKS_BASE_URL/v1/account/webhook/test" \
  -H "Authorization: Bearer $PAYERWORKS_API_KEY"

# A moment later: what the delivery did, as webhook.last_delivery.
curl "$PAYERWORKS_BASE_URL/v1/account" -H "Authorization: Bearer $PAYERWORKS_API_KEY"

Webhook destinations

  • Besides the one account webhook, a key may hold up to ten webhook destinations, each with its own name, https address and signing secret (shown once), the event types it takes and how many deliveries it takes at once (1 to 10, 2 by default). Only events Payerworks makes are sent, and a ping always reaches the destination it is sent to.
  • A delivery a destination did not take is tried again 5 minutes, 30 minutes, 2 hours, 8 hours, 24 hours and 48 hours after the attempt before it, seven attempts in all. After the seventh fails, the destination is disabled; PUT /v1/webhook-destinations/{id} with enabled: true turns it on again.
  • Each post to a destination carries Payerworks-Attempt-Number, Payerworks-Attempt-Type (automatic, or manual for a redelivery you asked for) and Payerworks-Destination-Id beside both signatures. GET /v1/events/{id}/attempts lists every attempt, and a destination’s deliveries say which are pending, scheduled, delivered or failed.
  • Set a notice address with PUT /v1/account/contact, and Payerworks emails it when a destination has been failing for 2 hours, for 24 hours, and when it is disabled. Each notice goes with the first failed attempt past its mark, so the first comes with the attempt about 2 hours 35 minutes after the first failure. A notice names the destination by its id and its address’s host, never by its name.
  • POST /v1/events/{id}/redeliver with destination_id sends an event to that destination as a manual attempt and starts its retries again from the first. A destination’s secret is rotated the way the account webhook’s is, with overlap_hours.

The event log

  • GET /v1/events lists your key’s events newest first, each as it was sent with what delivering it did: pending, delivered or failed, how many times it was posted, the last status (null when your server gave no answer) and the last error. An event that could not be queued, whose webhook was removed before it went, or that no delivery reported on within 65 minutes of being queued is failed too, its last error saying why and how to send it again. Pass limit (up to 100), type, and starting_after (the next_cursor of the page before, or an event id) to read further.
  • GET /v1/events/{id} reads one event, and POST /v1/events/{id}/redeliver sends it again to the address set now. An event not yet delivered that is queued again, this way or by a retry with the same Idempotency-Key, reads pending until that delivery is done.
  • An event is kept for 30 days and holds only what the event says: the sandbox payer’s invented answer, your claim references and your file’s control numbers, never the claim you sent; an enrollment event holds ids, statuses and words, never a tax id, a contact, a note or a document.
  • An account’s keys together record up to 2,000 events a UTC day. Past that, a run still answers in full, but its events are not recorded or sent, and the answer says so; events are recorded again from 00:00 UTC (retry the run with the same Idempotency-Key then to record and send them).
curlcurl
# The newest ten events, then the page after them.
curl "$PAYERWORKS_BASE_URL/v1/events?limit=10" -H "Authorization: Bearer $PAYERWORKS_API_KEY"
curl "$PAYERWORKS_BASE_URL/v1/events?limit=10&starting_after=$NEXT_CURSOR" -H "Authorization: Bearer $PAYERWORKS_API_KEY"

# Only one type, and one event by its id.
curl "$PAYERWORKS_BASE_URL/v1/events?type=sandbox.remittance.received" -H "Authorization: Bearer $PAYERWORKS_API_KEY"
curl "$PAYERWORKS_BASE_URL/v1/events/$EVENT_ID" -H "Authorization: Bearer $PAYERWORKS_API_KEY"

# Send it again to the address set now (202).
curl -X POST "$PAYERWORKS_BASE_URL/v1/events/$EVENT_ID/redeliver" -H "Authorization: Bearer $PAYERWORKS_API_KEY"

Your key’s rate, its calls by day and your webhook are in the console. Open the console.

Example

events.mjs runs every step below against the API with a test key. It needs payerworks.mjs and sample-data.mjs beside it.

events.mjsJavaScript
// Payerworks example: events, signed, listed and sent again. Docs: https://payerworks.com/docs/events
//
// Run it with Node 18 or later, with the JavaScript client (https://payerworks.com/sdk/payerworks.mjs)
// and sample-data.mjs beside this file:
//   PAYERWORKS_API_KEY=pw_test_... PAYERWORKS_BASE_URL=<the base URL shown with your key> node events.mjs
// A test key and invented data only. Payerworks sends nothing to a payer: every file it writes is yours.
import { pathToFileURL } from 'node:url';
import { Payerworks, PayerworksError, verifyStandardWebhook } from './payerworks.mjs';
import { SENDER_ID, claimEndingIn, refusalOf } from './sample-data.mjs';

/**
 * On YOUR server, for each delivery: check the signature over the raw body, before you parse it.
 * `secret` is the whsec_ secret PUT /v1/account/webhook answered once; `headers` the request's headers.
 * A delivery may arrive more than once: skip a webhook-id you have handled.
 * @param {string} secret @param {Record<string, string>} headers @param {string} rawBody
 */
export function readDelivery(secret, headers, rawBody, seen = new Set()) {
  if (!verifyStandardWebhook(secret, headers, rawBody)) return { ok: false, reason: 'signature' };
  const id = headers['webhook-id'];
  if (seen.has(id)) return { ok: true, duplicate: true };
  seen.add(id);
  return { ok: true, event: JSON.parse(rawBody) };
}

/** @param {Payerworks} pw */
export async function run(pw) {
  // 1. Your webhook: an https address of yours. The signing secret is shown once: store it.
  const hook = await pw.putAccountWebhook({ url: 'https://hooks.example.com/payerworks' });

  // 2. A sandbox run makes events: the 999, each claim's 277CA, and each check's 835.
  const sandbox = await pw.postSandboxClaims({ sender_id: SENDER_ID, claims: [claimEndingIn('')] });

  // 3. Every event is kept for 30 days: list them, read one, and send one again.
  const listed = await pw.getEvents({ query: { limit: 10 } });
  const one = await pw.getEventsById(listed.data[0].id);
  const again = await pw.postEventsByIdRedeliver(one.id);

  // 4. The failure path: an id this key never had.
  const refused = await refusalOf(() => pw.getEventsById(`evt_${'0'.repeat(24)}`), { PayerworksError });

  return {
    secret_starts: hook.secret.slice(0, 6),
    made: sandbox.events.map((e) => e.type),
    listed: listed.data.length,
    redelivered: Boolean(again),
    refused,
  };
}

// Run as a script: node <this file>, with PAYERWORKS_API_KEY and PAYERWORKS_BASE_URL set.
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
  console.log(JSON.stringify(await run(new Payerworks()), null, 2));
}
What it answered, run against the API in Payerworks’ own tests (your request ids will differ)JSON
{
  "secret_starts": "whsec_",
  "made": [
    "sandbox.file.acknowledged",
    "sandbox.claim.acknowledged",
    "sandbox.remittance.received"
  ],
  "listed": 3,
  "redelivered": true,
  "refused": {
    "status": 404,
    "code": "event_not_found",
    "request_id": "req_6"
  }
}

A free test key lets you try the API’s calls with invented data only. Payerworks sends nothing to any payer yet.

Get a test key

Questions? hello@payerworks.com