@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api brainbi
@auth ApiKey Authorization in header
@endpoints 33
@hint download_for_search
@toc api(33)

@endpoint GET /api/rule
@desc This resource lists all pricing rules that are currently saved in you account
@optional {: str}

@endpoint GET /api/rule/1
@desc This resource returns a specific rule {id}

@endpoint POST /api/rule
@desc To update a product, please use the listed attributes listed underneath
@optional {product_id: str # The ID of the product you want this monitor to be linked to. Can be left empty if no link to a product is needed.  This needs to be the ID of brainbi and not your internal id (store_remote_id) (optional), name: str # A recognisable name., scrape_url: str # The URL of the product, type: str # Set to "AI" if this is ruke should be handled by our AI. Otherwise leave blank and provide the DOM-element with the scrape_selector. (optional), scrape_selector: str # The DOM-Selector for the price (you need to set this if you leave type blank).}

@endpoint GET /api/rule/ruleData/1
@desc This resource lists all data that wa saved for pricing rules
@optional {: str}

@endpoint GET /api/rule/ruleData/1/latest
@desc This resource lists only the latest data point that wa saved for a pricing rule
@optional {: str}

@endpoint GET /api/products
@desc This resource lists all products that are currently saved in you account
@optional {: str}

@endpoint GET /api/products/1
@desc This resource returns a specific product {id}

@endpoint GET /api/products/23767/rules
@desc This resource returns all available rules for a product {id}

@endpoint POST /api/products
@desc To update a product, please use the listed attributes listed underneath
@required {status: str # The status of your product as text., store_remote_id: str # Your internal ID of this product. Mostly the ID from your shop or ERP system., store_remote_variant_id: str # Your ID if there are more than one variant of the product., name: str, vendor: str, price: str # Your selling price., cost_price: str # The cost that you pay., shipping: str # Shipping cost, url: str, ean_upc: str, category_id: str, category_name: str}

@endpoint GET /api/analyze/pricing
@desc To update a product, please use the listed attributes listed underneath
@required {status: str # The status of your product as text., store_remote_id: str # Your internal ID of this product. Mostly the ID from your shop or ERP system., store_remote_variant_id: str # Your ID if there are more than one variant of the product., name: str, vendor: str, price: str # Your selling price., cost_price: str # The cost that you pay., shipping: str # Shipping cost, url: str, ean_upc: str, category_id: str, category_name: str}
@optional {url: str}

@endpoint GET /api/analyze/pricing
@desc To update a product, please use the listed attributes listed underneath
@required {status: str # The status of your product as text., store_remote_id: str # Your internal ID of this product. Mostly the ID from your shop or ERP system., store_remote_variant_id: str # Your ID if there are more than one variant of the product., name: str, vendor: str, price: str # Your selling price., cost_price: str # The cost that you pay., shipping: str # Shipping cost, url: str, ean_upc: str, category_id: str, category_name: str}
@optional {url: str}

@endpoint PUT /api/products
@desc To update a product, please use the listed attributes listed underneath
@required {status: str # The status of your product as text., store_remote_id: str # Your internal ID of this product. Mostly the ID from your shop or ERP system., store_remote_variant_id: str # Your ID if there are more than one variant of the product., name: str, vendor: str, price: str # Your selling price., cost_price: str # The cost that you pay., shipping: str # Shipping cost, url: str, ean_upc: str, category_id: str, category_name: str}

@endpoint DELETE /api/products/1137
@desc Products
@optional {: str}

@endpoint GET /api/customers
@desc This resource lists all cusomters that are currently saved in your account
@optional {: str}

@endpoint GET /api/customers/1
@desc This resource returns a specific customer {id}

@endpoint POST /api/customers
@desc To update a customer, please use the listed attributes listed underneath
@required {store_remote_id: str # This is your internal id of this order. You need to provide this, so you can later match your orders wit our analytics., status: str, currency: str, country: str, sub_total: str, shipping: str, total: str, created_at: str}

@endpoint PUT /api/customers/1137
@desc Customers
@required {store_remote_id: str # This is your internal id of this order. You need to provide this, so you can later match your orders wit our analytics., status: str, currency: str, country: str, sub_total: str, shipping: str, total: str, created_at: str}

@endpoint DELETE /api/customers/1137
@desc Customers

@endpoint GET /api/orders
@desc This resource lists all orders that are currently saved in your account
@optional {: str}

@endpoint GET /api/orders/12
@desc This resource returns a specific order {id}

@endpoint POST /api/orders
@desc To update a order, please use the listed attributes listed underneath
@required {store_remote_id: str # This is your internal id of this order. You need to provide this, so you can later match your orders wit our analytics., status: str, currency: str, country: str, sub_total: str, shipping: str, total: str, created_at: str}

@endpoint PUT /api/orders/1137
@desc Orders
@required {store_remote_id: str # This is your internal id of this order. You need to provide this, so you can later match your orders wit our analytics., status: str, currency: str, country: str, sub_total: str, shipping: str, total: str, created_at: str}

@endpoint DELETE /api/orders/1137
@desc Orders
@optional {: str}

@endpoint GET /api/orderlines
@desc This resource lists all order lines that are currently saved in your account

@endpoint GET /api/orderlines/123
@desc This resource returns a specific order line {id}

@endpoint POST /api/orderlines
@desc To update a order line, please use the listed attributes listed underneath
@required {store_remote_id: str # This is your internal id of this order. You need to provide this, so you can later match your orders wit our analytics., status: str, currency: str, country: str, sub_total: str, shipping: str, total: str, created_at: str}

@endpoint PUT /api/orderlines/1137
@desc OrderLines
@required {store_remote_id: str # This is your internal id of this order. You need to provide this, so you can later match your orders wit our analytics., status: str, currency: str, country: str, sub_total: str, shipping: str, total: str, created_at: str}

@endpoint DELETE /api/orderlines/1137
@desc OrderLines

@endpoint GET /api/seo/ranking/latest
@desc This resource lists all pricing rules that are currently saved in you account
@optional {: str}

@endpoint POST /api/login
@desc Use this endpoint to make the initial call with your email and password (same as on brainbi
@optional {email: str # The same email you use for our platform., password: str # The password email you use for our platform.}

@endpoint POST /api/register
@desc Use this endpoint to make the initial call with your email and password (same as on brainbi
@optional {first_name: str # required, last_name: str # required, company_name: str # required, shop_url: str # required, email: str # required, store_name: str # required, store_url: str # required, password: str # required, fromuser: str # required (always 1)}

@endpoint POST /api/register_woocommerce
@desc Use this endpoint to make the initial call with your email and password (same as on brainbi
@optional {first_name: str # required, last_name: str # required, company_name: str # required, shop_url: str # required, email: str # required, store_name: str # required, store_url: str # required, password: str # required, fromuser: str # required (always 1), api_url: str # required, consumer_key: str # required, consumer_secret: str # required}

@endpoint POST /api/logout
@desc Once you are done, call this endpoint to lock your account!
@optional {email: str # The same email you use for our platform.}

@end
