Skip to content
v1.0.0

Standard Product Supplier Integration (SPSI)

The SPSI is a combination of a subset of ezyVet's API and the product supplier's API that provides customers a consistent workflow experience.

Find more info on the SPSI framework here inlcuding UI examples.

Contact

Servers

https://apiv2.ezyvet.comezyVet Production Environment
https://apiv2.trial.ezyvet.comezyVet Trial Environment

Partner Authentication


Get an access token from the partner

POST
/accesstoken

This endpoint must be implemented by the Partner.

This endpoint will allow ezyVet to authenticate and use the Partner's web services

Request Body

application/json
JSON
{
"client_id": "partner-clinic",
"client_secret": "partner-secret",
"grant_type": "client_credentials"
}

Responses

Returns an access token.

application/json
JSON
{
"access_token": "CnKAVqSqp6UBq3Ei17e1UIj2U39UuOQI1i9Db3QT",
"token_type": "Bearer"
}

Samples

cURL
JavaScript
PHP
Python

Authentication


Fetch a JWT bearer token

POST
/oauth/token

Generates a valid access token, given client credentials. Access tokens have a
8-hour TTL. The only grant_type supported is client_credentials. Access
tokens must be submitted via Authorization: Bearer [token] header. You are
limited to one token per credential set. Requesting for a token will expire
the older one.

Use this endpoint when utilizing any endpoints under the apiv2 subdomain.

We strongly recommend that you build your application to expect token
expiry at any time. You can do this by adding an error handler for all your
requests in case they get an "expired token" error message.

Authorizations

bearerAuth
clientCredentials Flow
Token URL"https://apiv2.ezyvet.com/oauth/token"
Scopes:

Request Body

application/json
JSON
{
"partner_id": "string",
"client_id": "string",
"client_secret": "string",
"grant_type": "client_credentials",
"scope": "string",
"site_uid": "string"
}

Responses

A JSON object containing the access token details.

application/json
JSON
{
"access_token": "string",
"token_type": "string",
"expires_in": 0
}

Samples

cURL
JavaScript
PHP
Python

Separations


Fetch a Separation list

GET
/v2/separation

Fetches a list containing Separations.
Separations are a complex part of the ezyVet API and is important to understand.
Please read this document to ensure you have an adequate understanding.

Authorizations

bearerAuth
clientCredentials Flow
Token URL"https://apiv2.ezyvet.com/oauth/token"
Scopes:

Parameters

Query Parameters

id

The ID number used by the system to uniquely identify a Separation.

Typenumber
uid

The ID number used by the system to uniquely identify a Separation across all ezyVet sites.

Typestring
active

If true, the Separation is active and usable in ezyVet.

Typeboolean
created_at

The epoch time when the Separation was created.

Typenumber
modified_at

The epoch time when the Separation was last modified.

Typenumber

Responses

A list of separations

application/json
JSON
{
"meta": {
"timestamp": "string",
"items_page": "string",
"items_page_total": "string",
"items_page_size": "string",
"items_total": "string"
},
"items": [
{
"separation": {
"id": 0,
"uid": "string",
"created_at": 0,
"modified_at": 0,
"active": true,
"name": "string",
"type": "string",
"parent": 0,
"child": 0,
"separation_type": "string",
"contact_id": 0,
"contact_uid": "string"
}
}
],
"messages": [
{
}
]
}

Samples

cURL
JavaScript
PHP
Python

Job Queue


Creates a JobQueue job

POST
/v2/jobqueue

Creates a JobQueue job. A job will need to contain the parameters needed for a normal ReceiveInvoice API request to be processed.

Authorizations

bearerAuth
clientCredentials Flow
Token URL"https://apiv2.ezyvet.com/oauth/token"
Scopes:

Request Body

application/x-www-form-urlencoded
object

The endpoint type to hit.

The id of the record the JobQueue job is for.

Default0

The type of action to perform for the JobQueue job.

Default"ApiRequest"
object
Required

Responses

Successful response

application/json
JSON
{
"meta": {
"timestamp": 0
},
"items": [
{
"jobqueue": {
"id": 0,
"created_at": 0,
"modified_at": 0,
"active": true,
"type": "string",
"type_id": 0,
"action": "ApiRequest",
"status": "string",
"data": {
"method": "string",
"endpoint": "string",
"body": {
}
},
"error": "string"
}
}
],
"messages": [
"string"
]
}

Samples

cURL
JavaScript
PHP
Python

Receive Invoice


Create a Receive Invoice

POST
/v2/receiveinvoice

Creates a ReceiveInvoice and any included ReceiveInvoiceItems.

It's mandatory to encapsulate a receive invoice via the v2/jobqueue endpoint as it allows for invoices to require approval from a staff member.

Authorizations

bearerAuth
clientCredentials Flow
Token URL"https://apiv2.ezyvet.com/oauth/token"
Scopes:

Request Body

application/x-www-form-urlencoded
object
Default""
Default0
Default0
object[]

Responses

Successful response

application/json
JSON
{
"meta": {
"timestamp": "string"
},
"items": [
{
"receiveinvoice": {
"id": 0,
"created_at": 0,
"modified_at": 0,
"active": true,
"invoice_number": "string",
"date": 0,
"due_date": 0,
"supplier_id": 0,
"freight": 0,
"freight_tax": 4,
"rounding": 0,
"comments": "string",
"tax": 24,
"total": 234,
"ownership_id": 0,
"line_item": [
{
"id": 0,
"created_at": 0,
"modified_at": 0,
"active": true,
"quantity": 0,
"price": 0,
"tax": 0,
"total": 0,
"total_tax": 0,
"tax_rate": 0,
"tax_code": "string",
"product_id": 0,
"product_supplier_id": 0,
"supplier_code": "string",
"location_id": 0,
"batch": [
],
"purchase_order_item_id": 0
}
]
}
}
],
"messages": [
"string"
]
}

Samples

cURL
JavaScript
PHP
Python

Product Catagories


Get product categories from the partner

GET
/categories

This endpoint must be implemented by the partner.

This endpoint will allow ezyVet to gather a list of product categories from the partner and also perform product lookups.

Authorizations

bearerAuth
clientCredentials Flow
Token URL"https://apiv2.ezyvet.com/oauth/token"
Scopes:

Responses

OK

application/json
JSON
{
"categories": [
"consumable"
]
}

Samples

cURL
JavaScript
PHP
Python

Purchase Orders


Send a purchase order to the partner

POST
/purchaseorder

This endpoint must be implemented by the partner.

This endpoint will allow ezyVet to send purchase orders to the partner.

Authorizations

bearerAuth
clientCredentials Flow
Token URL"https://apiv2.ezyvet.com/oauth/token"
Scopes:

Request Body

application/json
JSON
{
"purchaseorder": {
"id": "12",
"active": "1",
"created_at": "1514493886",
"modified_at": "1514493886",
"date": "1514466000",
"shipping_address_id": "2",
"comments": "Some comments.",
"freight": "0",
"freight_tax": "0",
"tax": "0.4",
"total": "4.4",
"client_id": "2",
"supplier_id": "10006",
"status": "Approved",
"supplier_order_number": "",
"supplier_account_number": "",
"purchase_order_number": "15000032",
"ownership_id": "1",
"purchase_order_item_list": [
{
"id": "9",
"product_id": "50002",
"supplier_code": "TP1",
"outers": "1",
"units_per_outer": "1",
"price_per_unit": "4",
"tax_per_unit": "0.4",
"quantity": "1",
"total": "4",
"total_tax": "0.4",
"ownership_id": "3"
}
]
}
}

Responses

OK

application/json
JSON
{
"purchaseorder": {
"id": "12",
"active": "1",
"created_at": "1514493886",
"modified_at": "1514493886",
"date": "1514466000",
"shipping_address_id": "2",
"comments": "Some comments.",
"freight": "0",
"freight_tax": "0",
"tax": "0.4",
"total": "4.4",
"client_id": "2",
"supplier_id": "10006",
"status": "Approved",
"supplier_order_number": "",
"supplier_account_number": "",
"purchase_order_number": "15000032",
"ownership_id": "1",
"purchase_order_item_list": [
{
"id": "9",
"product_id": "50002",
"supplier_code": "TP1",
"outers": "1",
"units_per_outer": "1",
"price_per_unit": "4",
"tax_per_unit": "0.4",
"quantity": "1",
"total": "4",
"total_tax": "0.4",
"ownership_id": "3"
}
]
}
}

Samples

cURL
JavaScript
PHP
Python

Product Catalog

Operations


Get products from the partner

GET
/products

This endpoint must be implemented by the partner.

This endpoint will allow ezyVet to get products from the partner and also perform product lookups.

Authorizations

bearerAuth
clientCredentials Flow
Token URL"https://apiv2.ezyvet.com/oauth/token"
Scopes:

Parameters

Query Parameters

name

An array containing none, one or many product names. If values are provided, results should only include products with names that contain or match one or more of the values provided. An empty array means no filtering.

Typearray
Example"[2m-bandage,1m-bandage]"
code

An array containing none, one or many product codes. If values are provided, results should only include products with codes that contain or match one or more of the values provided. An empty array means no filtering.

Typearray
Example"[BND]"
category

An array containing none, one or many product categories. If values are provided, results should only include products with categories that contain or match one or more of the values provided. An empty array means no filtering.

Typearray
Example"[consumable]"
limit

An array containing ONLY one integer. The integer provided will be the maximum number of results to return. If an empty value, empty array is provided, or if the parameter is non-existent, then return with no limit.

Typearray
Example"[3]"
page

An array containing ONLY one integer. The integer provided will be the page number to return. E.g. If the limit was 5 and the total number of results was 40, then a page value of 3 would give us results between 15-19 inclusive.

NOTE: Page number starts at 0. So the first page of results will be for page 0.

Typearray
Example"[0]"

Responses

OK

application/json
JSON
{
"products": [
{
"active": 1,
"code": "BND",
"name": "2m-bandage",
"type": "medication",
"category": "consumable",
"units_per_outer": "1",
"unit_of_measure": "box",
"price_per_unit": "2",
"list_price": 2,
"contract_price": 1.5,
"barcode": 6587,
"stock_available": 20,
"related_urls": [
"https://example.com"
]
}
]
}

Samples

cURL
JavaScript
PHP
Python

Powered by VitePress OpenAPI