Lunch
Lunch Partner API

Receive event notifications.


List webhook subscriptions

GET
https://api.lunchpayments.com
/v1/webhooks

Returns active subscriptions. Secrets are not included.

List webhook subscriptions › Responses

Active subscriptions.

​object[] · required

Create a webhook subscription

POST
https://api.lunchpayments.com
/v1/webhooks

Registers an endpoint to receive events.

  • Signature: Lunch-Signature: t=<unix seconds>,v1=<hex>. HMAC-SHA256 of "<timestamp>.<raw body>", keyed with the subscription secret. Compare in constant time.
  • Freshness: reject timestamps older than 5 minutes.
  • Duplicates: delivery is at-least-once. Deduplicate on Lunch-Delivery, which is constant across retries.
  • Ordering: not guaranteed. For partner.invoice.factoredUpdated, ignore events whose sequence is not greater than the last one processed for that invoice. Do not order by occurredAt.
  • Responses: return 2xx to acknowledge. Other responses are retried for about 28 hours. Return 410 to revoke the subscription.

Create a webhook subscription › Request Body

url
​string · uri · required

Public https URL. Private, loopback and link-local addresses are rejected. Redirects are not followed.

eventTypes
​string[] · maxItems: 9

Events to receive. Empty receives all events, including future ones.

Enum values:
partner.organization.added
partner.invoice.created
partner.invoice.paid
partner.invoice.factoredUpdated
partner.loan.created
partner.loan.issued
partner.loan.paid
partner.organization.remittanceUpdated

Create a webhook subscription › Responses

Subscription created. The secret is returned only in this response.

reference
​string · required

Subscription identifier. Use with DELETE /v1/webhooks/{reference}.

url
​string · required
eventTypes
​string[] · maxItems: 9 · required

Events to receive. Empty receives all events, including future ones.

Enum values:
partner.organization.added
partner.invoice.created
partner.invoice.paid
partner.invoice.factoredUpdated
partner.loan.created
partner.loan.issued
partner.loan.paid
partner.organization.remittanceUpdated
createdAt
​string · date-time · required
secret
​string · required

Signing secret. Cannot be retrieved later. To rotate, delete this subscription and create a new one.


Delete a webhook subscription

DELETE
https://api.lunchpayments.com
/v1/webhooks/{reference}

Revokes a subscription. Deliveries already in progress may still arrive. Continue verifying signatures.

Delete a webhook subscription › path Parameters

reference
​string · minLength: 1 · required

Delete a webhook subscription › Responses

Subscription revoked. Deliveries already in progress may still arrive.

revoked
​boolean · enum · required
Enum values: