oauth

Authenticate with OAuth

Getting access to Procurify API involves the following three steps:

  1. Request credentials for your Procurify account.
  2. Request access token using your credentials.
  3. Use access token to access Procurify API resources.

Request credentials for your Procurify account.

The first step is to request credentials from Procurify. Your role must have access to manage integrations settings in order to request API credentials. You can request API credentials by going to go:

  1. Settings in the left navigation bar.
  2. Integrations in the Tools section.
  3. View button beside API item

This page will allow you to enter an optional description of the application you are developing with the Procurify API and once you are ready, click on “Create Application”. On the next screen, you will be presented with a Client ID and a Client Secret. You will need to copy and save these credentials securely. Please note that the Client Secret is only presented once.

Request access token using your credentials.

Once you have the client credentials, you will need to request an access token using these credentials that can be used as a bearer token when making a request to Procurify API. You will need the following information to request an access token:

Info Value
Token URL: https://<your-domain>.procurify.com/oauth/token
Client ID: From the previous step
Client Secret: From the previous step
Audience: https://api.procurify.com/
Grant Type: client_credentials

Once you have the access token, you will need to cache it until it expires (24 hrs). Please let Procurify support know if you would like help with this.

An example request and response using cURL (replace client id and client secret)

$ curl -H "content-type: application/json" -X POST \
    -d '{"client_id": "~your_client_id~", \
         "client_secret": "~your_client_secret~", \
         "audience": "https://api.procurify.com/", \
         "grant_type": "client_credentials"}' \
    https://<your-domain>.procurify.com/oauth/token

{"access_token": "~your-access-token~",
 "scope": "urn:procurify-api:domain:~your_domain~ urn:procurify-api:email:~your_email~",
 "expires_in": 86400,
 "token_type": "Bearer"}

Use access token to access Procurify API resources.

Once you have the access token, you can make requests to Procurify API resources. You will need to set the following headers when making the request.

Key Value
Authorization: Bearer access_token from previous step
X-Procurify-Client: api

An example request and response using cURL (replace access token and your procurify domain)

$ curl -H "Authorization: Bearer ~access_token~" \
    -H "X-Procurify-Client: api" \
    https://<your-domain>.procurify.com/api/v3/vendors/

    {"data":[{"id":1,"name":"OTHER","active":true,"addressLineOne":"OTHER"...}
Request
Request Body schema: application/json
client_id
string
client_secret
string
audience
string
grant_type
string
Responses
200

Successful authentication

Response Schema: application/json
access_token
string
scope
string
expires_in
number
token_type
string
Value: "Bearer"
post/oauth/token
Request samples
application/json
{
  • "client_id": "~your_client_id~",
  • "client_secret": "~your_client_secret~",
  • "grant_type": "client_credentials"
}
Response samples
application/json
{
  • "access_token": "~your-access-token~",
  • "scope": "urn:procurify-api:domain:~your_domain~ urn:procurify-api:email:~your_email~",
  • "expires_in": 86400,
  • "token_type": "Bearer"
}