Getting access to Procurify API involves the following three steps:
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:
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.
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"}
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"...}
{- "client_id": "~your_client_id~",
- "client_secret": "~your_client_secret~",
- "grant_type": "client_credentials"
}
{- "access_token": "~your-access-token~",
- "scope": "urn:procurify-api:domain:~your_domain~ urn:procurify-api:email:~your_email~",
- "expires_in": 86400,
- "token_type": "Bearer"
}