Inventory API Documentation

 

 

Inventory API Query

<Rockstar description here>

How to get the Bearer Token

Request URL: https://go.solarplus.co/graphql

  • Paste it as Graphql’s authorization access

 

Testing Graphql via postman

  • Set the bearer token from the collection settings

  • Create a POST request from the request URL above

  • Set the body as GraphQL and formulate a query

  • Perform a request

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 :

VARIABLES:

 

METHOD:

createInventory

NOTE:

  • method returns the Inventory that has been created, kindly check the end of the page for the available fields on Inventory model

  • some categories will require model ( foriegn_id) field

  • some categories also have a default value for 'Cost of Sales Inc’

more information to this is added at the end of the page



  1. 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

 

Create Pricing without SKU and Supplier

NOTES:

  • if is_default is not specified for the pricing, it is automatically set to true

  • if no supplier and SKU is provided for the pricing, an SKU is automatically generated for the pricing. This is usually the case for Inventories under service categories.

UPDATE ( POST ) Requests

Update Inventory

VARIABLES:

 

METHOD:

updateInventory

 

 

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:

 


SAMPLE INPUT :

 

 

SAMPLE OUTPUT:

 



 

IMPORTANT DATA :

 

INVENTORY MODEL:

 

 

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

25 Discount

26 Contractor install kits

27 Safety & access equipment

 

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

 

CATEGORIES THAT THE DEFAULT VALUE FOR COST OF SALES IS FALSE:

9 Labour

10 Difficulty surcharges

11 Travel/Freight

12 Administrative

13 Miscellaneous

15 Warranty

18 Subsidy

25 Discount