customer_id to link to an existing customer (customer data will be auto-filled)customer_email and customer_name to create/find customer automaticallyproduct_id (description and price will be auto-filled)description and unit_price for ad-hoc itemstax_rate as a percentage (0-100)tax_amount = amount * (tax_rate / 100)total_amount = amount + tax_amountcurl --location --request POST 'https://api.jokoor.com/v1/pay/invoices' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"customer_id": "cus_abc123",
"currency": "GMD",
"tax_rate": 15,
"due_date": "2024-12-31T23:59:59Z",
"notes": "Payment due within 30 days",
"items": [
{
"product_id": "prod_xyz789",
"quantity": 2
},
{
"description": "Consulting services",
"unit_price": "500.00",
"quantity": 5
}
]
}'{
"data": {
"id": "string",
"invoice_number": "string",
"customer_id": "string",
"customer_email": "user@example.com",
"customer_name": "string",
"customer_address": "string",
"customer_phone": "string",
"amount": "1000.00",
"tax_rate": 15,
"tax_amount": "150.00",
"total_amount": "1150.00",
"paid_amount": "500.00",
"remaining_amount": "650.00",
"currency": "GMD",
"status": "draft",
"payment_status": "unpaid",
"due_date": "2019-08-24T14:15:22Z",
"issued_date": "2019-08-24T14:15:22Z",
"paid_date": "2019-08-24T14:15:22Z",
"sent_at": "2019-08-24T14:15:22Z",
"sent_count": 0,
"notes": "string",
"items": [
{
"product_id": "string",
"description": "string",
"quantity": 0,
"unit_price": "string",
"total": "string"
}
],
"payment_url": "string",
"pdf_url": "string",
"receipts": [
{
"id": "string",
"receipt_number": "string",
"receipt_url": "string",
"amount": "string",
"payment_date": "2019-08-24T14:15:22Z",
"status": "string"
}
],
"metadata": {},
"subscription_id": "string",
"mode": "test",
"livemode": true,
"version": 0,
"organization": {
"id": "string",
"name": "string",
"logo_url": "string"
},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
}