Test Invoice
Create a new Invoice example
Authentication Notes
The Api-Key
is already automatically added to the headers, so no authentication type required.
If you want to choose your preferred authentication type, follow these steps:
- Deselect the
Api-Key
header and choose one of the following:- For
ApiKeyAuth
, use:Api-Key vSUmxsXx.V81oYvOWFMcIywaOu57Utx6VSCmG11lo
. - For
BasicAuth
, provide your valid username and password. - For
JWT Auth
, include your token in the format:Bearer <your_token>
.
- For
Authorizations
Header parameters
AuthorizationstringRequiredDefault:
Private API key to be provided in the format Api-Key <key>
.
Api-Key vSUmxsXx.V81oYvOWFMcIywaOu57Utx6VSCmG11lo
Body
Serializer class for Invoice
instances, inheriting from BaseInvoiceSerializer
and
CheckoutSerializer
. It provides methods for creating invoices, invoice items, and transactions.
currency_codestring · min: 1Required
due_datestring · dateRequired
invoice_numberstring · min: 1 · max: 255Required
pg_codesstring[]Required
typestring · enumRequiredPossible values:
e_commerce
- Ecommercepayment_request
- Payment Request
Responses
201Success
application/json
400Error
application/json
post
POST /b/invoice/v1/invoice/ HTTP/1.1
Host: betabulk.ottu.net
Authorization: Api-Key vSUmxsXx.V81oYvOWFMcIywaOu57Utx6VSCmG11lo
Content-Type: application/json
Accept: */*
Content-Length: 237
{
"type": "payment_request",
"due_date": "2024-12-29",
"currency_code": "KWD",
"pg_codes": [
"knet",
"mpgs"
],
"invoice_number": "<add `invoice_number` here>",
"invoice_items": [
{
"sku": "ABC111",
"description": "Tea",
"quantity": 1.111,
"unit_price": 0.234
}
]
}
{
"currency_code": "text",
"due_date": "2025-06-27",
"invoice_items": [
{
"id": 1,
"invoice": 1,
"sku": "text",
"description": "text",
"quantity": "text",
"unit_price": "text",
"tax_rate": "text",
"tax_amount": "text",
"discount_percentage": "text",
"discount_amount": "text",
"total_excl_tax": "text",
"total_incl_tax": "text",
"currency_code": "text"
}
],
"invoice_number": "text",
"pg_codes": [
"text"
],
"type": "e_commerce",
"billing_address": {
"line1": "text",
"line2": "text",
"city": "text",
"state": "text",
"country": "AF",
"postal_code": "text"
},
"shipping_address": {
"line1": "text",
"line2": "text",
"city": "text",
"state": "text",
"country": "AF",
"postal_code": "text",
"first_name": "text",
"last_name": "text",
"email": "name@gmail.com",
"phone": "text"
},
"agreement": {
"id": "text",
"amount_variability": "fixed",
"start_date": "2025-06-27",
"expiry_date": "2025-06-27",
"max_amount_per_cycle": "text",
"cycle_interval_days": 1,
"total_cycles": 1,
"frequency": "irregular",
"type": "recurring",
"seller": {
"name": "text",
"short_name": "text",
"category_code": "text"
},
"extra_params": {
"payment_processing_day": 1
}
},
"amount": "text",
"attachment": "https://example.com",
"attachment_short_url": "https://example.com",
"attachment_upload_url": "text",
"card_acceptance_criteria": {
"min_expiry_time": 1
},
"checkout_short_url": "https://example.com",
"checkout_url": "https://example.com",
"company_name": "text",
"customer_email": "name@gmail.com",
"customer_first_name": "text",
"customer_id": "text",
"customer_last_name": "text",
"customer_phone": "text",
"discount_amount": "text",
"discount_percentage": "text",
"due_datetime": "2025-06-27T11:21:26.278Z",
"email_recipients": [
"name@gmail.com"
],
"expiration_time": "text",
"initiator_id": 1,
"invoice_id": 1,
"language": "en",
"notifications": {
"email": [
"created"
],
"sms": [
"created"
],
"whatsapp": [
"created"
]
},
"operation": "text",
"order_no": "text",
"payment_methods": {
"code": "text",
"name": "text",
"pg": "text",
"type": "e_commerce",
"amount": "text",
"currency_code": "text",
"fee": "text",
"fee_description": "text",
"icon": "https://example.com",
"flow": "redirect",
"redirect_url": "https://example.com"
},
"payment_type": "one_off",
"product_type": "text",
"qr_code_url": "https://example.com",
"redirect_url": "https://example.com",
"sdk_setup_preload_payload": false,
"session_id": "text",
"settled_pg_code": "text",
"shipping_excl_tax": "text",
"shipping_incl_tax": "text",
"shipping_method": "text",
"shipping_tax_rate": "text",
"state": "created",
"status": "sent",
"subtotal": "text",
"tax_amount": "text",
"tax_rate": "text",
"total_excl_tax": "text",
"total_incl_tax": "text",
"vendor_name": "text",
"webhook_url": "https://example.com"
}
Last updated