Daftra API
All Endpoints
Daftra PartnersDevelopers Portal
All Endpoints
Daftra PartnersDevelopers Portal
  1. Invoices
  • Welcome
  • Getting Started
  • Validation Errors
  • Authorization
    • How To Authorize
    • Generate Access Token
  • Endpoints v1
    • Site
      • GET Site Info
    • Sales
      • Invoices
        • GET All Invoices
          GET
        • GET Single Invoice
          GET
        • Edit Invoices
          PUT
        • Delete Invoices
          DELETE
        • Add New Invoice
          POST
        • Bulk Add Invoices
          POST
        • Convert Sales Order to Invoice
          POST
        • Delete Sales Order
          DELETE
      • Subsciptions
        • List Subscriptions
        • View Subscription
        • Create Subscription
        • Edit Subscription
        • Delete Subscription
      • Estimates
        • GET All Estimates
        • GET Single Estimate
        • Add New Estimate
        • Edit Estimates
        • Delete Estimates
      • Credit Notes
        • GET All Credit Notes
        • GET Single Credit Note
        • Add New Credit Note
        • Edit Credit Notes
        • Delete Credit Notes
      • Refund Receipts
        • GET All Refund Receipts
        • GET Single Refund Receipt
        • Add New Refund Receipt
        • Edit Refund Receipts
        • Delete Refund Receipts
        • Bulk Add Refund Receipts
      • Invoice Payments
        • GET All Invoice Payments
        • GET Single Invoice Payment
        • Add New Invoice Payment
        • Edit Invoice Payments
        • Delete Invoice Payments
      • Invoice Appointments
        • GET All Invoice Appointments
        • GET Single Invoice Appointment
        • Add New Invoice Appointment
        • Edit Invoice Appointments
        • Delete Invoice Appointments
      • Advance Payment Invoices
        • GET All Advance payment
        • GET Single Advance payment
        • Add Advance Payment
      • Estimate Appointments
        • GET All Estimate Appointments
        • GET Single Estimate Appointment
        • Add New Estimate Appointment
        • Edit Estimate Appointments
        • Delete Estimate Appointments
        • Update Estimate Appointment (POST alias)
      • Notes
        • GET All Notes
        • GET Single Note
        • Add New Note
        • Edit Notes
        • Delete Notes
      • Shipping Options
        • List Shipping Options
      • POS
        • Get POS Shift Session
    • Clients
      • Clients
        • GET All Clients
        • GET Single Client
        • Add New Client
        • Edit Clients
        • Delete Clients
        • Assign Staff To Client
        • Client Loyalty Points
        • Bulk Add Clients
        • Client Has Membership
        • Client Attendance By Barcode
      • Client Appointments
        • GET All Client Appointments
        • GET Single Client Appointment
        • Add New Client Appointment
        • Edit Client Appointments
        • Delete Client Appointments
      • Client Payments
        • GET All Client Payments
        • GET Single Client Payment
        • Add New Client Payment
        • Edit Client Payments
        • Delete Client Payments
      • Client-attendance-log
        • Add New Client-attendance-log
    • Booking
      • Add new Booking
      • Change Booking Status
      • Convert booking to Invoice
      • Get All Bookings
      • Get Single Booking
      • Delete booking
    • Work Orders
      • Work Orders
        • GET All Work Orders
        • GET Single Work Order
        • Add New Work Order
        • Edit Work Orders
        • Delete Work Orders
      • Work Order Appointments
        • GET All Work Order Appointments
        • GET Single Work Order Appointment
        • Add New Work Order Appointment
        • Edit Work Order Appointments
        • Delete Work Order Appointments
        • Update Work Order Appointment (POST alias)
    • Inventory
      • Products
        • GET All Products
        • GET Single Product
        • Add New Product
        • Edit Products
        • Delete Products
        • List Brands
      • Requsitions
        • GET All Requisitions
        • GET single Requisition
        • Add New Requisition
        • Edit Requisitions
        • Delete Requisitions
        • Trigger Requisition Update
      • Product Categories
        • GET All Product Categories
        • GET Single Product Category
        • Add New Product Category
        • Edit Product Category
        • Delete Product Category
        • Update Category Display Order
        • Update Category Items
      • Stores
        • GET All Stores
        • GET Single Store
        • Add New Store
        • Edit Stores
        • Delete Stores
      • Stock Transactions
        • GET All Stock Transactions
        • GET Single Stock Transaction
        • Add New Stock Transaction
        • Edit Stock Transactions
        • Delete Stock Transactions
    • Accounting
      • Journals
        • GET All Journals
        • GET Single Journal
        • Edit Journals
        • Delete Journals
        • Add New Journal
      • Journal Accounts
        • GET All Journal Accounts
        • GET Single Journal Account
        • Add New Journal Account
        • Edit Journal Accounts
        • Delete Journal Accounts
      • Journal Cats
        • GET All Journal Cats
        • GET Single Journal Cat
        • Add New Journal Cat
        • Edit Journal Cats
        • Delete Journal Cats
    • Finance
      • Incomes
        • GET All Incomes
        • GET Single Income
        • Add New Income
        • Edit Incomes
        • Delete Incomes
      • Treasuries
        • GET All Treasuries
        • GET Single Treasury
        • Add New Treasury
        • Edit Treasuries
        • Delete Treasuries
      • Expenses
        • GET All Expenses
        • GET Single Expens
        • Add New Expens
        • Edit Expenses
        • Delete Expenses
    • Taxes
      • GET All Taxes
      • GET Single Taxe
      • Add New Taxe
      • Edit Taxes
      • Delete Taxes
    • Purchases
      • Purchase Refunds
        • GET All Purchase Refunds
        • GET Single Purchase Refund
        • Add New Purchase Refund
        • Edit Purchase Refunds
        • Delete Purchase Refunds
      • Purchase Invoices
        • GET All Purchase Invoices
        • GET Single Purchase Invoice
        • Add New Purchase Invoice
        • Edit Purchase Invoices
        • Delete Purchase Invoices
      • Purchase Orders
        • GET All Purchase Orders
        • GET Single Purchase Order
        • Add New Purchase Order
        • Edit Purchase Order
        • Delete Purchase Order
      • Suppliers
        • GET All Suppliers
        • GET Single Supplier
        • Add New Supplier
        • Edit Suppliers
        • Delete Suppliers
    • Staff
      • GET Single Staff
      • GET All Staff
    • Time Tracking
      • GET All Time Tracking
      • GET Single Time Tracking
      • Edit Time Tracking
      • Delete Time Tracking
      • Add New Time Tracking
    • General Listing
      • GET General Listing
  • Endpoints v2
    • What's New
      • API Improvements
      • Filtering
      • Using API v2
        • Endpoints Structure
        • Data Fetching — Filtered
    • HR
      • Leave Application
        • Get All Leave Applications
        • Get Single Leave Applications
        • Add Leave Application
        • Edit Leave Application
      • Attendance Logs
        • Get All Attendance Logs
        • Get Single Attendance Log
        • Add Attendance Log
    • Purchase Debit Note
      • Purchase Debit Note
      • Purchase Debit Note
    • Branches
      • Get All Branches
    • Product Bundles
      • Add Product bundle
    • Brands
      • Get All Brands
      • Get Single Brand
      • Add New Brand
      • Edit brand
    • Unit Templates
      • Get All Unit Templates
      • Get Single Unit Template
      • Add Unit Template
      • Edit Unit Template
    • Follow-Up Status
      • Get All Follow-Up Statuses
      • Get Single Follow-Up Status
      • Add New Follow-Up Status
      • Delete Follow-Up Status
      • Get All Follow-Up Statuses by type
    • Follow-Up Action
      • Get All Follow-Up Actions
      • Get Single Follow-Up Action
      • Delete Follow-Up Action
    • Cost Centers
      • Get All Cost Centers
      • Get Single Cost Center
      • Add New Cost Center
      • Edit Cost Center
    • Payment Gateways
      • Get All Payment Methods
      • Get Single Payment Method
      • Add Payment Method
    • Points & Credits
      • Credit Usage
        • Get All Credit Usage
        • Get Single Credit Usage
        • Add New Credit Usage
        • Add Credit Usage Amount
        • Edit Credit Usage
        • Edit Credit Usage Amount
        • Get All Credit Usage Amount
        • Get Single Credit Usage Amount
      • Credit Types
        • Get All Credit types
        • Get Single Credit type
        • Add New Credit type
        • Edit Credit type
      • Credit Charges
        • Get All Credit Charges
        • Get Single Credit Charge
        • Add New Credit Charge
        • Edit Credit Charge
      • Packages
        • Get All Packages
        • Get Single Package
        • Add New Package
        • Edit Package
      • Packages Credit Types
        • Get All Package Credit Types
        • Get Single Package Credit Type
        • Add Package Credit Type
        • Edit Package Credit Type
    • Workflow
      • Get All Records
      • Get Single Record
      • Add New Record
      • Edit Record
    • Multity entity request
      • Overview
      • Multy Entity Request
    • Employee Asset
      • Asset Type
        • Get All Types
        • Get Single Type
        • Add New Type
        • Edit Type
      • Asset Location
        • Get All Locations
        • Get Single Location
        • Add New Location
        • Edit Location
      • Asset Storage
        • Get All Storages
        • Get Single Storage
        • Add New Storage
        • Edit Storage
      • Asset
        • Get All Assets
        • Get Single Asset
        • Add New Asset
        • Edit Asset
    • Organizational Structure
      • Designation
        • Get All Designations
        • Get Single Designation
        • Add New Designation
        • Edit Designation
      • Department
        • Get All Departments
        • Get Single Department
        • Add New Department
        • Edit Department
      • Employment Type
        • Get All Employment Types
        • Get Single Employment Type
        • Add New Employment Type
        • Edit Employment Type
    • Follow-Up Statuses
    • Entities
      • List entity records
      • View entity record
      • Create entity record
      • Update entity record
      • Delete entity record
  • Developers Portal
    • Introduction & Getting Started
    • Dashboard, Earnings & Withdrawals
    • Creating a New App
    • App Configuration
    • Managing Your App
    • Entities: Modeling Your Data
    • The Entity Builder
    • Buttons & Page Scripts
    • Integrations: Webhooks
    • Invitations, Publishing & Reviews
    • Check App Status
  1. Invoices

Edit Invoices

Production
https://{{subdomain}}.daftra.com/api2
Production
https://{{subdomain}}.daftra.com/api2
PUT
https://{{subdomain}}.daftra.com/api2
/invoices/{id}{format}
Edit an existing standard invoice by id. Send via PUT /invoices/{id} (or POST /invoices/{id}) with the full invoice payload — submitted line items, payments and custom fields replace the existing ones.
The invoice cannot be edited (returns 400 or 404) when it: is on a different branch than it was created on; has a valid (accepted) electronic invoice; has related credit charges, installment agreements or membership/credit renewals; falls in a closed financial period (non-draft); is tied to a closed POS shift; has a received requisition; or is selected in a production plan.
Requires edit permission — all-invoices edit access, or being the invoice's own staff with edit-own access.

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Path Params

Header Params

Body Params application/json

Examples

Responses

🟢200OK
application/json
OK
Bodyapplication/json

🟠400Bad Request
🟠401Unauthorized
🟠403Forbidden
🟠404Record Not Found
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --globoff --request PUT 'https://.daftra.com/api2/invoices/' \
--header 'Accept: application/json' \
--header 'apikey: ' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "Invoice": {
        "client_id": 15,
        "type": 0,
        "store_id": 0,
        "staff_id": 0,
        "subscription_id": 0,
        "no": "0700000AAAAA0001",
        "po_number": "string",
        "name": "string",
        "branch_id": 0,
        "is_offline": true,
        "currency_code": "USD",
        "client_currency_code": "string",
        "date": "2026-06-17",
        "issue_date": "2019-08-24",
        "due_after": 0,
        "draft": false,
        "discount": 0,
        "discount_amount": 0,
        "deposit": 0,
        "deposit_type": 0,
        "shipping_options": 0,
        "shipping_amount": 0,
        "notes": "string",
        "terms": "string",
        "html_notes": "string",
        "invoice_layout_id": 0,
        "estimate_id": 0,
        "order_source_id": 0,
        "language_id": 0,
        "date_format": "string",
        "cost_center_id": 0,
        "sales_person_id": 0,
        "terminal_id": "string",
        "unique_id": "string",
        "pos_shift_id": 0,
        "follow_up_status": 0,
        "work_order_id": 0,
        "requisition_delivery_status": 0,
        "source_type": 0,
        "source_id": 0,
        "client_business_name": "string",
        "client_first_name": "string",
        "client_last_name": "string",
        "client_email": "user@example.com",
        "client_address1": "string",
        "client_address2": "string",
        "client_postal_code": "string",
        "client_city": "string",
        "client_state": "string",
        "client_country_code": "EG",
        "client_active_secondary_address": true,
        "client_secondary_name": "string",
        "client_secondary_address1": "string",
        "client_secondary_address2": "string",
        "client_secondary_city": "string",
        "client_secondary_state": "string",
        "client_secondary_postal_code": "string",
        "client_secondary_country_code": "string"
    },
    "InvoiceItem": [
        {
            "item": "string",
            "description": "string",
            "unit_price": 0,
            "quantity": 0,
            "tax1": 0,
            "tax2": 0,
            "product_id": 0,
            "discount": 0,
            "discount_type": 0,
            "store_id": 0,
            "lot": [
                "string"
            ],
            "expiry_date": [
                "2019-08-24"
            ],
            "serials": [
                "string"
            ]
        }
    ],
    "Payment": [
        {
            "payment_method": "string",
            "amount": 0,
            "transaction_id": "string",
            "treasury_id": 0,
            "date": "string",
            "staff_id": 0,
            "email": "user@example.com"
        }
    ],
    "InvoiceCustomField": {},
    "Deposit": {},
    "InvoiceReminder": {},
    "Document": {},
    "DocumentTitle": {}
}'
Response Response Example
200 - Example 1
{
    "code": 200,
    "result": "successful"
}
Previous
GET Single Invoice
Next
Delete Invoices