Skip to main content
POST
https://api.grainledger.com
/
api
/
v1
/
bills
Create bill
curl --request POST \
  --url https://api.grainledger.com/api/v1/bills \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Organization-Id: <x-organization-id>' \
  --data '
{
  "billNumber": "INV-1042",
  "billDate": "2026-06-15",
  "dueDate": "2026-07-15",
  "amount": 850
}
'
const options = {
method: 'POST',
headers: {
'X-Organization-Id': '<x-organization-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
billNumber: 'INV-1042',
billDate: '2026-06-15',
dueDate: '2026-07-15',
amount: 850
})
};

fetch('https://api.grainledger.com/api/v1/bills', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
import requests

url = "https://api.grainledger.com/api/v1/bills"

payload = {
"billNumber": "INV-1042",
"billDate": "2026-06-15",
"dueDate": "2026-07-15",
"amount": 850
}
headers = {
"X-Organization-Id": "<x-organization-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
{
  "id": "<string>",
  "billNumber": "<string>",
  "billDate": "2023-11-07T05:31:56Z",
  "dueDate": "2023-11-07T05:31:56Z",
  "amount": 123,
  "status": "<string>",
  "vendorId": "<string>",
  "fundId": "<string>"
}
{
"message": "You do not have access to this organization."
}
{
"message": "You do not have access to this organization."
}
{
"message": "You do not have access to this organization."
}
{
"message": "You do not have access to this organization."
}
{
"message": "You do not have access to this organization."
}
{
"message": "You do not have access to this organization."
}
{
"message": "You do not have access to this organization."
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Headers

X-Organization-Id
string
required

Organization ID for multi-tenant data access

Body

application/json
billNumber
string
required
Example:

"INV-1042"

billDate
string<date>
required
Example:

"2026-06-15"

dueDate
string<date>
required
Example:

"2026-07-15"

amount
number
required
Example:

850

vendorId
string
fundId
string
notes
string
Example:

"HVAC maintenance contract"

Response

Created bill

id
string
billNumber
string
billDate
string<date-time>
dueDate
string<date-time>
amount
number
status
string
vendorId
string | null
fundId
string | null
Last modified on July 9, 2026