Wherefour API (1.0.27)

Download OpenAPI specification:

API documentation for the Wherefour ERP/traceability platform. More information at: wherefour.com.

Rate limiting

API requests are limited to 1 request per second.

Requests over the limit receive an HTTP 429 Too Many Requests response with a plain-text body of Retry later. No Retry-After header is sent.

To stay within the limit:

  • Send requests sequentially rather than in parallel.
  • On a 429, wait at least one second before retrying, and back off further if 429s continue.

Categories

Inventory categories.

List categories

Returns a list of inventory categories, ordered by name.

Authorizations:
BasicAuth
query Parameters
page
integer

Results page to view

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    }
]

Facilities

Facilities and their addresses.

Search for facilities

Locates a facility by name

Authorizations:
BasicAuth
query Parameters
page
integer

Results page to view

name
string

Case-insensitive partial name search

locator_code
string

Case-insensitive partial locator code search

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Inventory

Inventory items and their stock lots.

List Inventory Items

Returns a paginated list of all inventory items.

Authorizations:
BasicAuth
query Parameters
updated_at
string

Oldest date/time for the records to return

page
integer

Results page to view

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create inventory item

Creates a new inventory item with the provided parameters.

Authorizations:
BasicAuth
Request Body schema: application/json
name
string
category_id
number
unit_of_use
string
unit_of_purchase
string
unit_of_order
string
unit_of_invoice
string
unit_of_pick_and_ship
string
unit_of_weight
string or null
unit_of_dimension
string or null
purchase_conversion
number
property
string
Enum: "raw_material" "overhead" "work_in_progress" "finished_good"
sku
string or null
upc
string or null
pull_strategy
string
Enum: "FIFO" "Hand Pick" "FEFO" "LIFO"
reorder_point
number
rate
number
lead_time
number
retired
boolean
waste_percentage
number
quantity_not_tracked
boolean
standard_cost
number
weight
number or null
height
number or null
width
number or null
length
number or null

Responses

Request samples

Content type
application/json
{
  • "name": "Whole milk",
  • "category_id": 1,
  • "unit_of_use": "gallon",
  • "unit_of_purchase": "gallon",
  • "unit_of_order": "gallon",
  • "unit_of_invoice": "gallon",
  • "unit_of_pick_and_ship": "gallon",
  • "unit_of_weight": null,
  • "unit_of_dimension": null,
  • "purchase_conversion": 1,
  • "property": "raw_material",
  • "sku": null,
  • "upc": null,
  • "pull_strategy": "FIFO",
  • "reorder_point": 50,
  • "lead_time": 1,
  • "retired": false,
  • "waste_percentage": 0,
  • "quantity_not_tracked": false,
  • "standard_cost": 0,
  • "weight": null,
  • "height": null,
  • "width": null,
  • "length": null
}

Response samples

Content type
{
  • "id": 0,
  • "name": "string",
  • "category_name": "string",
  • "on_hand": "string",
  • "unit_of_use": "string",
  • "unit_of_purchase": "string",
  • "unit_of_order": "string",
  • "unit_of_invoice": "string",
  • "unit_of_pick_and_ship": "string",
  • "unit_of_weight": "string",
  • "unit_of_dimension": "string",
  • "purchase_conversion": "string",
  • "property": "string",
  • "sku": "string",
  • "upc": "string",
  • "pull_strategy": "string",
  • "reorder_point": "string",
  • "lead_time": 0,
  • "retired": true,
  • "waste_percentage": "string",
  • "quantity_not_tracked": true,
  • "conversions": [
    ],
  • "weight": 0,
  • "height": "string",
  • "width": "string",
  • "length": "string",
  • "created_at": "string",
  • "updated_at": "string",
  • "custom_field_values": [
    ],
  • "internal_photo_is_public": true,
  • "internal_description": "string",
  • "internal_description_is_public": true,
  • "public_name": "string",
  • "public_description": "string",
  • "show_hold_amounts": true,
  • "internal_name_is_public": true,
  • "receive_default_delivery_method_id": null,
  • "receive_default_location_id": null,
  • "receive_default_accept_rows": 0,
  • "receive_default_to_total_cost": true,
  • "receive_default_stock_status": "string",
  • "receive_require_barcode": true,
  • "receive_require_serial_number": true,
  • "receive_require_location": true,
  • "receive_require_expiration_date": true,
  • "receive_prefill_expiration_date": true,
  • "receive_expiration_date_days": 0,
  • "receive_allow_unit_of_receiving_change": true,
  • "receive_keep_quantity": true,
  • "receive_keep_unit_of_receiving": true,
  • "receive_keep_cost": true,
  • "receive_keep_vendor_item_number": true,
  • "receive_keep_location": true,
  • "receive_keep_expiration_date": true,
  • "receive_keep_stock_description": true,
  • "receive_allow_custom_field_entry": true
}

Add stock lot

Adds a new stock lot to the specified inventory item.

Authorizations:
BasicAuth
path Parameters
inventory_id
required
integer

inventory item record ID

Request Body schema: application/json
delivery_method_id
required
integer
location_id
integer
vendor_id
integer
vendor_reference
string
vendor_item_number
string
count
required
number
cost
required
number
cost_entered_is_total_cost
boolean

True when cost is the total for the lot rather than the cost per unit

lot_code
required
string

Required unless generate_lot_code is true

barcode
string
serial_number
string
generate_lot_code
boolean

Generates the lot code, when automatic sequencing is on for the account

generate_barcode
boolean

Generates the barcode, when automatic sequencing is on for the account

generate_serial_number
boolean

Generates the serial number, when automatic sequencing is on for the account

expiration_date
string
received_date
string

Date and time received, in the API user's date and time style

stock_description
string
status
required
string
Enum: "active" "inactive" "on_hold" "quarantined"

The new stock's status

Responses

Request samples

Content type
application/json
{
  • "delivery_method_id": 1,
  • "location_id": 1,
  • "vendor_id": 1,
  • "lot_code": "1234",
  • "stock_description": "New stock",
  • "count": 100,
  • "cost": 100,
  • "cost_entered_is_total_cost": true,
  • "status": "active",
  • "expiration_date": "11/05/25",
  • "received_date": "11/05/2024 02:39 PM"
}

Response samples

Content type
application/json
{
  • "id": 35,
  • "user_id": 6,
  • "inventory_id": 4,
  • "location_id": 1,
  • "lot_code": "1234",
  • "status": "active",
  • "barcode": null,
  • "details": "New stock",
  • "note": "",
  • "count": "100.0",
  • "cost": "100.0",
  • "vendor_id": 1,
  • "expiration_date": "2025-11-05",
  • "created_at": "2024-11-05T17:42:31.000Z",
  • "updated_at": "2024-11-05T17:42:31.000Z",
  • "base_count": "100.0",
  • "rate": null,
  • "purchase_id": null,
  • "global_identifier": "18c63c87-fcac-40d3-b334-22ef41c85cf5",
  • "organization_id": 1,
  • "expiration_notified_at": null,
  • "weight": null,
  • "height": null,
  • "width": null,
  • "length": null,
  • "serial_number": null,
  • "generate_barcode": false,
  • "generate_lot_code": false,
  • "generate_serial_number": false,
  • "custom_field_values": [ ]
}

List stock lots

Lists active stocks of the provided inventory item.

Authorizations:
BasicAuth
path Parameters
inventory_id
required
integer

inventory item record ID

query Parameters
location_name
string

The name of the location to filter stock lots by

location_locator_code
string

The locator code of the location to filter stock lots by

page
string

Results page to view

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    },
  • {
    }
]

Get last stock lot change

Gets the last stock lot change for the specified inventory item.

Authorizations:
BasicAuth
query Parameters
inventory_id
integer

Optional inventory ID to get the most recent stock lot change for

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Search for inventory item

Returns inventory items that match the given name or SKU. Multiple matches may be returned.

Authorizations:
BasicAuth
query Parameters
page
integer

Results page to view

Request Body schema: application/json

Search can be performed based on EITHER the inventory item name, OR a single SKU or an array of SKUs. The inventory item name will take precedence over the SKU parameter. Multiple matches may be returned.

name
string

Part of the inventory item's name

string or Array of strings

One SKU, or an array of SKUs

location_id
integer

Responses

Request samples

Content type
application/json
Example
{
  • "name": "Product Name Here"
}

Response samples

Content type
application/json
[
  • {
    }
]

Invoices

Customer invoices.

List customer invoices

Lists invoices for a customer

Authorizations:
BasicAuth
path Parameters
customer_id
required
integer

customer record ID

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create Invoice

Creates a new invoice for the customer.

Authorizations:
BasicAuth
path Parameters
customer_id
required
integer

customer record ID

Request Body schema: application/json
invoice_number
required
string

Not generated automatically, so send the number you want on the invoice

invoice_date
required
string
status
required
string
Enum: "draft" "open" "paid" "canceled" "archived"
payment_term_id
integer or null
delivery_method_id
integer
sales_channel_id
integer
salesperson_id
integer or null
quote_id
integer
instructions
string or null
tax
number
shipping
number
discount
number
price_tier_ids
Array of integers
required
Array of objects
Array of objects (custom_line_items)

Responses

Request samples

Content type
application/json
{
  • "invoice_number": "INV100",
  • "invoice_date": "2020-09-04",
  • "payment_term_id": null,
  • "status": "open",
  • "salesperson_id": null,
  • "delivery_method_id": 1,
  • "instructions": null,
  • "discount": 0,
  • "tax": 0,
  • "shipping": 0,
  • "invoice_items_attributes": [
    ],
  • "custom_line_items_attributes": [
    ]
}

Response samples

Content type
application/json
[
  • {
    }
]

Update invoice

Updates an existing invoice

Authorizations:
BasicAuth
path Parameters
invoice_id
required
integer

invoice record ID

customer_id
required
integer

customer record ID

Request Body schema: application/json
invoice_number
string
invoice_date
string
status
string
Enum: "draft" "open" "paid" "canceled" "archived"
payment_term_id
integer or null
delivery_method_id
integer
sales_channel_id
integer
salesperson_id
integer or null
quote_id
integer
instructions
string or null
invoiced
boolean
tax
number
shipping
number
discount
number
price_tier_ids
Array of integers
Array of objects
Array of objects (custom_line_items-2)

Responses

Request samples

Content type
application/json
{
  • "invoice_number": "INV100",
  • "invoice_date": "2020-09-04",
  • "payment_term_id": null,
  • "status": "open",
  • "salesperson_id": null,
  • "delivery_method_id": 1,
  • "instructions": null,
  • "discount": 0,
  • "tax": 0,
  • "shipping": 0,
  • "invoice_items_attributes": [
    ],
  • "custom_line_items_attributes": [
    ]
}

Response samples

Content type
application/json
[
  • {
    }
]

List Invoices

Returns a paginated list of all invoices.

Authorizations:
BasicAuth
query Parameters
updated_at
string

Oldest date/time for the records returned

page
integer

Results page to view

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get Invoice

Retrieves a invoice record by ID

Authorizations:
BasicAuth
path Parameters
invoice_id
required
integer
Example: 1

ID for the invoice record

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Search for invoice

Locates an invoice by the invoice_number

Authorizations:
BasicAuth
query Parameters
invoice_number
string non-empty
Example: invoice_number={ "invoice_number": "INV1" }

The invoice number in Wherefour to locate. All invoices with matching results will be returned.

page
integer

Results page to view

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "invoice_number": "INV1"
}

Response samples

Content type
application/json
[
  • {
    }
]

Locations

Storage locations within facilities.

Search for locations

Locates a location by name

Authorizations:
BasicAuth
query Parameters
page
integer

Results page to view

name
string

Case-insensitive partial name search

locator_code
string

Case-insensitive partial locator code search

facility_id
integer

Filter locations to this facility

parent_location_id
integer

Filter locations to this parent location

level_number
integer

Filter locations to this level number

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Get Location

Retrieves a location record by ID

Authorizations:
BasicAuth
path Parameters
location_id
required
integer
Example: 1

ID for the location record

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Orders

Customer orders, and shipping them.

List orders for a customer

Returns all the orders for the customer ID provided.

Authorizations:
BasicAuth
path Parameters
customer_id
required
integer

customer record ID

query Parameters
updated_at
string

Oldest date/time for the records to return

page
integer

Results page to view

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create Order

Creates a new order for the customer.

Authorizations:
BasicAuth
path Parameters
customer_id
required
integer

customer record ID

Request Body schema: application/json
order_number
required
string
order_date
required
string
order_status_id
integer
price_tier_id
integer
ship_from_address_id
integer

Facility Address ID, not Facility ID or Customer Address ID

po_number
string
payment_term_id
integer or null
deliver_date
string
produce_date
string
ship_date
string
delivery_method_id
integer
sales_channel_id
integer
salesperson_id
integer or null
quote_id
integer
instructions
string or null
internal_notes
string or null
invoiced
boolean
tax
number
shipping
number
discount
number
price_tier_ids
Array of integers
required
Array of objects
Array of objects (custom_line_items)

Responses

Request samples

Content type
application/json
{
  • "order_number": "SO100",
  • "order_date": "2020-09-04",
  • "deliver_date": "2020-09-04",
  • "produce_date": "2020-09-04",
  • "po_number": "12345",
  • "payment_term_id": null,
  • "order_status_id": 1,
  • "salesperson_id": null,
  • "delivery_method_id": 1,
  • "instructions": null,
  • "internal_notes": null,
  • "discount": 0,
  • "tax": 0,
  • "shipping": 0,
  • "order_items_attributes": [
    ],
  • "custom_line_items_attributes": [
    ]
}

Response samples

Content type
application/json
[
  • {
    }
]

Update Order

Updates an existing order

Authorizations:
BasicAuth
path Parameters
order_id
required
integer

order record ID

customer_id
required
integer

customer record ID

Request Body schema: application/json
order_number
string
order_date
string
order_status_id
integer
po_number
string
produce_date
string
deliver_date
string
ship_date
string
price_tier_id
integer
payment_term_id
integer or null
delivery_method_id
integer
sales_channel_id
integer
salesperson_id
integer or null
quote_id
integer
ship_from_address_id
integer

Facility Address ID, not Facility ID or Customer Address ID

instructions
string or null
internal_notes
string or null
invoiced
boolean
tax
number
shipping
number
discount
number
price_tier_ids
Array of integers
Array of objects
Array of objects (custom_line_items-2)

Responses

Request samples

Content type
application/json
{
  • "order_number": "SO100",
  • "order_date": "2020-09-04",
  • "payment_term_id": null,
  • "order_status_id": 1,
  • "salesperson_id": null,
  • "delivery_method_id": 1,
  • "instructions": null,
  • "internal_notes": null,
  • "discount": 0,
  • "tax": 0,
  • "shipping": 0,
  • "order_items_attributes": [
    ],
  • "custom_line_items_attributes": [
    ],
  • "po_number": "12345",
  • "produce_date": "2020-09-04",
  • "deliver_date": "2020-09-04"
}

Response samples

Content type
application/json
[
  • {
    }
]

Auto Pick and Ship

Performs a "pick and ship" for the specified order. Wherefour will auto-select available lot coded inventory, based on each inventory item's pull strategy, to fulfill the order. If the location is specified, only inventory at that location will be considered. If not enough inventory is available, a partial shipment will be created. Results of the shipment, with the selected stock lots, will be returned.

The optional ship_date param can be used to specify the timestamp of the shipment. Date/time should be in the format "2021-02-02 12:00 AM" and in the same time zone as the user's Wherefour settings.

The request will be rejected with a 422 response if the order has already been fulfilled, if shipments are blocked for the customer, or if the order's order status does not allow shipments.

Authorizations:
BasicAuth
path Parameters
customer_id
required
integer

customer record ID

order_id
required
integer

order record ID

Request Body schema:
delivery_method
required
string
location_id
integer

ID of the Wherefour Location to pull stock from. If not provided, auto ship will pull available stock lots from any location.

tracking_number
string

Tracking number to record for the shipment.

ship_date
string

Responses

Request samples

Content type
{
  • "tracking_number": "123456",
  • "delivery_method": "UPS Ground",
  • "location_id": 1
}

Response samples

Content type
application/json
{
  • "messages": [
    ]
}

Get Last Shipment

Returns the most recent shipment information for the order ID provided.

Authorizations:
BasicAuth
path Parameters
customer_id
required
integer
Example: 1

customer record ID

order_id
required
integer

order record ID

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List shipments for order

Returns the most recent shipment information for the order ID provided.

Authorizations:
BasicAuth
path Parameters
customer_id
required
integer
Example: 1

customer record ID

order_id
required
integer
Example: 2

order record ID

query Parameters
page
integer

Results page to view

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List Orders

Returns a paginated list of all orders.

Authorizations:
BasicAuth
query Parameters
updated_at
string

Oldest date/time for the records returned

status
string

Order status

search_start_date
string

Oldest order date, produce on date, deliver on date, or ship on date to return

search_end_date
string

Newest order date, produce on date, deliver on date, or ship on date to return

page
integer

Results page to view

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get Order

Retrieves an order record by ID

Authorizations:
BasicAuth
path Parameters
order_id
required
integer
Example: 1

ID for the order record

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Search for Order

Locates an order by the order_number

Authorizations:
BasicAuth
query Parameters
order_number
string non-empty
Example: order_number={ "order_number": "SO1" }

The sales order number in Wherefour to locate. All orders with matching results will be returned.

page
integer

Results page to view

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "order_number": "SO1"
}

Response samples

Content type
application/json
[
  • {
    }
]

Quotes

Customer quotes.

List quotes for a customer

Lists the quotes for a the customer.

Authorizations:
BasicAuth
path Parameters
customer_id
required
integer

customer record ID

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create Quote

Creates a new quote for the customer.

Authorizations:
BasicAuth
path Parameters
customer_id
required
integer

customer record ID

Request Body schema: application/json
quote_number
string
quote_date
required
string
expiration_date
string
status
required
string
Enum: "draft" "sent" "accepted" "rejected" "archived"
payment_term_id
integer or null
price_tier_name
string
price_tier_id
integer
sales_channel_id
integer
salesperson_id
integer or null
delivery_method_id
integer
instructions
string or null
tax
number
shipping
number
discount
number
price_tier_ids
Array of integers
required
Array of objects
Array of objects (custom_line_items)

Responses

Request samples

Content type
application/json
{
  • "quote_number": "QO100",
  • "quote_date": "2020-09-04",
  • "expiration_date": "2020-09-04",
  • "payment_term_id": null,
  • "status": "draft",
  • "salesperson_id": null,
  • "delivery_method_id": 1,
  • "instructions": null,
  • "discount": 0,
  • "tax": 0,
  • "shipping": 0,
  • "quote_items_attributes": [
    ],
  • "custom_line_items_attributes": [
    ]
}

Response samples

Content type
application/json
[
  • {
    }
]

Update Quote

Updates an existing quote

Authorizations:
BasicAuth
path Parameters
quote_id
required
integer

quote record ID

customer_id
required
integer

customer record ID

Request Body schema: application/json
quote_number
string
quote_date
string
expiration_date
string
status
string
Enum: "draft" "sent" "accepted" "rejected" "archived"
payment_term_id
integer or null
price_tier_name
string
price_tier_id
integer
sales_channel_id
integer
salesperson_id
integer or null
delivery_method_id
integer
instructions
string or null
tax
number
shipping
number
discount
number
price_tier_ids
Array of integers
Array of objects
Array of objects (custom_line_items-2)

Responses

Request samples

Content type
application/json
{
  • "quote_number": "QO100",
  • "quote_date": "2020-09-04",
  • "expiration_date": "2020-09-04",
  • "payment_term_id": null,
  • "status": "draft",
  • "salesperson_id": null,
  • "delivery_method_id": 1,
  • "instructions": null,
  • "discount": 0,
  • "tax": 0,
  • "shipping": 0,
  • "quote_items_attributes": [
    ],
  • "custom_line_items_attributes": [
    ]
}

Response samples

Content type
application/json
[
  • {
    }
]

Get Quote

Retrieves a quote record by ID

Authorizations:
BasicAuth
path Parameters
quote_id
required
integer
Example: 1

ID for the quote record

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Search for quote

Locates a quote by the quote_number

Authorizations:
BasicAuth
query Parameters
quote_number
string non-empty
Example: quote_number={ "quote_number": "QO1" }

The quote number in Wherefour to locate. All quotes with matching results will be returned.

page
integer

Results page to view

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "quote_number": "QO1"
}

Response samples

Content type
application/json
[
  • {
    }
]

List Quotes

Returns a paginated list of all quotes.

Authorizations:
BasicAuth
query Parameters
updated_at
string

Oldest date/time for the records to return

page
integer

Results page to view

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Shipments

Shipments made against customer orders.

List shipments

Returns a paginated list of all shipments.

Authorizations:
BasicAuth
query Parameters
page
integer

Results page to view

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Search for shipment

Returns a paginated list of shipments for the specified order number.

Authorizations:
BasicAuth
query Parameters
page
integer

Results page to view

Request Body schema: application/json
order_number
required
string

The order whose shipments to list

Responses

Request samples

Content type
application/json
{
  • "order_number": "SO1"
}

Response samples

Content type
application/json
[
  • {
    }
]

Purchases

Purchase orders to vendors.

List purchases

Returns a paginated list of purchase orders.

Authorizations:
BasicAuth
query Parameters
updated_at
string

Oldest date/time for the records returned.

page
integer

Results page to view

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Search Purchases

Searches for a purchase order based on the purchase order number provided. Multiple matches may be returned.

Authorizations:
BasicAuth
query Parameters
purchase_number
string

PO number to search for

page
integer

Results page to view

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create purchase order

Creates a purchase order for the vendor. New purchase orders are drafts unless status is sent. Each line's unit price comes from the vendor's price list for its quantity, unless override_unit_price is sent. The subtotal and total are always worked out by Wherefour.

Authorizations:
BasicAuth
path Parameters
vendor_id
required
integer

vendor record ID

Request Body schema: application/json
purchase_number
string

Defaults to the next purchase order number

purchase_date
string

Defaults to today

deliver_by_date
string
status
string
Enum: "draft" "open" "complete" "canceled" "archived"

Defaults to draft

payment_term_id
integer

Defaults to the vendor's payment term

delivery_method_id
integer

Defaults to the vendor's delivery method

bill_to_address_id
integer

A facility address. Defaults to the organization's main address

deliver_to_address_id
integer

A facility address. Defaults to the organization's main address

vendor_reference
string
instructions
string
tax
number
shipping
number
discount
number
required
Array of objects
Array of objects (custom_line_items)

Responses

Request samples

Content type
application/json
{
  • "deliver_by_date": "2026-11-05",
  • "vendor_reference": "Q-5521",
  • "instructions": "Deliver to dock 4.",
  • "shipping": 25,
  • "purchase_items_attributes": [
    ]
}

Response samples

Content type
application/json
[
  • {
    }
]

Get purchase order

Returns one of the vendor's purchase orders, with its lines and their custom line items and notes.

Authorizations:
BasicAuth
path Parameters
vendor_id
required
integer

vendor record ID

purchase_id
required
integer

purchase order record ID

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Update purchase order

Updates one of the vendor's purchase orders. A purchase order can't be changed once stock has been received against it; the request returns 422. Each line's unit price comes from the vendor's price list for its quantity, unless override_unit_price is sent. The subtotal and total are always worked out by Wherefour.

Authorizations:
BasicAuth
path Parameters
vendor_id
required
integer

vendor record ID

purchase_id
required
integer

purchase order record ID

Request Body schema: application/json
purchase_number
string
purchase_date
string
deliver_by_date
string
status
string
Enum: "draft" "open" "complete" "canceled" "archived"
payment_term_id
integer
delivery_method_id
integer
bill_to_address_id
integer

A facility address

deliver_to_address_id
integer

A facility address

vendor_reference
string
instructions
string
tax
number
shipping
number
discount
number
Array of objects
Array of objects (custom_line_items-2)

Responses

Request samples

Content type
application/json
{
  • "status": "open",
  • "purchase_items_attributes": [
    ]
}

Response samples

Content type
application/json
[
  • {
    }
]

Customers

Customers and their addresses.

List customers

Returns a paginated list of customers.

Authorizations:
BasicAuth
query Parameters
updated_at
string

Oldest date/time for the records to return

page
integer

Results page to view

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create a customer

Creates a new customer record.

Authorizations:
BasicAuth
Request Body schema: application/json
first_name
string
middle_name
string or null
last_name
string
display_name
required
string
email
string
phone
string
mobile
string
fax
string
website
string
note
string
kind
string
custom_field_1
string or null
custom_field_2
string or null
custom_field_3
string or null
custom_field_4
string or null
business_license_number
string
block_shipments
boolean
sales_channel_id
number
salesperson_id
number
object
object

Responses

Request samples

Content type
application/json
{
  • "first_name": "John",
  • "middle_name": null,
  • "last_name": "Smith",
  • "display_name": "John Smith",
  • "email": "test@example.com",
  • "phone": "555-1212",
  • "mobile": "555-2222",
  • "fax": "555-3333",
  • "website": "https://website.com",
  • "note": "This is a customer note.",
  • "custom_field_1": null,
  • "custom_field_2": null,
  • "custom_field_3": null,
  • "custom_field_4": null,
  • "business_license_number": "123",
  • "block_shipments": false,
  • "sales_channel_id": 1,
  • "salesperson_id": 2,
  • "billing_address_attributes": {
    },
  • "shipping_address_attributes": {
    }
}

Response samples

Content type
application/json
[
  • {
    }
]

Get Customer

Returns the customer record for the specified ID.

Authorizations:
BasicAuth
path Parameters
customer_id
required
integer

customer record ID

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "accounting_id": "123456abc",
  • "first_name": "",
  • "last_name": "",
  • "display_name": "Embarcadero Market & Deli",
  • "email": "buyer@embarcaderodeli.com",
  • "phone": "415-555-6687",
  • "mobile": "",
  • "fax": "",
  • "website": "https://wherefour.com",
  • "kind": "retailer",
  • "sales_channel": "Direct",
  • "sales_channel_id": 1,
  • "created_at": "2020-09-11T13:57:46.742Z",
  • "updated_at": "2020-09-11T13:57:46.742Z",
  • "payment_terms": "Net 30",
  • "salesperson": "Greg Stevenson",
  • "salesperson_id": 2,
  • "delivery_method": "Route: Embarcadero North",
  • "block_shipments": false,
  • "billing_address": {
    },
  • "shipping_address": {
    }
}

Update a Customer

Updates the customer record for the specified ID. Omitted fields are left as is. To clear a value include the field with null.

Authorizations:
BasicAuth
path Parameters
customer_id
required
integer

customer record ID

Request Body schema: application/json
first_name
string
middle_name
string or null
last_name
string
display_name
string
email
string
phone
string
mobile
string
fax
string
website
string
note
string
kind
string
custom_field_1
string or null
custom_field_2
string or null
custom_field_3
string or null
custom_field_4
string or null
business_license_number
string
block_shipments
boolean
sales_channel_id
number
salesperson_id
number
object
object

Responses

Request samples

Content type
application/json
{
  • "first_name": "John",
  • "middle_name": null,
  • "last_name": "Smith",
  • "display_name": "John A Smith",
  • "email": "test@example.com",
  • "phone": "555-1212",
  • "mobile": "555-2222",
  • "fax": "555-3333",
  • "website": "https://website.com",
  • "note": "This is a customer note.",
  • "custom_field_1": null,
  • "custom_field_2": null,
  • "custom_field_3": null,
  • "custom_field_4": null,
  • "business_license_number": "123",
  • "block_shipments": false,
  • "sales_channel_id": 1,
  • "salesperson_id": 2,
  • "billing_address_attributes": {
    },
  • "shipping_address_attributes": {
    }
}

Response samples

Content type
application/json
[
  • {
    }
]

List customer kinds

Returns of list of customer types.

Authorizations:
BasicAuth

Responses

Response samples

Content type
application/json
[
  • { }
]

Search for a customer

Returns customer records with a match on the display name.

Authorizations:
BasicAuth
query Parameters
page
integer

Results page to view

Request Body schema: application/json
display_name
string

Part of the customer's display name

business_license_number
string

Part of the customer's business license number

Responses

Request samples

Content type
application/json
{
  • "display_name": "A name"
}

Response samples

Content type
application/json
[
  • {
    }
]

Vendors

Vendors.

List Vendors

Returns a paginated list of vendors

Authorizations:
BasicAuth
query Parameters
updated_at
string

Oldest date/time for the records to return

page
integer

Results page to view

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get Vendor

Returns the vendor record for the specified ID.

Authorizations:
BasicAuth
path Parameters
vendor_id
required
integer

vendor record ID

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "first_name": "Joe",
  • "last_name": "Sample",
  • "display_name": "Pacific Foods Co.",
  • "email": "jsample@pacificfoods.com",
  • "phone": "415-555-6758",
  • "website": "https://wherefour.com",
  • "kind": "distributor",
  • "created_at": "2020-09-11T13:57:47.005Z",
  • "updated_at": "2020-09-11T13:57:47.005Z",
  • "billing_address": {
    },
  • "shipping_address": {
    },
  • "payment_term": {
    },
  • "delivery_method": {
    }
}

Search Vendors

Searches vendor records for matches on the display name provided. Multiple matches may be returned.

Authorizations:
BasicAuth
query Parameters
page
integer

Results page to view

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Reports

Reports.

Get inventory adjustment activity for a date range

Lists inventory adjustment activity for a date range. The IDs of records returned are for the adjustment record.

Authorizations:
BasicAuth
query Parameters
start_date_time
required
string

Start date/time for the oldest adjustment record to return, based on the adjustment's effective_at timestamp

end_date_time
required
string

End date/time for the newest adjustment record to return, based on the adjustment's effective_at timestamp

activity_types
Array of arrays

Restrict records to the provided adjustment activity types

category_ids
Array of arrays

Restrict records to inventory and stock lot that belong to the provided category IDs

customer_ids
Array of arrays

Restrict records to activity associated with specific customer IDs

inventory_ids
Array of arrays

Restrict records to the provided inventory IDs

location_ids
Array of arrays

Restrict records to the provided location IDs

statuses
Array of arrays

Restrict records to stock lots with the provided statuses

user_ids
Array of arrays

Restrict records to adjustments made by the provided used IDs

vendor_ids
Array of arrays

Restrict records to activity associated with specific vendor IDs

lot_code
Array of arrays

Restrict records to adjustments made only to stock lots with the provided lot code

barcode
Array of arrays

Restrict records to adjustments made only to stock lots with the provided barcode

serial_number
Array of arrays

Restrict records to adjustments made only to stock lots with the provided serial number

page
integer

Results page to view

Request Body schema: application/json
start_date_time
required
string

Start of the report, as a date and time

end_date_time
required
string

End of the report, as a date and time

activity_types
Array of strings

Adjustment reasons to include, such as purchase, shipment, manual_count or transfer_in. reduction includes every kind of reduction.

category_ids
Array of integers
customer_ids
Array of integers
inventory_ids
Array of integers
location_ids
Array of integers
statuses
Array of strings

Stock statuses

user_ids
Array of integers
lot_code
string
barcode
string
serial_number
string
page
integer

Responses

Request samples

Content type
application/json
{
  • "start_date_time": "2026-10-01T00:00:00-07:00",
  • "end_date_time": "2026-10-31T23:59:59-07:00",
  • "activity_types": [
    ],
  • "inventory_ids": [
    ]
}

Response samples

Content type
application/json
[
  • {
    }
]

Settings

Account settings used when creating records, such as payment terms and custom line definitions.

List delivery methods

Lists the available delivery methods

Authorizations:
BasicAuth
query Parameters
page
integer

Results page to view

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List sales channels

Lists the available sales channels

Authorizations:
BasicAuth
query Parameters
page
integer

Results page to view

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List salespeople

Lists the available salespeople

Authorizations:
BasicAuth
query Parameters
page
integer

Results page to view

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List payment terms

Lists the available payment terms

Authorizations:
BasicAuth
query Parameters
page
integer

Results page to view

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List order statuses

Lists the organization's order statuses

Authorizations:
BasicAuth
query Parameters
page
integer

Results page to view

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List custom line definitions

Lists the custom line definitions for custom line items, sorted by name. Use a definition's id as custom_line_definition_id when adding custom line items to a document, or to a document's lines in *_item_details_attributes. Inactive definitions are included unless filtered out.

Authorizations:
BasicAuth
query Parameters
page
integer

Results page to view

per_page
integer

Results per page, up to 100

active
boolean

Only active (true) or inactive (false) definitions

document
string
Enum: "credits" "invoices" "orders" "purchases" "quotes" "shipments" "standing_orders"

Only definitions that can be used on this kind of document

customer_id
integer

Only definitions open to all customers or limited to this customer

vendor_id
integer

Only definitions open to all vendors or limited to this vendor

inventory_id
integer

Only definitions open to all inventory items or limited to this item. These definitions can be added under a line for this item

updated_at
string

Only definitions updated on or after this time

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Credits

Customer credits.

List customer credits

Lists credits for a customer

Authorizations:
BasicAuth
path Parameters
customer_id
required
integer

customer record ID

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create Credit

Creates a new credit for the customer.

Authorizations:
BasicAuth
path Parameters
customer_id
required
integer

customer record ID

Request Body schema: application/json
credit_number
required
string
credit_date
required
string

A date such as 2026-10-22 is saved as midnight in the API user's time zone. A date and time with an offset, such as 2026-10-22T09:00:00-07:00, is saved as given.

status
required
string
order_id
integer
invoice_id
integer
salesperson_id
integer
credit_from_address_id
integer

Facility Address ID, not Facility ID or Customer Address ID

customer_message
string or null
internal_notes
string or null
Array of objects
Array of objects (custom_line_items)

Responses

Request samples

Content type
application/json
{
  • "order_id": 1,
  • "invoice_id": 1,
  • "salesperson_id": 2,
  • "credit_from_address_id": 1,
  • "credit_number": "CRED100",
  • "credit_date": "2020-09-04",
  • "status": "active",
  • "customer_message": null,
  • "internal_notes": null,
  • "credit_items_attributes": [
    ],
  • "custom_line_items_attributes": [
    ]
}

Response samples

Content type
application/json
[
  • {
    }
]

Update Credit

Updates an existing credit

Authorizations:
BasicAuth
path Parameters
credit_id
required
integer

credit record ID

customer_id
required
integer

customer record ID

Request Body schema: application/json
credit_number
string
credit_date
string

A date such as 2026-10-22 is saved as midnight in the API user's time zone. A date and time with an offset, such as 2026-10-22T09:00:00-07:00, is saved as given.

status
string
order_id
integer
invoice_id
integer
salesperson_id
integer
credit_from_address_id
integer

Facility Address ID, not Facility ID or Customer Address ID

customer_message
string or null
internal_notes
string or null
Array of objects
Array of objects (custom_line_items-2)

Responses

Request samples

Content type
application/json
{
  • "order_id": 1,
  • "invoice_id": 1,
  • "salesperson_id": 2,
  • "credit_from_address_id": 1,
  • "credit_number": "CRED100",
  • "credit_date": "2020-09-04",
  • "status": "active",
  • "customer_message": null,
  • "internal_notes": null,
  • "credit_items_attributes": [
    ],
  • "custom_line_items_attributes": [
    ]
}

Response samples

Content type
application/json
[
  • {
    }
]

Formulas

BOMs, disassemblies and kits.

List formulas

Lists formulas with optional name, type and search_type filters

Authorizations:
BasicAuth
query Parameters
name
string

Name of the formula to search for

type
required
string

Type of formula to search for, one of: (boms, kits, disassemblies)

search_type
required
string

Type of data to search for, one of: (formula, formula_version)

Responses

Response samples

Content type
application/json
{
  • "boms": [
    ],
  • "disassemblies": [
    ],
  • "kits": [
    ]
}

Search formulas

Searches formulas or formula versions for matches on name type and search_type filters

Authorizations:
BasicAuth
query Parameters
name
required
string

Name of the formula to search for

type
required
string

Type of formula to search for, one of: (boms, kits, disassemblies)

search_type
required
string

Type of data to search for, one of: (formula, formula_version)

Responses

Response samples

Content type
application/json
{
  • "boms": [
    ],
  • "disassemblies": [
    ],
  • "kits": [
    ]
}