Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Inventory API Query

Sample Query for Inventory Items

Samples are using Postman to send requests<Rockstar description here>

How to get the Bearer Token

Request URL: https://go.solarplus.co/graphqlAuthorization: Integration → Solarplus API Credentials Token

...

  • Paste it as Graphql’s authorization access

...

Testing Graphql via

...

On the right, see documentation of app structure:

eg.

{ Inventory(id: 87381 )

{

...

postman

  • Set the bearer token from the collection settings

    Image Added
  • 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:

...

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

...

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,

...


  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

...

VARIABLES:

...


METHOD:

savePricing

...

DELETE REQUEST

DELETE INVENTORY

VARIABLES :

id : required, inventory id to be deleted

METHOD:

deleteInventoryByPk

...

METHOD:

deleteInventoryByPk

...

SEARCH (POST) REQUEST 

Search Inventory

METHOD:

Inventories

...

Code Block
{
    "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
            }
        ]
    }
}


IMPORTANT DATA :

INVENTORY MODEL:

CATEGORY VALUES 


1 Mounting

2 Isolators - DC

...