Endpoints GET /v1/bills/
GET /v1/bills/:id/
POST /v1/bills/
PATCH /v1/bills/:id/
DELETE /v1/bills/:id/
GET /v1/bills/:id/download/
GET /v1/bills/:id/line-items/
POST /v1/bills/:id/line-items/:line_item_id/
PATCH /v1/bills/:id/line-items/:line_item_id/
DELETE /v1/bills/:id/line-items/:line_item_id/
Bill object Attributes Type Description id string
The id of the object. amount number
The bill amount. contact string
The id of the contact. currency string
The currency used in the bill. bill_number string
The bill number. bill_date string
The date of the bill. bill_due_date string
The due date for the bill. language string
The language used in the bill. line_items array
The line items of the bill. reference string
The reference of the bill. status string
The status of the bill. Either DRAFT
, AUTHORIZED
or PAID
tax_amount number
The tax amount. tax_amount_type string
Either TAX_INCLUSIVE
or TAX_EXCLUSIVE
.
Example {
"amount" : 115.0 ,
"contact" : "co_MQcEMrcKsUXxTQBJiZqmP3" ,
"currency" : "SAR" ,
"id" : "bi_hT9Q7YcYFRFoVasEbAHcPy" ,
"bill_date" : "2023-02-19" ,
"bill_number" : "BILL-0121" ,
"language" : "en" ,
"line_items" : [ {
"account" : "acc_6r7jjse7NGGw7j7j4yk6hr" ,
"description" : "Line Item" ,
"id" : "bli_hGr8a2RytAVrPcmpDALGVd" ,
"line_amount" : 115.0 ,
"quantity" : 1.0 ,
"tax_amount" : 15.0 ,
"tax_rate" : "tax_bMKW4KwKKuFqnevUHfhDVg" ,
"unit_amount" : 100.0
} ] ,
"reference" : "A reference to be reused" ,
"status" : "DRAFT" ,
"tax_amount" : 15.0 ,
"tax_amount_type" : "TAX_EXCLUSIVE"
}
Get bill Endpoint GET /v1/bills/:id/
List bills Endpoint GET /v1/bills/
Filters Query param Type Description contact string
The id of the contact. reference string
The reference of the bill. bill_date string
The bill date in YYYY-MM-DD
e.g. 2021-01-01
. bill_due_date string
The bill due date in YYYY-MM-DD
e.g. 2021-05-01
.
Request curl --location \
--request GET 'https://api.wafeq.com/v1/bills/' \
--header 'Authorization: Api-Key <api_key>' \
--header 'Content-Type: application/json'
Try it
Create bill Endpoint POST /v1/bills/
Request body Attributes Type Description amount number
The bill amount. contact string
The id of the contact. currency string
The currency used in the bill. bill_number string
The bill number. bill_date string
The date of the bill. bill_due_date string
The due date for the bill. language string
The language used in the bill. line_items array
The line items of the bill. reference string
The reference of the bill. status string
The status of the bill. Either DRAFT
or AUTHORIZED
tax_amount number
The tax amount. tax_amount_type string
Either TAX_INCLUSIVE
or TAX_EXCLUSIVE
.
Request curl --location \
--request POST 'https://api.wafeq.com/v1/bills/' \
--header 'Authorization: Api-Key <api_key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"currency": "SAR",
"bill_number": "BILL-0121",
"bill_date": "2023-02-19",
"bill_due_date": "2023-05-19",
"contact": "<contact>",
"language": "en",
"line_items": [
{
"account": "<account>",
"description": "Line Item",
"quantity": 1,
"tax_rate": "<tax_rate>",
"unit_amount": 100
}
],
"reference": "A reference to be reused",
"tax_amount_type": "TAX_EXCLUSIVE"
}'
Try it
Update bill PATCH /v1/bills/:id/
Request body Attributes Type Description id string
The id of the object. amount number
The bill amount. contact string
The id of the contact. currency string
The currency used in the bill. bill_number string
The bill number. bill_date string
The date of the bill. bill_due_date string
The due date for the bill. language string
The language used in the bill. reference string
The reference of the bill. status string
The status of the bill. Either DRAFT
or AUTHORIZED
tax_amount_type string
Either TAX_INCLUSIVE
or TAX_EXCLUSIVE
.
To update the line items, you need to use the bills line items endpoints.
Delete bill DELETE /v1/bills/:id/
Download bill GET /v1/bills/:id/download/
Bill line item object Attribute Type Description account string
The id of the account. description string
The description of the line item. id string
The id of the object. line_amount number
The line amount. quantity number
The quantity. tax_amount number
The tax amount. tax_rate string
The id of the tax rate. unit_amount number
The unit amount.
Example {
"account" : "acc_7jpGSFEGGF9cK39vwoDPBt" ,
"description" : "Line item" ,
"id" : "bli_Zhf8cUxzjiRRs8Ga7MCgWE" ,
"line_amount" : 115.0 ,
"quantity" : 1.0 ,
"tax_amount" : 15.0 ,
"tax_rate" : "tax_c8TkJLeXZYJmWuSjqGzGzj" ,
"unit_amount" : 100.0
}
Get bill line item Endpoint POST /v1/bills/:id/line-item/
List bill line items Endpoint GET /v1/bills/:id/line-items/
Filters Query param Type Description account string
The id of the account.
Create bill line item Endpoint POST /v1/bills/:id/line-items/
Request body Attributes Type Description account string
The id of the account. description string
The description of the line item. quantity number
The quantity. tax_rate string
The id of the tax rate. unit_amount number
The unit amount.
Update bill line item PATCH /v1/bills/:id/line-items/:line_item_id/
Request body Attributes Type Description account string
The id of the account. description string
The description of the line item. quantity number
The quantity. tax_rate string
The id of the tax rate. unit_amount number
The unit amount.
Delete bill line item DELETE /v1/bills/:id/line-items/:line_item_id/