Callbacks

Event callbacks can be set up to make HTTP Post requests to an endpoint when certain events occur on the account. The content of the event is stored in the payload of a JWT, and signed with your API credentials.

Currently, the following events trigger callbacks:

  1. Creation of a new invoice

    • Event name: "new-invoice"
    • Event attributes:
      • Invoice ID
      • Company ID
      • Company Name
  2. New document uploaded

    • Event name: "new-document"
    • Event attributes:
      • Document ID
      • Company ID
      • Company Name

Object Properties

NameTypeDescription
idUUIDUnique identifier for record
created_atDateTimeDatetime of creation
urlStringEndpoint the callback will make requests to

GET /callbacks

Returns a list of all callbacks

Response

{
	"success": true,
	"timestamp": "2018-06-11 06:37:27 -0700",
	"result": [
        {
            "id": "d1414c2f-6dcb-4b90-bc80-dd955ffdefb6",
            "created_at": "2018-06-07 13:12:01 -0700",
            "url": "https://www.example.com/callback-route"
        },
        {
            "id": "9c0e696b-a9d4-4648-a3ae-c15399149af3",
            "created_at": "2018-06-07 13:11:40 -0700",
            "url": "https://www.example.com/callback-route2"
        },
        ...
  ]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

POST /callbacks

Parameters

NameTypeRequiredDescription
urlStringURL of endpoint to which requests are made

Example request body

{
	"success": true,
	"timestamp": "2018-06-11 06:37:27 -0700",
	"result": {
        "id": "d1414c2f-6dcb-4b90-bc80-dd955ffdefb6",
        "created_at": "2018-06-07 13:12:01 -0700",
        "url": "https://www.example.com/callback-route"
    }
}
1
2
3
4
5
6
7
8
9

DELETE /callbacks/:id

Deletes the callback with the specified id.

Parameters

NameTypeRequiredDescription
idUUIDID of callback to be deleted