Authentication
Every Partner API request is a JSON call to one of two servers, sent with your partner API key. Create your production key in the console; the key never leaves your servers.
Before you start
Partner accounts are opened by Prio. Your Prio contact sets yours up and gives you your partner ID.
Your console is your own Prio business account on heyprio.com, once Prio has linked it to your partnership. Its Keys tab issues your production key and holds your allowed websites and your webhook settings.
For the development server, ask your Prio contact for a development key.
Base URLs
| Server | Base URL | Key |
|---|---|---|
| production | https://server.heyprio.com | from your console |
| development | https://server-dev.heyprio.com | from your Prio contact |
The key header
Send the key in the x-partner-api-key header on every request. A missing header returns 401; a key Prio does not know, or a partner that is switched off, returns 403. A user who is not yours returns 404.
Responses
A success returns success: true, a message and the result. An error returns its HTTP status and a body carrying message, name, error and statusCode; the message names the first thing that failed.
| Status | Meaning | When |
|---|---|---|
| 200 | OK | a read, an update or a paid invoice |
| 201 | Created | a user, payment or request was made |
| 400 | Bad Request | a field is missing or invalid |
| 401 | Unauthorized | no x-partner-api-key header |
| 403 | Forbidden | unknown key, or partner switched off; on a money call, TERMS_NOT_ACCEPTED: the user has not accepted Prio's current terms, and nothing moved |
| 404 | Not Found | the user or invoice is not yours |
| 409 | Conflict | the email or phone is taken |
| 409 | Conflict | on Pay an invoice, INVOICE_AMOUNT_CHANGED: the amount owed changed, and nothing was charged |
| 409 | Conflict | on Pay an invoice, INVOICE_NO_LONGER_OWED: the invoice is no longer owed, and nothing was charged |
| 409 | Conflict | on Pay an invoice, INVOICE_CHECK_UNAVAILABLE: Prio could not confirm the amount owed, and nothing was charged |
| 422 | Unprocessable | Prio could not send the payment |
| 422 | Unprocessable | on Pay an invoice, this user is not the invoice’s payer |
| 500 | Server Error | Prio could not complete the request |
Formats
Money is a JSON number in US dollars. An invoice's createdAt and updatedAt carry up to six fractional digits and an offset (+00:00); dates such as dueOn are YYYY-MM-DD.
An error body carries message, name, statusCode, timestamp (RFC 3339 in UTC, to the second) and path, plus error, the error's code, when it has one, and details when there are any. It carries no success field.
Sandbox
The development server, https://server-dev.heyprio.com, takes a separate development key that Prio issues on request, and its data is not production’s. The key your console issues works only on https://server.heyprio.com. Environments and testing has both hosts and a full test run.
If your key leaks, replace it in your console at once; see Support and leaving.