Authorization

User Authorization Over API

To keep a reference to the actor performing an action over API, we require additional data to be sent in modification requests like POST requests and some GET requests to verify they have access to certain information. This allows us to display which users in your systems are performing actions in PayKeeper.

There are two options for sending us the user performing an action:

  1. Recommended: Adding user fields to custom headers - can be used on all requests
  2. Adding a ref object to the request body for requests that support a body - can only be used in requests with a body like POST or PATCH

*The integrity of this information is only as good as the data provided by your systems.

User Headers

x-user-email-address: Email address of the logged in user
x-user-first-name: First name of the logged in user
x-user-last-name: Last name of the logged in user

Ref Object

First Name: The first name of the logged in user in the system that is calling PayKeeper
Last Name: The last name of the logged in user in the system that is calling PayKeeper
Email Address: The email address of the logged in user in the system that is calling PayKeeper

"ref": {
  "firstName": "John",
  "lastName": "Salesrep",
  "emailAddress": "[email protected]"
  ...there are other fields that can be put in requests, those are documented on the calls themselves
}

External ID: An Identifier from non-PayKeeper systems is required in order to reference projects across systems.
First Name: The first name of the logged in user in the system that is calling PayKeeper
Last Name: The last name of the logged in user in the system that is calling PayKeeper
Email Address: The email address of the logged in user in the system that is calling PayKeeper

"ref": {
  "externalId": "external_project_id_1",
  "firstName": "John",
  "lastName": "Salesrep",
  "emailAddress": "[email protected]"
}