Headers

Payable expects a set of headers to be present when making calls to our API. Below you will find a set of headers accepted by Payable. Whether they are required and if so when, along with a short description of the header's purpose.

HeaderRequired?Description
X-Api-KeyRequired for API to API integrationIf you are using API key authentication then the X-Api-Key header should be used.
BearerRequired if X-Api-Key is not providedIf you are using JWT authentication then the Bearer token header should be used. If this is supplied along with the X-Api-Key, then it takes precedence over the API key.
X-Request-IdNot requiredThis is an optimal id that identifies the request being made. It's very helpful when troubleshooting requests, and Payable will ask for this id when you ask us to look into an issue.
X-Idempotency-KeyFor any requests that modify dataThis is required to ensure we don't process duplicate requests in our system (either by mistake, or from retry logic). This is especially important for modifying resources, and therefore is mandatory on a POST request.
X-Api-VersionNot required (defaults to the latest available version)This header is used to target the request against a specific API version.
Content-TypeFor any requests where you send dataFor requests containing data, Payable expects a JSON format for the body. Therefore we recommend adding the content type header with a value of application/json when sending us data in a request.
AcceptNot requiredAt this time all records returned by the Payable API are in standard JSON format. Therefore it's not necessary to let us know that you support a specific media type. But it might help in troubleshooting when speaking with Payable about an issue.