Agencies

Agency-related webhooks are emitted by the Accounts API when agency or credit-limit configuration changes. Network agency events (agency.created, agency.updated) are emitted when agencies in the provider's network are created or updated. The credit limit event is emitted when a provider updates an agency's credit limit via PUT /accounts/agencies/:agencyId/credit-limit.

Events

Action Event name
creating a network agency agency.created
updating a network agency agency.updated
updating an agency credit limit (PUT /accounts/agencies/:agencyId/credit-limit) creditlimit.updated

Payload example

{
  "id": "string",
  "attemptId": "string",
  "livemode": "boolean",
  "created": "int",
  "event": "string",
  "data": {
    "_id": "string",
    "accountId": "string",
    "agencyId": "string",
    "defaultMenu": "string",
    "display": "string",
    "domain": "string",
    "email": "string",
    "firstName": "string",
    "language": "string",
    "lastName": "string",
    "preferredLocationId": "string",
    "preferredStationId": "string",
    "rootDomain": "string",
    "scannerKey": "string",
    "deleted": "boolean",
    "createdAt": {
      "value": "string",
      "offset": "int"
    },
    "updatedAt": {
      "value": "string",
      "offset": "int"
    }
  }
}

creditlimit.updated payload

Emitted when a provider updates an agency's credit limit. The payload is the object passed to the webhook emitter: providerId (account ID of the provider), apiKey (value of the request X-API-KEY header), and data (the updated credit limit document as returned by the API).

{
  "providerId": "string",
  "apiKey": "string",
  "data": {
    "_id": "string",
    "sellerId": "string",
    "providerId": "string",
    "unlimited": "boolean",
    "overrideLimit": "number",
    "currentLimit": "number"
  }
}
Field Type Description
providerId string Account ID of the provider that owns the credit limit.
apiKey string The X-API-KEY header value from the request that triggered the update.
data object The updated credit limit.
data._id string MongoDB ObjectId of the credit limit record.
data.sellerId string Agency (seller) ID this credit limit applies to.
data.providerId string Provider (account) ID that owns this configuration.
data.unlimited boolean Whether the credit limit is unlimited.
data.overrideLimit number Credit limit amount (override value) in account currency.
data.currentLimit number Current credit limit amount in account currency.