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://api.ezyvet.comezyVet Production Environment
https://api.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​


Authentication​


Fetch a JWT bearer token​

POST
/v1/oauth/access_token

Generates a valid access token, given client credentials. Access tokens have an 12-hour TTL.

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​


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://api.ezyvet.com/v1/oauth/access_token"
Scopes:
  • "read-separation"Read separation resources

Parameters​

Query Parameters

id

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

Type
number
uid

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

Type
string
active

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

Type
boolean
created_at

The epoch time when the Separation was created.

Type
number
modified_at

The epoch time when the Separation was last modified.

Type
number

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​


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://api.ezyvet.com/v1/oauth/access_token"
Scopes:
  • "write-jobqueue"Create and update job queue resources

Request Body​

application/json
JSON
{
  
"type": "ReceiveInvoice",
  
"type_id": 3,
  
"action": "ApiRequest",
  
"data": {
  
  
"method": "POST",
  
  
"endpoint": "api/v2/receiveinvoice",
  
  
"body": {
  
  
  
"invoice_number": "string",
  
  
  
"date": 0,
  
  
  
"due_date": 0,
  
  
  
"comments": "",
  
  
  
"freight": 0,
  
  
  
"freight_tax": 0,
  
  
  
"ownership_id": 0,
  
  
  
"line_item": [
  
  
  
  
{
  
  
  
  
  
"purchase_order_item_id": 26,
  
  
  
  
  
"supplier_code": "Droid",
  
  
  
  
  
"quantity": "1",
  
  
  
  
  
"price": "50",
  
  
  
  
  
"tax": "0.10",
  
  
  
  
  
"total": "50",
  
  
  
  
  
"total_tax": "0.10",
  
  
  
  
  
"location_id": 3
  
  
  
  
}
  
  
  
]
  
  
}
  
}
}

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​


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://api.ezyvet.com/v1/oauth/access_token"
Scopes:
  • "read-receiveinvoice"Read receive invoice resources
  • "write-receiveinvoice"Create, update and delete receive invoice resources

Request Body​

application/json
JSON
{
  
"invoice_number": "string",
  
"date": 0,
  
"due_date": 0,
  
"comments": "",
  
"freight": 0,
  
"freight_tax": 0,
  
"ownership_id": 0,
  
"line_item": [
  
  
{
  
  
  
"purchase_order_item_id": 26,
  
  
  
"supplier_code": "Droid",
  
  
  
"quantity": "1",
  
  
  
"price": "50",
  
  
  
"tax": "0.10",
  
  
  
"total": "50",
  
  
  
"total_tax": "0.10",
  
  
  
"location_id": 3
  
  
}
  
]
}

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​


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.

Responses​

OK

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

Samples​


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.

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
{
}

Samples​


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.

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.

Type
array
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.

Type
array
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.

Type
array
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.

Type
array
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.

Type
array
Example[0]

Responses​

OK

application/json
JSON
{
  
"products": [
  
  
{
  
  
  
"active": 1,
  
  
  
"code": "BND",
  
  
  
"name": "2m-bandage",
  
  
  
"type": "standard",
  
  
  
"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​


Powered by VitePress OpenAPI