_create-bills
Use the Create bills endpoint to create a new bill in your SMB customer's accounting software that represents the outstanding payment for goods or services purchased from a supplier.
- TypeScript
- Python
- C#
- Go
const billCreateResponse = await payablesClient.bills.create({
bill: {
supplierRef: {
id: supplierCreateResponse.supplier.id,
supplierName: supplierCreateResponse.supplier.supplierName,
},
issueDate: "2023-04-23T00:00:00",
dueDate: "2023-10-23T00:00:00",
lineItems: [
{
description: "Half day training - Microsoft Paint",
unitAmount: 1000.0,
quantity: 1,
totalAmount: 1000.0,
},
],
status: BillStatus.Open,
subTotal: 1000.0,
taxAmount: 200.0,
totalAmount: 1200.0,
amountDue: 1200.0,
},
companyId: companyId,
connectionId: connectionId,
});
bill_create_request = operations.CreateBillRequest(
bill=shared.Bill(
supplierRef: shared.SupplierRef(
id=supplier_create_response.supplier.id,
supplier_name=supplier_create_response.supplier.supplier_name
),
issueDate="2023-04-23T00:00:00",
dueDate="2023-10-23T00:00:00",
lineItems=[
shared.BillLineItem(
description="Half day training - Microsoft Paint",
unitAmount=1000.00,
quantity=1,
totalAmount=1000.00,
)
],
status=shared.BillStatus.OPEN,
subTotal=1000.00,
taxAmount=200.00,
totalAmount=1200.00,
amountDue=1200.00
),
company_id=company_id,
connection_id=connection_id,
)
bill_create_response = payables_client.bills.create(bill_create_request)
var billCreateResponse = await payablesClient.Bills.CreateAsync(new CreateBillRequest() {
Bill = new Bill() {
SupplierRef = new SupplierRef(){
Id = supplierCreateResponse.Supplier.Id,
SupplierName = supplierCreateResponse.Supplier.SupplierName
},
IssueDate = "2023-04-23T00:00:00",
DueDate = "2023-10-23T00:00:00",
LineItems = new List<BillLinItem>(){
new(){
Description = "Half day training - Microsoft Paint",
UnitAmount = 1000.00,
Quantity = 1,
TotalAmount = 1000.00,
}
},
Status: BillStatus.Open,
SubTotal: 1000.00,
TaxAmount: 200.00,
TotalAmount: 1200.00,
AmountDue: 1200.00
},
CompanyId = companyId,
ConnectionId = connectionId,
});
ctx := context.Background()
billCreateResponse, err := payablesClient.Bills.Create(ctx, operations.CreateBillRequest{
Bill: &shared.Bill{
SupplierRef: &shared.SupplierRef{
ID: supplierCreateResponse.Supplier.ID,
SupplierName: supplierCreateResponse.Supplier.SupplierName
},
IssueDate: "2023-04-23T00:00:00",
DueDate: "2023-06-23T00:00:00",
LineItems: []shared.BillLineItem{
shared.BillLineItem{
Description: "Half day training - Microsoft Paint",
Quantity: types.MustNewDecimalFromString("1"),
UnitAmount: types.MustNewDecimalFromString("1000.00"),
TotalAmount: types.MustNewDecimalFromString("1000.00"),
}
},
Status: shared.BillStatusOpen,
SubTotal: types.MustNewDecimalFromString("1000.00"),
TaxAmount: types.MustNewDecimalFromString("200.00"),
TotalAmount: types.MustNewDecimalFromString("1200.00"),
AmountDue: types.MustNewDecimalFromString("1200.00"),
},
CompanyID: companyID,
ConnectionID: connectionID,
})