curl --location --request POST 'https://api.stateset.com/v1/invoices' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data-raw '{
"customer_id": "cust_abc123",
"issue_date": "2024-01-19",
"due_date": "2024-02-18",
"currency": "USD",
"line_items": [
{
"description": "Professional Services - January 2024",
"quantity": 40,
"unit_price": 15000,
"tax_rate": 0.08
},
{
"description": "Software License",
"quantity": 5,
"unit_price": 9900,
"product_id": "prod_xyz789"
}
],
"payment_terms": "Net 30",
"send_email": true
}'
{
"id": "inv_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"object": "invoice",
"invoice_number": "INV-2024-0001",
"status": "sent",
"customer_id": "cust_abc123",
"issue_date": "2024-01-19",
"due_date": "2024-02-18",
"currency": "USD",
"subtotal": 649500,
"tax_amount": 48000,
"total_amount": 697500,
"amount_due": 697500,
"amount_paid": 0,
"line_items": [
{
"id": "li_123456",
"description": "Professional Services - January 2024",
"quantity": 40,
"unit_price": 15000,
"amount": 600000,
"tax_rate": 0.08,
"tax_amount": 48000
},
{
"id": "li_123457",
"description": "Software License",
"quantity": 5,
"unit_price": 9900,
"amount": 49500,
"product_id": "prod_xyz789",
"tax_rate": 0,
"tax_amount": 0
}
],
"payment_terms": "Net 30",
"created_at": "2024-01-19T10:00:00Z",
"sent_at": "2024-01-19T10:01:00Z",
"pdf_url": "https://invoices.stateset.com/inv_0901f083-aa1c-43c5-af5c-0a9d2fc64e30.pdf"
}
Create an invoice for billing customers
curl --location --request POST 'https://api.stateset.com/v1/invoices' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data-raw '{
"customer_id": "cust_abc123",
"issue_date": "2024-01-19",
"due_date": "2024-02-18",
"currency": "USD",
"line_items": [
{
"description": "Professional Services - January 2024",
"quantity": 40,
"unit_price": 15000,
"tax_rate": 0.08
},
{
"description": "Software License",
"quantity": 5,
"unit_price": 9900,
"product_id": "prod_xyz789"
}
],
"payment_terms": "Net 30",
"send_email": true
}'
{
"id": "inv_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"object": "invoice",
"invoice_number": "INV-2024-0001",
"status": "sent",
"customer_id": "cust_abc123",
"issue_date": "2024-01-19",
"due_date": "2024-02-18",
"currency": "USD",
"subtotal": 649500,
"tax_amount": 48000,
"total_amount": 697500,
"amount_due": 697500,
"amount_paid": 0,
"line_items": [
{
"id": "li_123456",
"description": "Professional Services - January 2024",
"quantity": 40,
"unit_price": 15000,
"amount": 600000,
"tax_rate": 0.08,
"tax_amount": 48000
},
{
"id": "li_123457",
"description": "Software License",
"quantity": 5,
"unit_price": 9900,
"amount": 49500,
"product_id": "prod_xyz789",
"tax_rate": 0,
"tax_amount": 0
}
],
"payment_terms": "Net 30",
"created_at": "2024-01-19T10:00:00Z",
"sent_at": "2024-01-19T10:01:00Z",
"pdf_url": "https://invoices.stateset.com/inv_0901f083-aa1c-43c5-af5c-0a9d2fc64e30.pdf"
}
invoices:write
permissions.
Authorization: Bearer YOUR_API_KEY
Show Line item properties
curl --location --request POST 'https://api.stateset.com/v1/invoices' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data-raw '{
"customer_id": "cust_abc123",
"issue_date": "2024-01-19",
"due_date": "2024-02-18",
"currency": "USD",
"line_items": [
{
"description": "Professional Services - January 2024",
"quantity": 40,
"unit_price": 15000,
"tax_rate": 0.08
},
{
"description": "Software License",
"quantity": 5,
"unit_price": 9900,
"product_id": "prod_xyz789"
}
],
"payment_terms": "Net 30",
"send_email": true
}'
{
"id": "inv_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"object": "invoice",
"invoice_number": "INV-2024-0001",
"status": "sent",
"customer_id": "cust_abc123",
"issue_date": "2024-01-19",
"due_date": "2024-02-18",
"currency": "USD",
"subtotal": 649500,
"tax_amount": 48000,
"total_amount": 697500,
"amount_due": 697500,
"amount_paid": 0,
"line_items": [
{
"id": "li_123456",
"description": "Professional Services - January 2024",
"quantity": 40,
"unit_price": 15000,
"amount": 600000,
"tax_rate": 0.08,
"tax_amount": 48000
},
{
"id": "li_123457",
"description": "Software License",
"quantity": 5,
"unit_price": 9900,
"amount": 49500,
"product_id": "prod_xyz789",
"tax_rate": 0,
"tax_amount": 0
}
],
"payment_terms": "Net 30",
"created_at": "2024-01-19T10:00:00Z",
"sent_at": "2024-01-19T10:01:00Z",
"pdf_url": "https://invoices.stateset.com/inv_0901f083-aa1c-43c5-af5c-0a9d2fc64e30.pdf"
}