inventory/create question / samples??

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

  • 7 Comments sorted by Votes Date Added
  • I don't know about the method you describe, but if you have an item that is not yet in the catalog, it must be created manually first. Once this process is approved it will be assigned a BOID. Use the 'Edit catalog' link at the bottom of any page and admin will notify you of any issues or email you to confirm a successful creation.
  • A BOID is like an item number, it is the number assigned to a LEGO item in the catalog. You get a LOT ID returned when you create inventory, not a BOID.

    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.

    ------------
  • You can only add items to your inventory that have a BOID. If you want to add an item that doesn't exist in the catalog, it needs to be added to the catalog first. https://www.brickowl.com/catalog/edit
  • Awesome. Clearly I didn't quite convey 100%. I don't want to create a new item for BO, I want to add an item to my inventory that isn't already there (but exists in BO). I guess the question is, how do I know what the BOID is if I want to add the part to my inventory through the API?
  • Well, again I don't use APIs or syncing software or external inventory tools, so apologies if this sounds a bit basic, but each catalog entry has the BOID in the data grid visible on the page. Individual colors will have this parent BOID appended with the color code. If the item you want to add to your inventory using API already exists, can you not just locate the item in the catalog and manually tell the API what the BOID is?
  • I ran into the same issue when trying out the api years ago. I use a PHP script to calculate my pricing, which pulls data from Brickstore (and thus BL). I tried to create a script where I could add a .bsx file direct to my BO inventory after running it through my pricing script, but I couldn't work out how to determine the BOID for each lot. In fact, I couldn't work out whether the lack of a BOID was what prevented my script from working, and in the end I just gave up.

    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.
  • Try calling the method "ID Lookup" to get the BOID first and then use the result/s to create the items.
Sign In or Register to comment.