Inventory API Query
Sample Query for Inventory Items
Samples are using Postman to send requests
URL: https://go.solarplus.co/graphql
Authorization: Integration → Solarplus API Credentials Token
Testing Graphql via browser
On the right, see documentation of app structure:
eg.
{ Inventory(id: 87381 )
{
id
name
InventoryPricings {
item_variation_suffix
unitPrice
}
}
}
CREATE (POST) requests
Create Inventory :
category_id - required field ( check possible values at the end of this post)
brand_id - required field for specific categories ( check end of post for categories which require brand_id)
model_id - required field for specific categories ( check end of post for categories which require model_id)
name - required field
item is purchased - boolean value 0( false) or 1( true)
include in quote by default - boolean value 0( false) or 1( true)
assign kit value - boolean value 0( false) or 1( true)
description - text description
apply sales tax - applicable only to SUBSIDY ( CAT. 18)
subtract from payable - applicable only to SUBSIDY ( CAT. 18)
Create Inventory Kit ( with Pricing )
mutation: gql` mutation createInventoryKitItem( $input: CreateInventoryKitInput! ) { createInventoryKitItem(input: $input) } `, variables,
Create Pricing Level:
VARIABLES:
note: same method is used for update pricing, to create a new one , supply id with value 0, or do not pass field id
METHOD:
savePricing
UPDATE ( POST ) Requests
Update Inventory
inventory_id - required field
category_id - ( check possible values at the end of this post)
brand_id - required field for specific categories ( check end of post for categories which require brand_id)
model_id - required field for specific categories ( check end of post for categories which require model_id)
name - required field
item is purchased - boolean value 0( false) or 1( true)
include in quote by default - boolean value 0( false) or 1( true)
assign kit value - boolean value 0( false) or 1( true)
description - text description
apply sales tax - applicable only to SUBSIDY ( CAT. 18)
subtract from payable - applicable only to SUBSIDY ( CAT. 18)
UPDATE PRICING
VARIABLES:
METHOD:
savePricing
DELETE REQUEST
DELETE INVENTORY
VARIABLES :
id : required, inventory id to be deleted
METHOD:
deleteInventoryByPk
DELETE PRICING
VARIABLES :
id : required, inventory id to be deleted
METHOD:
deleteInventoryByPk
SEARCH (GET) REQUEST
Search Inventory
METHOD:
Inventories
VARIABLES FOR INPUT (ARGUMENTS) :
VARIABLES FOR OUTPUT (DATA):
SAMPLE QUERY:
QUERY :
query Inventories( $archived: Boolean $categoryId: ID $orderBy: String $orderType: String $businessId: ID ) { Inventories( archived: $archived categoryId: $categoryId orderBy: $orderBy orderType: $orderType businessId: $businessId ) { id name Category { id name } series_and_model inventory_currency brand_name kit_value archived InventoryPricingDefault { id code markup_is_percentage markup_is_percentage_text markup_value unit_price retail_price Supplier { id name } item_variation_suffix } } }
SAMPLE INPUT :
{ "archived": false, "categoryId": 8, "orderBy" : "updated", "orderType" : "DESC", "businessId" : 911 }
SAMPLE OUTPUT:
{ "data": { "Inventories": [ { "id": "42289", "name": "neon genesis evangelion", "Category": { "id": "8", "name": "Modules" }, "series_and_model": "RSM72-6-315P", "inventory_currency": "$", "brand_name": "Risen", "kit_value": false, "archived": false, "InventoryPricingDefault": { "id": "24466", "code": "neon genesis evangelion", "markup_is_percentage": "1", "markup_is_percentage_text": "%", "markup_value": 12, "unit_price": 0, "retail_price": 0, "Supplier": { "id": "2848", "name": "sdwewewew" }, "item_variation_suffix": "test2" } }, ] } }
Search Inventory Pricing
Stock code- varchar
Supplier_name - varchar
Supplier_id - numeric
Buy Price - numeric
inventory_id - numeric
is default - boolean value 0( false) or 1( true)
buy price - numerical value
unit_of_measure - numeric ( check end of the post for possible values )
markup value - numerical value
markup value is percent - boolean value 0( false) or 1( true)
Order_by - column or columns to order the entries ( default is updated_date)
Order_type - DESC or ASC
Get specific inventory item
Inventory_id - required field
Get specific pricing
Pricing_id - required field
Brand query
Category_id - optional
Model query
Category_id - required
Brand_id - required
CATEGORY VALUES
1 Mounting
2 Isolators - DC
3 Fuses/Breakers
4 Cables
5 Accessories
6 Monitoring
7 Inverters
8 Modules
9 Labour
10 Difficulty surcharges
11 Travel/Freight
12 Administrative
13 Miscellaneous
14 Kit
15 Warranty
16 Isolators - AC
17 Battery
18 Subsidy
19 Metering
20 Battery Access
21 Grid Protection
22 Generator
23 Battery Isolator
24 Energy Management
CATEGORIES THAT REQUIRE BRAND AND MODEL:
7 Inverters
8 Modules
17 Battery
CATEGORIES WHICH ACCEPT BRAND AND MODEL BUT DO NOT REQUIRE IT :
5 Accessories
20 Battery Access
23 Battery Isolator
4 Cables
24 Energy Management
3 Fuses/Breakers
22 Generator
21 Grid Protection
16 Isolators - AC
2 Isolators - DC
14 Kit
19 Metering
13 Miscellaneous
6 Monitoring
1 Mounting