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 (POST) 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
VARIABLES FOR INPUT (ARGUMENTS) :
VARIABLES FOR OUTPUT(DATA):
SAMPLE QUERY:
QUERY:
query InventoryPricings( $inventoryId: ID ) { InventoryPricings( inventoryId: $inventoryId ) { id inventory_id supplier_id code unit_price markup_value markup_is_percentage unit_of_measure_string unit_of_measure item_variation_suffix spare_qty quantity } }
SAMPLE INPUT :
{ "inventoryId": 29505 }
SAMPLE OUTPUT:
{ "data": { "InventoryPricings": [ { "id": "24399", "inventory_id": "29505", "supplier_id": "293", "code": "ET Solar ET-M572190", "unit_price": 2, "markup_value": 12, "markup_is_percentage": "1", "unit_of_measure_string": "/ kW Solar PV", "unit_of_measure": "2", "item_variation_suffix": "", "spare_qty": 0, "quantity": 0 }, { "id": "15459", "inventory_id": "29505", "supplier_id": null, "code": "ET-M572190", "unit_price": 200, "markup_value": 12, "markup_is_percentage": "1", "unit_of_measure_string": "/ item", "unit_of_measure": "0", "item_variation_suffix": "", "spare_qty": 0, "quantity": 0 } ] } }
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 THAT 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