Skip to content

Create webhook subscription

Request

Creates a new webhook subscription.

Security
oauth2(Required scopes: webhook.subscription:create) or bearerAuth or apiKeyHeader
Bodyapplication/jsonrequired
eventTypesArray of strings(eventTypesPublic)

The list of events for which the caller will receive webhooks. For any proxy webhookType, this field should be left empty, and we will automatically send the events associated with that specific proxy.

Items Enum:"autopay.schedule.cancel""autopay.schedule.changed""autopay.schedule.created""autopay.payment.canceled""autopay.payment.rescheduled""card.created""card.replacement.requested""card.status.changed""case.association.added""case.association.removed"
webhookTypestringrequired

Peach supports two ways of receiving webhooks:

  • direct - events will be provided directly to the url nominated by the lender, and the event data will match Peach's data format.
  • proxyGalileo - events will trigger Peach to make specific API calls to Galileo, so Galileo's sub-ledger remains in sync with Peach's ledger.

Note: when setting webhookType as proxyGalileo, please work with the Peach team to ensure the API calls you require are configured.

Enum:"direct""proxyGalileo"
enabledboolean

If true events will be sent to this webhook, if false no events will be sent to it.

Default:true
hydrateDataboolean

Indicates the amount of information the receiver of webhooks will get. Only applicable if webhookType=direct.

  • false - Peach will provide a minimum amount of data. For example: event identifier, event name, timestamp and identifier(s) of associated object(s) (e.g. loan ID, borrower ID, transaction ID, etc.)
  • true - in addition to the data provided in the false option, Peach will provide full details of the object(s) associated with the event.

Currently we support hydrating the following objects:

  • borrower
  • loan
  • transaction
  • case
Default:false
webhookDirectDetailsobject(WebhookDirectDetails)

The details required for Peach to pass the events via webhook. Required only if webhookType=direct.

webhookProxyDetailsobject(WebhookProxyDetails)

The details required for Peach to make an API call to the third party identified in the webhookType. Required only if webhookType=proxyXXX.

POST
/webhooks
curl -i -X POST \
  https://sandboxapi.peach.finance/api/webhooks \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "eventTypes": [
      "string"
    ],
    "webhookType": "direct",
    "enabled": true,
    "hydrateData": false,
    "webhookDirectDetails": {
      "webhookUrl": "string"
    },
    "webhookProxyDetails": {
      "galileoApiLogin": "string",
      "galileoApiTransKey": "string",
      "galileoBaseUrl": "string",
      "galileoProviderId": "string"
    }
  }'

Responses

Success

Bodyapplication/json
messagestring

Description of the server action or error.

statusinteger

HTTP status code.

dataobject(WebhookSubscription)
Response
{ "message": "string", "status": 0, "data": { "eventTypes": [], "webhookType": "direct", "createdAt": "2019-08-24T14:15:22Z", "deletedAt": "2019-08-24T14:15:22Z", "id": "string", "updatedAt": "2019-08-24T14:15:22Z", "companyId": "string", "enabled": true, "hmacSecretKey": "string", "hydrateData": false, "webhookDirectDetails": {}, "webhookProxyDetails": {} } }