API

Authentication

Every Partner API request is a JSON call to one of two servers, signed with your partner API key. Create your production key in the console; the key never leaves your servers.

Base URLs

Server Base URL Key
production https://server.heyprio.com from your console
development https://server-dev.heyprio.com from Prio, on request

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.

Request
curl https://server.heyprio.com/api/partner/users/8f2c1d4e-6b7a-4c3d-9e1f-2a3b4c5d6e7f \
  -H "x-partner-api-key: $PRIO_PARTNER_KEY"

Responses

A success returns success: true, a message and the result. An error returns its HTTP status and a message naming 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
404 Not Found the user or invoice is not yours
409 Conflict the email or phone is taken
422 Unprocessable Prio could not send the payment

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.

Node.js example

Node.js
const response = await fetch("https://server.heyprio.com/api/partner/users", {
  method: "POST",
  headers: {
    "content-type": "application/json",
    "x-partner-api-key": process.env.PRIO_PARTNER_KEY,
  },
  body: JSON.stringify({
    email: "[email protected]",
    phone: "+15125550142",
    isIndividual: true,
    firstName: "Maya",
    lastName: "Ortiz",
    website: "https://clearpath.example",
    defaultRole: "vendor",
  }),
});
const { result } = await response.json();

Prio may display inaccurate info at times, please double check the responses.