Se rendre au contenu


Purchase API

This module exposes a small HTTP API for partner-scoped ordering and order tracking.

Authentication

Send the bearer token in the Authorization header:

Authorization: Bearer 

Token creation

  • Go to odoo.biomes.world and log in or create an account
  • Go to "MY Account" -> "Connection & Security"
  • Generate Api Key

My Account page:

Response format

Success responses return JSON with success: true.

Errors return JSON with a proper HTTP status code and this structure:

{
  "success": false,
  "error": {
    "code": "validation_error",
    "message": "Amount must be greater than zero"
  }
}

Endpoints

GET /partner_order_api/available_products

Returns the products the authenticated partner is allowed to order, including prices.

GET /partner_order_api/orders?page=1&page_size=20

Returns sales orders for the authenticated partner with simple pagination.

Query parameters:

  • page: page number, starting at 1
  • page_size: number of items per page, maximum 100

Response includes a pagination object with:

  • page
  • page_size
  • total_count
  • total_pages
  • has_next
  • has_previous

Each order entry also includes sent_lots, a list of all delivered lot/serial numbers that were sent.

For test kits, the values in sent_lots can also reflect the kit_barcode.

GET /partner_order_api/order_status?identifiedBy=biomes&order_id=SO12345

Returns the status of one sales order.

Lookup rule:

  • identifiedBy is required and must be biomes or external
  • order_id is required and contains the identifier value for the selected identifiedBy

POST /partner_order_api/order

Creates a new sales order from an allowed product EAN.

external_order_id is optional.

If provided, external_order_id must be unique for that partner.

Request body:

{
  "ean": "4260582941016",
  "amount": 1,
  "external_order_id": "EXT-1001",
  "delivery_address": {
    "name": "John Doe",
    "street": "Main Street 1",
    "street2": "",
    "zip": "10115",
    "city": "Berlin",
    "country_code": "DE"
  }
}

Create-order response includes:

  • biomes_order_id
  • external_order_id
  • delivery_order_name
  • total_cost
  • currency
  • sent_lots

For test kits, the values in sent_lots can also reflect the kit_barcode.

Files

Webhook

We offer the option to send a the body you would receive from the order_status endpoint to a webhook as soon as the delivery order is processed in our logistic.

You can add the webhook URL on the "Connection & Security" site mentioned above.