OptiPar API

Overview

The OptiPar API is organized around REST. It uses standard HTTP response codes, accepts form-encoded request bodies, and returns JSON-encoded responses.

Authentication

All API requests require a valid API Key. The OptiPar API uses HTTP Basic Auth. Provide your API Key as the basic auth username value in the request Authentication header (You don’t need to provide a password). Your API Key can be found under the “Seller Info” tab here: https://seller.optipar.com/seller/. You can also generate a new API Key here (Note this will make your current API Key invalid).

To authenticate to the OptiPar API you must provide your API Key in the Basic Authorization header of your HTTP request. All API requests must be made over HTTPS. Calls made over HTTP will fail and API requests without authentication will also fail.

curl https://seller.optipar.com/api/inventory/medical/add \

-u <API_KEY>:

# The colon prevents curl from asking for a password.

# Replace <API_KEY> with your API Key

Status Codes

The OptiPar API utilizes the following HTTP Status Codes in its responses.

Status Code Description
200 OK
400 Bad Request
401 Unauthorized
404 Not Found
500 Internal Server Error

Errors

The OptiPar API returns errors in this format along with the corresponding HTTP Status Code.

{

“error” : string,

“error_description” : string

}

# error = short code of error(s) that occurred

# error description = details of error(s) that occurred

API Endpoints

Get Inventory

Request Method Endpoint
GET https://seller.optipar.com/api/inventory/medical/

Returns a list of your inventory.

Parameter Required Data Type Details
created_before Optional Integer Unix Timestamp. Returns inventory created before this date.
created_after Optional Integer Unix Timestamp. Returns inventory created after this date.
limit Optional Integer Limit number of inventory returned. Max of 1,000, default is 100.
starting_after Optional Integer Id of inventory to start pulling inventory after. Used for pagination.
include_images Optional Integer Set to 1 to include the URL and info of each inventory item image in the results. Otherwise, images are excluded from the results. Images are excluded by default.

Example:

curl https://seller.optipar.com/api/inventory/medical/ \

-u <API_KEY>: \

-d limit=10 \

-G

Get Inventory Item

Request Method Endpoint
GET https://seller.optipar.com/api/inventory/medical/?id=:id

Returns a specific inventory item.

Parameter Required Data Type Details
id Required Integer Id of inventory item to return.
Include_images Optional Integer Set to 1 to include the URL and info of each image for the inventory item in the results. Otherwise, images are excluded from the results. Images are excluded by default.

Example:

curl https://seller.optipar.com/api/inventory/medical/ \

-u <API_KEY>: \

-d id=10 \

-G

Create Inventory Item

Request Method Endpoint
POST https://seller.optipar.com/api/inventory/medical/create/

Creates a new inventory item and returns the created inventory item.

Parameter Required Data Type Details
payload Required String Inventory Item in JSON format to be created.

Payload Options (Data in JSON format to be sent via the payload parameter)

Parameter Required Data Type Details
item_number Required String Item identifier.
name Required String Name of the item.
description Required String Description of the item.
size Optional String Size of the item.
lot_number Optional Integer Lot number of the item.
expiration Required String Expiration date in mm/dd/yyy format.
weight Optional Integer Weight of item.
unit Optional String Each, Case, Box, or Pack. Defaults to Each.
cost Required String Cost of item to seller.
sales_price Required String List price of item for sale.
quantity_available Required Integer # of this item in inventory.
sellable Required Integer # of this item that are for sale.
shipping_time Optional String Standard Ground, One Day, Two Day, Two week, or One Month. Defaults to Standard Ground.
condition Optional String New or Used. Defaults to New.
manufacturer Required String Name of item manufacturer.
category Required String Name of item category.
image_url Optional String Web accessible URL.

Example:

curl https://seller.optipar.com/api/inventory/medical/create/ \

-u <API_KEY>: \

-d “payload”=’{“item_number”:”item_number_test”,”name”:”Test Item”,”description”:”This is a test item.”,”size”:”Large”,”lot_number”:”12345″,”expiration”:”12\/12\/2025″,”weight”:”100″,”unit”:”Each”,”cost”:”10.00″,”sales_price”:”200.00″,”quantity_available”:”50″,”sellable”:”40″,”shipping_time”:”Standard Ground”,”condition”:”New”,”manufacturer”:”Test Manufacturer Co.”,”category”:”Test Category”,”image_url”:”https:\/\/i.picsum.photos\/id\/866\/536\/354.jpg?hmac=tGofDTV7tl2rprappPzKFiZ9vDh5MKj39oa2D–gqhA”}’

Update Inventory Item

Request Method Endpoint
POST https://seller.optipar.com/api/inventory/medical/update/

Updates an inventory item and returns the updated inventory item.

Parameter Required Data Type Details
payload Required String Inventory Item in JSON format to be updated.

Payload Options (Data in JSON format to be sent via the payload parameter)

Parameter Required Data Type Details
Id Required Integer Id of the inventory item to update.
item_number Optional String Item identifier.
name Optional String Name of the item.
description Optional String Description of the item.
size Optional String Size of the item.
lot_number Optional Integer Lot number of the item.
expiration Optional String Expiration date in mm/dd/yyy format.
weight Optional Integer Weight of item.
unit Optional String Each, Case, Box, or Pack.
cost Optional String Cost of item to seller.
sales_price Optional String List price of item for sale.
quantity_available Optional Integer # of this item in inventory.
sellable Optional Integer # of this item that are for sale.
shipping_time Optional String Standard Ground, One Day, Two Day, Two week, or One Month.
condition Optional String New or Used.
manufacturer Optional String Name of item manufacturer.
category Optional String Name of item category.

Example:

curl https://seller.optipar.com/api/inventory/medical/update/ \

-u <API_KEY>: \

-d “payload”=’{“id”:”3”,”item_number”:”item_number_test”,”name”:”Test Item”,”description”:”This is a test item.”,”size”:”Large”,”lot_number”:”12345″,”expiration”:”12\/12\/2025″,”weight”:”100″,”unit”:”Each”,”cost”:”10.00″,”sales_price”:”200.00″,”quantity_available”:”50″,”sellable”:”40″,”shipping_time”:”Standard Ground”,”condition”:”New”,”manufacturer”:”Test Manufacturer Co.”,”category”:”Test Category”}’

Delete Inventory Item

Request Method Endpoint
DELETE https://seller.optipar.com/api/inventory/medical/delete?id=:id

Deletes a specific inventory item.

Parameter Required Data Type Details
id Required Integer Id of inventory item to delete.

Example:

curl https://seller.optipar.com/api/inventory/medical/delete/ \

-u <API_KEY>: \

-d id=10 \

-X DELETE

Create Inventory Item Image

Request Method Endpoint
POST https://seller.optipar.com/api/inventory/medical/images/create/

Creates a new inventory item image and returns the inventory item the image was added to.

Parameter Required Data Type Details
Id Required Integer Id of the inventory item to add the image to.
image_url Required String Web accessible URL.

Example:

curl https://seller.optipar.com/api/inventory/medical/images/create/ \

-u <API_KEY>: \

-d “id=3&image_url= https:\/\/i.picsum.photos\/id\/866\/536\/354.jpg?hmac=tGofDTV7tl2rprappPzKFiZ9vDh5MKj39oa2D—gqhA”

Delete Inventory Item Image

Request Method Endpoint
DELETE https://seller.optipar.com/api/inventory/medical/images/delete?id=:id

Deletes a specific inventory item image.

Parameter Required Data Type Details
id Required Integer Id of inventory item image to delete.

Example:

curl https://seller.optipar.com/api/inventory/medical/images/delete/ \

-u <API_KEY>: \

-d id=10 \

-X DELETE

Top