Good evening!!! I am looking to be able to insert an item to my BrickOwl inventory but I am a little confused with the arguments and potentially how to correctly do this.
The arguments that are provided on the API site are as follows:
boid - A BOID
color_id (Optional) - A Brick Owl color ID. This is required for Parts, optional for Gear/Minibuild, and not allowed for other item types
quantity - The quantity of the lot, a whole number greater than zero
price - The price of the lot. It must be a positive number, it will be rounded to 3 digits of precision
condition - Condition ID
new - New
news - New (Sealed)
newc - New (Complete)
newi - New (Incomplete)
usedc - Used (Complete)
usedi - Used (Incomplete)
usedn - Used (Like New)
usedg - Used (Good)
useda - Used (Acceptable)
other - Other
external_id (Optional) - An optional external ID for reference
How can I pass the boid for a new inventory item if it doesn't exist yet? I heard that the create function returns the boid once the item is created.
Do I need to execute an update call to populate the rest of the fields that correspond to the item?
Is there a sample inventory/create response that someone can provide just so I know what to expect? I am currently unable to add an item so I cannot see the response.
Thank you all in advance!
Comments
You indeed run another update command to populate the other fields (using the LOT ID returned by create command).
I use Insomnia (https://insomnia.rest/) to test API requests and responses.
Feel free to ask any API questions.
----------
BULK API CREATE
REQUEST:
{\"requests\":[{\"endpoint\":\"inventory/create\",\"request_method\":\"POST\",\"params\":[{\"boid\":\"442413\",\"color_id\":39,\"quantity\":10,\"price\":1.815,\"condition\":\"new\",\"external_id\":0}]}]}
RESPONSE:
[{\"req_num\":1,\"code\":200,\"body\":{\"status\":\"Success\",\"lot_id\":\"109338225\"}}]
I've made another post with API example somewhere.
------------
I know Stragus (the guy who made Bricksync) had to create his own BLID<>BOID database in order to make his scripts work, but this info must be in the BO data somewhere and is probably just restricted at BL's request. Rebrickable has both IDs in their database so perhaps there's a compromise in there somewhere.