curl --request POST \
--url https://{companyName}.api.joinluminous.com/external/api/v1/bills \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"purchase_order_ids": [
123
],
"purchase_order_id": 123,
"assembly_order_ids": [
123
],
"work_order_ids": [
123
],
"items": [
{
"assembly_order_id": 123,
"assembly_order_line_id": 123,
"assembly_order_extra_cost_id": 123,
"production_batch_id": 123,
"production_batch_number": "<string>"
}
]
}
'import requests
url = "https://{companyName}.api.joinluminous.com/external/api/v1/bills"
payload = {
"purchase_order_ids": [123],
"purchase_order_id": 123,
"assembly_order_ids": [123],
"work_order_ids": [123],
"items": [
{
"assembly_order_id": 123,
"assembly_order_line_id": 123,
"assembly_order_extra_cost_id": 123,
"production_batch_id": 123,
"production_batch_number": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
purchase_order_ids: [123],
purchase_order_id: 123,
assembly_order_ids: [123],
work_order_ids: [123],
items: [
{
assembly_order_id: 123,
assembly_order_line_id: 123,
assembly_order_extra_cost_id: 123,
production_batch_id: 123,
production_batch_number: '<string>'
}
]
})
};
fetch('https://{companyName}.api.joinluminous.com/external/api/v1/bills', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{companyName}.api.joinluminous.com/external/api/v1/bills",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'purchase_order_ids' => [
123
],
'purchase_order_id' => 123,
'assembly_order_ids' => [
123
],
'work_order_ids' => [
123
],
'items' => [
[
'assembly_order_id' => 123,
'assembly_order_line_id' => 123,
'assembly_order_extra_cost_id' => 123,
'production_batch_id' => 123,
'production_batch_number' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{companyName}.api.joinluminous.com/external/api/v1/bills"
payload := strings.NewReader("{\n \"purchase_order_ids\": [\n 123\n ],\n \"purchase_order_id\": 123,\n \"assembly_order_ids\": [\n 123\n ],\n \"work_order_ids\": [\n 123\n ],\n \"items\": [\n {\n \"assembly_order_id\": 123,\n \"assembly_order_line_id\": 123,\n \"assembly_order_extra_cost_id\": 123,\n \"production_batch_id\": 123,\n \"production_batch_number\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{companyName}.api.joinluminous.com/external/api/v1/bills")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"purchase_order_ids\": [\n 123\n ],\n \"purchase_order_id\": 123,\n \"assembly_order_ids\": [\n 123\n ],\n \"work_order_ids\": [\n 123\n ],\n \"items\": [\n {\n \"assembly_order_id\": 123,\n \"assembly_order_line_id\": 123,\n \"assembly_order_extra_cost_id\": 123,\n \"production_batch_id\": 123,\n \"production_batch_number\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{companyName}.api.joinluminous.com/external/api/v1/bills")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"purchase_order_ids\": [\n 123\n ],\n \"purchase_order_id\": 123,\n \"assembly_order_ids\": [\n 123\n ],\n \"work_order_ids\": [\n 123\n ],\n \"items\": [\n {\n \"assembly_order_id\": 123,\n \"assembly_order_line_id\": 123,\n \"assembly_order_extra_cost_id\": 123,\n \"production_batch_id\": 123,\n \"production_batch_number\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {}
}{
"message": "<string>"
}{
"message": "<string>"
}Create a bill
Create a new bill record.
Each line item’s amount must be zero or greater, except for adjustment
lines (line_type of adjustment), which may carry a negative amount to
record a credit or downward correction. A negative amount on any other
line type returns 422.
Linking purchase orders. A bill can be linked to one or more purchase
orders. Pass purchase_order_ids (an array of PO IDs) to link multiple
purchase orders to the bill. The legacy single purchase_order_id field is
still accepted for backward compatibility and is treated as a one-element
purchase_order_ids array. Linked POs are returned under the bill’s
purchase_orders field.
Linking assembly orders and work orders. A bill can also be created
against manufacturing output. Pass assembly_order_ids and/or
work_order_ids to link assembly orders and work orders; the linked
records are returned under the bill’s assembly_orders and work_orders
fields. To reconcile individual bill line items against manufacturing
lines, set items.*.assembly_order_id, items.*.assembly_order_line_id
(component lines), or items.*.assembly_order_extra_cost_id (extra
costs / manufacturing service fees) on the item. Use
GET /assembly-orders/{assemblyOrderId}/billable-lines or
GET /work-orders/{workOrderId}/billable-lines to discover the billable
lines to reference.
curl --request POST \
--url https://{companyName}.api.joinluminous.com/external/api/v1/bills \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"purchase_order_ids": [
123
],
"purchase_order_id": 123,
"assembly_order_ids": [
123
],
"work_order_ids": [
123
],
"items": [
{
"assembly_order_id": 123,
"assembly_order_line_id": 123,
"assembly_order_extra_cost_id": 123,
"production_batch_id": 123,
"production_batch_number": "<string>"
}
]
}
'import requests
url = "https://{companyName}.api.joinluminous.com/external/api/v1/bills"
payload = {
"purchase_order_ids": [123],
"purchase_order_id": 123,
"assembly_order_ids": [123],
"work_order_ids": [123],
"items": [
{
"assembly_order_id": 123,
"assembly_order_line_id": 123,
"assembly_order_extra_cost_id": 123,
"production_batch_id": 123,
"production_batch_number": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
purchase_order_ids: [123],
purchase_order_id: 123,
assembly_order_ids: [123],
work_order_ids: [123],
items: [
{
assembly_order_id: 123,
assembly_order_line_id: 123,
assembly_order_extra_cost_id: 123,
production_batch_id: 123,
production_batch_number: '<string>'
}
]
})
};
fetch('https://{companyName}.api.joinluminous.com/external/api/v1/bills', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{companyName}.api.joinluminous.com/external/api/v1/bills",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'purchase_order_ids' => [
123
],
'purchase_order_id' => 123,
'assembly_order_ids' => [
123
],
'work_order_ids' => [
123
],
'items' => [
[
'assembly_order_id' => 123,
'assembly_order_line_id' => 123,
'assembly_order_extra_cost_id' => 123,
'production_batch_id' => 123,
'production_batch_number' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{companyName}.api.joinluminous.com/external/api/v1/bills"
payload := strings.NewReader("{\n \"purchase_order_ids\": [\n 123\n ],\n \"purchase_order_id\": 123,\n \"assembly_order_ids\": [\n 123\n ],\n \"work_order_ids\": [\n 123\n ],\n \"items\": [\n {\n \"assembly_order_id\": 123,\n \"assembly_order_line_id\": 123,\n \"assembly_order_extra_cost_id\": 123,\n \"production_batch_id\": 123,\n \"production_batch_number\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{companyName}.api.joinluminous.com/external/api/v1/bills")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"purchase_order_ids\": [\n 123\n ],\n \"purchase_order_id\": 123,\n \"assembly_order_ids\": [\n 123\n ],\n \"work_order_ids\": [\n 123\n ],\n \"items\": [\n {\n \"assembly_order_id\": 123,\n \"assembly_order_line_id\": 123,\n \"assembly_order_extra_cost_id\": 123,\n \"production_batch_id\": 123,\n \"production_batch_number\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{companyName}.api.joinluminous.com/external/api/v1/bills")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"purchase_order_ids\": [\n 123\n ],\n \"purchase_order_id\": 123,\n \"assembly_order_ids\": [\n 123\n ],\n \"work_order_ids\": [\n 123\n ],\n \"items\": [\n {\n \"assembly_order_id\": 123,\n \"assembly_order_line_id\": 123,\n \"assembly_order_extra_cost_id\": 123,\n \"production_batch_id\": 123,\n \"production_batch_number\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {}
}{
"message": "<string>"
}{
"message": "<string>"
}Authorizations
Authenticate using a bearer token. To create a token, navigate to /settings/api-tokens and click Create API Token.
Body
IDs of the purchase orders to link to this bill. Use this to link multiple POs. Each ID must reference an existing purchase order.
Deprecated — single purchase order to link. Prefer
purchase_order_ids. When supplied without purchase_order_ids,
it is treated as a one-element purchase_order_ids array.
IDs of the assembly orders to link to this bill. Each ID must reference an existing assembly order.
IDs of the work orders to link to this bill. Each ID must reference an existing work order.
Bill line items. Alongside the standard fields, each item may
reference a manufacturing source line for reconciliation:
assembly_order_id, assembly_order_line_id (component lines),
and assembly_order_extra_cost_id (extra costs). A line may also
record which production run (production batch) it originated from
via production_batch_id and/or production_batch_number.
Show child attributes
Show child attributes
Response
Bill created successfully