curl -X POST https://sandbox.layerfi.com/v1/businesses/{business_id}/invoices \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{
"external_id": "019234",
"sent_at": "2024-04-02T09:02:00Z",
"due_at": "2023-04-02T09:02:00Z",
"invoice_number": "1",
"customer_external_id": "customer-john-doe",
"line_items": [
{
"external_id": "invoice-line-item-1",
"product": "Cleaner Solution Pro",
"unit_price": 1299,
"quantity": 2,
"sales_taxes": [
{
"tax_account": {
"type": "Tax_Name",
"name": "CALIFORNIA_VAT"
},
"amount": 218
}
],
"tags": [
{
"key": "product-category",
"dimension_display_name": "Product Category",
"value": "test-value",
"value_display_name": "test-display-name"
}
]
},
{
"external_id": "invoice-line-item-2",
"product": "Full drain cleaning service",
"unit_price": 25000,
"quantity": 1,
"tags": [
{
"key": "product-category",
"dimension_display_name": "Product Category",
"value": "test-value",
"value_display_name": "test-display-name"
},
{
"key": "service-type",
"value": "service-value"
}
]
}
],
"additional_discount": 250,
"payments": [
{
"external_id": "payment-1",
"amount": 27466,
"method": "CREDIT_CARD",
"processor": "STRIPE",
"paid_at": "2024-04-02T09:02:00Z",
"fee": 825,
"tags": [
{
"key": "payment-channel",
"dimension_display_name": "Payment Channel",
"value": "online",
"value_display_name": "Online"
},
{
"key": "department",
"value": "sales"
}
]
}
],
"tags": [
{
"key": "region",
"dimension_display_name": "Region",
"value": "west-coast",
"value_display_name": "West Coast"
},
{
"key": "customer-segment",
"value": "enterprise"
}
]
}'
{
"data": {
"type": "Invoice",
"id": "6d0c298f-3e4e-4538-9a71-1d5359c22f71",
"business_id": "83d8fb80-31ee-4d57-b684-44b4aaa5e01f",
"external_id": "019234",
"status": "SENT",
"sent_at": "2024-04-02T09:02:00Z",
"due_at": "2023-04-02T09:02:00Z",
"paid_at": null,
"voided_at": null,
"invoice_number": "1",
"customer": {
"id": "a4c38874-8c01-4986-b8d0-4f159a52dd39",
"external_id": "customer-1",
"individual_name": null,
"company_name": null,
"email": null,
"mobile_phone": null,
"office_phone": null,
"address_string": null,
"notes": null,
"status": "ACTIVE"
},
"line_items": [
{
"id": "e6a491dd-9c22-4403-a54f-32d741a7ec67",
"external_id": "invoice-line-item-1",
"invoice_id": "6d0c298f-3e4e-4538-9a71-1d5359c22f71",
"account_identifier": null,
"description": null,
"product": "Cleaner Solution Pro",
"unit_price": 1299,
"quantity": "2.00",
"subtotal": 2598,
"discount_amount": 0,
"sales_taxes_total": 218,
"sales_taxes": [
{
"tax_account": {
"type": "Tax_Name",
"name": "CALIFORNIA_VAT"
},
"amount": 218
}
],
"total_amount": 2816
},
{
"id": "44f06385-3ef5-4517-8095-eeedaf2054ab",
"external_id": "invoice-line-item-2",
"invoice_id": "6d0c298f-3e4e-4538-9a71-1d5359c22f71",
"account_identifier": null,
"description": null,
"product": "Full drain cleaning service",
"unit_price": 25000,
"quantity": "1.00",
"subtotal": 25000,
"discount_amount": 0,
"sales_taxes_total": 0,
"total_amount": 25000
}
],
"subtotal": 27598,
"additional_discount": 250,
"additional_sales_taxes_total": 0,
"tips": 0,
"total_amount": 27566,
"outstanding_balance": 27566,
"payment_allocations": [],
"imported_at": "2024-04-19T02:23:59.902537Z",
"updated_at": null,
"transaction_tags": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"key": "department",
"value": "sales",
"dimension_display_name": "Department",
"value_display_name": "Sales Team",
"dimension_id": "d1e2f3a4-b5c6-7890-abcd-ef1234567890",
"definition_id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
"created_at": "2024-02-27T02:16:40.389772Z",
"updated_at": "2024-02-27T02:16:40.389772Z",
"deleted_at": null,
"archived_at": null
}
],
"metadata": {}
}
}
This endpoint imports an invoice for a business into Layer.
curl -X POST https://sandbox.layerfi.com/v1/businesses/{business_id}/invoices \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{
"external_id": "019234",
"sent_at": "2024-04-02T09:02:00Z",
"due_at": "2023-04-02T09:02:00Z",
"invoice_number": "1",
"customer_external_id": "customer-john-doe",
"line_items": [
{
"external_id": "invoice-line-item-1",
"product": "Cleaner Solution Pro",
"unit_price": 1299,
"quantity": 2,
"sales_taxes": [
{
"tax_account": {
"type": "Tax_Name",
"name": "CALIFORNIA_VAT"
},
"amount": 218
}
],
"tags": [
{
"key": "product-category",
"dimension_display_name": "Product Category",
"value": "test-value",
"value_display_name": "test-display-name"
}
]
},
{
"external_id": "invoice-line-item-2",
"product": "Full drain cleaning service",
"unit_price": 25000,
"quantity": 1,
"tags": [
{
"key": "product-category",
"dimension_display_name": "Product Category",
"value": "test-value",
"value_display_name": "test-display-name"
},
{
"key": "service-type",
"value": "service-value"
}
]
}
],
"additional_discount": 250,
"payments": [
{
"external_id": "payment-1",
"amount": 27466,
"method": "CREDIT_CARD",
"processor": "STRIPE",
"paid_at": "2024-04-02T09:02:00Z",
"fee": 825,
"tags": [
{
"key": "payment-channel",
"dimension_display_name": "Payment Channel",
"value": "online",
"value_display_name": "Online"
},
{
"key": "department",
"value": "sales"
}
]
}
],
"tags": [
{
"key": "region",
"dimension_display_name": "Region",
"value": "west-coast",
"value_display_name": "West Coast"
},
{
"key": "customer-segment",
"value": "enterprise"
}
]
}'
{
"data": {
"type": "Invoice",
"id": "6d0c298f-3e4e-4538-9a71-1d5359c22f71",
"business_id": "83d8fb80-31ee-4d57-b684-44b4aaa5e01f",
"external_id": "019234",
"status": "SENT",
"sent_at": "2024-04-02T09:02:00Z",
"due_at": "2023-04-02T09:02:00Z",
"paid_at": null,
"voided_at": null,
"invoice_number": "1",
"customer": {
"id": "a4c38874-8c01-4986-b8d0-4f159a52dd39",
"external_id": "customer-1",
"individual_name": null,
"company_name": null,
"email": null,
"mobile_phone": null,
"office_phone": null,
"address_string": null,
"notes": null,
"status": "ACTIVE"
},
"line_items": [
{
"id": "e6a491dd-9c22-4403-a54f-32d741a7ec67",
"external_id": "invoice-line-item-1",
"invoice_id": "6d0c298f-3e4e-4538-9a71-1d5359c22f71",
"account_identifier": null,
"description": null,
"product": "Cleaner Solution Pro",
"unit_price": 1299,
"quantity": "2.00",
"subtotal": 2598,
"discount_amount": 0,
"sales_taxes_total": 218,
"sales_taxes": [
{
"tax_account": {
"type": "Tax_Name",
"name": "CALIFORNIA_VAT"
},
"amount": 218
}
],
"total_amount": 2816
},
{
"id": "44f06385-3ef5-4517-8095-eeedaf2054ab",
"external_id": "invoice-line-item-2",
"invoice_id": "6d0c298f-3e4e-4538-9a71-1d5359c22f71",
"account_identifier": null,
"description": null,
"product": "Full drain cleaning service",
"unit_price": 25000,
"quantity": "1.00",
"subtotal": 25000,
"discount_amount": 0,
"sales_taxes_total": 0,
"total_amount": 25000
}
],
"subtotal": 27598,
"additional_discount": 250,
"additional_sales_taxes_total": 0,
"tips": 0,
"total_amount": 27566,
"outstanding_balance": 27566,
"payment_allocations": [],
"imported_at": "2024-04-19T02:23:59.902537Z",
"updated_at": null,
"transaction_tags": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"key": "department",
"value": "sales",
"dimension_display_name": "Department",
"value_display_name": "Sales Team",
"dimension_id": "d1e2f3a4-b5c6-7890-abcd-ef1234567890",
"definition_id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
"created_at": "2024-02-27T02:16:40.389772Z",
"updated_at": "2024-02-27T02:16:40.389772Z",
"deleted_at": null,
"archived_at": null
}
],
"metadata": {}
}
}
customer_id or the customer_external_id must be provided.customer_id or the customer_external_id must be provided.A customer does not need to be created before creating an invoice.
When you provide a customer external id, Layer will create a customer object with the provided external id if it does not already exist.
Customer details can be updated later using the Update a customer endpoint.Show InvoiceLineItem properties
Show TaxLineItem properties
Tax_Name or an AccountIdentifier object.
An Account Identifier can be used when a known specific ledger account is appropriate for a tax.
A Tax Name can be used to create and use tax categories dynamically.Show TagKeyValue properties
key will be displayed.value will be displayed.Show TaxLineItem properties
Tax_Name or an AccountIdentifier object.
An Account Identifier can be used when a known specific ledger account is appropriate for a tax.
A Tax Name can be used to create and use tax categories dynamaically.Show InvoicePayment properties
CASH, CHECK, CREDIT_CARD, ACH, CREDIT_BALANCE, OTHERShow InvoicePaymentFee properties
Show TagKeyValue properties
key will be displayed.value will be displayed.Show TagKeyValue properties
key will be displayed.value will be displayed.curl -X POST https://sandbox.layerfi.com/v1/businesses/{business_id}/invoices \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{
"external_id": "019234",
"sent_at": "2024-04-02T09:02:00Z",
"due_at": "2023-04-02T09:02:00Z",
"invoice_number": "1",
"customer_external_id": "customer-john-doe",
"line_items": [
{
"external_id": "invoice-line-item-1",
"product": "Cleaner Solution Pro",
"unit_price": 1299,
"quantity": 2,
"sales_taxes": [
{
"tax_account": {
"type": "Tax_Name",
"name": "CALIFORNIA_VAT"
},
"amount": 218
}
],
"tags": [
{
"key": "product-category",
"dimension_display_name": "Product Category",
"value": "test-value",
"value_display_name": "test-display-name"
}
]
},
{
"external_id": "invoice-line-item-2",
"product": "Full drain cleaning service",
"unit_price": 25000,
"quantity": 1,
"tags": [
{
"key": "product-category",
"dimension_display_name": "Product Category",
"value": "test-value",
"value_display_name": "test-display-name"
},
{
"key": "service-type",
"value": "service-value"
}
]
}
],
"additional_discount": 250,
"payments": [
{
"external_id": "payment-1",
"amount": 27466,
"method": "CREDIT_CARD",
"processor": "STRIPE",
"paid_at": "2024-04-02T09:02:00Z",
"fee": 825,
"tags": [
{
"key": "payment-channel",
"dimension_display_name": "Payment Channel",
"value": "online",
"value_display_name": "Online"
},
{
"key": "department",
"value": "sales"
}
]
}
],
"tags": [
{
"key": "region",
"dimension_display_name": "Region",
"value": "west-coast",
"value_display_name": "West Coast"
},
{
"key": "customer-segment",
"value": "enterprise"
}
]
}'
{
"data": {
"type": "Invoice",
"id": "6d0c298f-3e4e-4538-9a71-1d5359c22f71",
"business_id": "83d8fb80-31ee-4d57-b684-44b4aaa5e01f",
"external_id": "019234",
"status": "SENT",
"sent_at": "2024-04-02T09:02:00Z",
"due_at": "2023-04-02T09:02:00Z",
"paid_at": null,
"voided_at": null,
"invoice_number": "1",
"customer": {
"id": "a4c38874-8c01-4986-b8d0-4f159a52dd39",
"external_id": "customer-1",
"individual_name": null,
"company_name": null,
"email": null,
"mobile_phone": null,
"office_phone": null,
"address_string": null,
"notes": null,
"status": "ACTIVE"
},
"line_items": [
{
"id": "e6a491dd-9c22-4403-a54f-32d741a7ec67",
"external_id": "invoice-line-item-1",
"invoice_id": "6d0c298f-3e4e-4538-9a71-1d5359c22f71",
"account_identifier": null,
"description": null,
"product": "Cleaner Solution Pro",
"unit_price": 1299,
"quantity": "2.00",
"subtotal": 2598,
"discount_amount": 0,
"sales_taxes_total": 218,
"sales_taxes": [
{
"tax_account": {
"type": "Tax_Name",
"name": "CALIFORNIA_VAT"
},
"amount": 218
}
],
"total_amount": 2816
},
{
"id": "44f06385-3ef5-4517-8095-eeedaf2054ab",
"external_id": "invoice-line-item-2",
"invoice_id": "6d0c298f-3e4e-4538-9a71-1d5359c22f71",
"account_identifier": null,
"description": null,
"product": "Full drain cleaning service",
"unit_price": 25000,
"quantity": "1.00",
"subtotal": 25000,
"discount_amount": 0,
"sales_taxes_total": 0,
"total_amount": 25000
}
],
"subtotal": 27598,
"additional_discount": 250,
"additional_sales_taxes_total": 0,
"tips": 0,
"total_amount": 27566,
"outstanding_balance": 27566,
"payment_allocations": [],
"imported_at": "2024-04-19T02:23:59.902537Z",
"updated_at": null,
"transaction_tags": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"key": "department",
"value": "sales",
"dimension_display_name": "Department",
"value_display_name": "Sales Team",
"dimension_id": "d1e2f3a4-b5c6-7890-abcd-ef1234567890",
"definition_id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
"created_at": "2024-02-27T02:16:40.389772Z",
"updated_at": "2024-02-27T02:16:40.389772Z",
"deleted_at": null,
"archived_at": null
}
],
"metadata": {}
}
}
InvoicePayment object(s) in the payments field of the invoice. This allows you to create and invoice and specify the full payment information in a single API call.
This is equivalent to creating an invoice and then creating a payment fully allocated to that invoice.
InvoicePayment parametersCASH, CHECK, CREDIT_CARD, ACH, CREDIT_BALANCE, OTHERShow InvoicePaymentFee properties