Daftra API
DocsAll EndpointsDaftra Partners
DocsAll EndpointsDaftra Partners
  1. Estimates
  • Welcome
  • Getting Started
  • Authorization
  • authorization
    • Authenticate
      POST
  • Invoices
    • GET Single Invoice
      GET
    • Edit Invoices
      PUT
    • Delete Invoices
      DELETE
    • GET All Invoices
      GET
    • Add New Invoice
      POST
  • Estimates
    • GET Single Estimate
      GET
    • Edit Estimates
      PUT
    • Delete Estimates
      DELETE
    • GET All Estimates
      GET
    • Add New Estimate
      POST
  • Credit Notes
    • GET Single Credit Note
      GET
    • Edit Credit Notes
      PUT
    • Delete Credit Notes
      DELETE
    • GET All Credit Notes
      GET
    • Add New Credit Note
      POST
  • Refund Receipts
    • GET Single Refund Receipt
      GET
    • Edit Refund Receipts
      PUT
    • Delete Refund Receipts
      DELETE
    • GET All Refund Receipts
      GET
    • Add New Refund Receipt
      POST
  • Clients
    • GET Single Client
    • Edit Clients
    • Delete Clients
    • GET All Clients
    • Add New Client
  • Suppliers
    • GET Single Supplier
    • Edit Suppliers
    • Delete Suppliers
    • GET All Suppliers
    • Add New Supplier
  • Work Orders
    • GET Single Work Order
    • Edit Work Orders
    • Delete Work Orders
    • GET All Work Orders
    • Add New Work Order
  • Client Appointments
    • GET Single Client Appointment
    • Edit Client Appointments
    • Delete Client Appointments
    • GET All Client Appointments
    • Add New Client Appointment
  • Invoice Appointments
    • GET Single Invoice Appointment
    • Edit Invoice Appointments
    • Delete Invoice Appointments
    • GET All Invoice Appointments
    • Add New Invoice Appointment
  • Estimate Appointments
    • GET Single Estimate Appointment
    • Edit Estimate Appointments
    • Delete Estimate Appointments
    • GET All Estimate Appointments
    • Add New Estimate Appointment
  • Work Order Appointments
    • GET Single Work Order Appointment
    • Edit Work Order Appointments
    • Delete Work Order Appointments
    • GET All Work Order Appointments
    • Add New Work Order Appointment
  • Notes
    • GET Single Note
    • Edit Notes
    • Delete Notes
    • GET All Notes
    • Add New Note
  • Time Tracking
    • GET Single Time Tracking
    • Edit Time Tracking
    • Delete Time Tracking
    • GET All Time Tracking
    • Add New Time Tracking
  • Invoice Payments
    • GET Single Invoice Payment
    • Edit Invoice Payments
    • Delete Invoice Payments
    • GET All Invoice Payments
    • Add New Invoice Payment
  • Client Payments
    • GET Single Client Payment
    • Edit Client Payments
    • Delete Client Payments
    • GET All Client Payments
    • Add New Client Payment
  • Products
    • GET Single Product
    • Edit Products
    • Delete Products
    • GET All Products
    • Add New Product
  • Journals
    • GET Single Journal
    • Edit Journals
    • Delete Journals
    • GET All Journals
    • Add New Journal
  • Journal Accounts
    • GET Single Journal Account
    • Edit Journal Accounts
    • Delete Journal Accounts
    • GET All Journal Accounts
    • Add New Journal Account
  • Journal Cats
    • GET Single Journal Cat
    • Edit Journal Cats
    • Delete Journal Cats
    • GET All Journal Cats
    • Add New Journal Cat
  • Expenses
    • GET Single Expens
    • Edit Expenses
    • Delete Expenses
    • GET All Expenses
    • Add New Expens
  • Incomes
    • GET Single Income
    • Edit Incomes
    • Delete Incomes
    • GET All Incomes
    • Add New Income
  • Taxes
    • GET Single Taxe
    • Edit Taxes
    • Delete Taxes
    • GET All Taxes
    • Add New Taxe
  • Purchase Invoices
    • GET Single Purchase Invoice
    • Edit Purchase Invoices
    • Delete Purchase Invoices
    • GET All Purchase Invoices
    • Add New Purchase Invoice
  • Purchase Refunds
    • GET Single Purchase Refund
    • Edit Purchase Refunds
    • Delete Purchase Refunds
    • GET All Purchase Refunds
    • Add New Purchase Refund
  • Stock Transactions
    • GET Single Stock Transaction
    • Edit Stock Transactions
    • Delete Stock Transactions
    • GET All Stock Transactions
    • Add New Stock Transaction
  • Stores
    • GET Single Store
    • Edit Stores
    • Delete Stores
    • GET All Stores
    • Add New Store
  • Product Categories
    • GET Single Product Category
    • GET All Product Categories
  • Staff
    • GET Single Staff
    • GET All Staff
  • Client-attendance-log
    • Add New Client-attendance-log
  • Follow Up Actions
    • GET Single Follow Up Action
    • Delete Follow Up Action
    • GET All Follow Up Actions
  • Follow Up Statuses
    • GET Single Follow Up Status
    • Delete Follow Up Status
    • GET All Follow Up Statuses
  • General Listing
    • GET General Listing
  • Site
    • GET Site Info
  • Treasuries
    • GET Single Treasury
    • Edit Treasuries
    • Delete Treasuries
    • GET All Treasuries
    • Add New Treasury
  1. Estimates

Edit Estimates

Production
https://{{subdomain}}.daftra.com/api2
Production
https://{{subdomain}}.daftra.com/api2
PUT
https://{{subdomain}}.daftra.com/api2
/estimates/{id}{format}
Estimates
Request Request Example
Shell
JavaScript
Java
Swift
curl --location -g --request PUT 'https://.daftra.com/api2/estimates/' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer ' \
--header 'apikey: ' \
--header 'Content-Type: application/json' \
--data-raw '{
    "Estimate": {
        "staff_id": 0,
        "subscription_id": null,
        "store_id": 0,
        "no": "0700000AAAAA0001",
        "po_number": 26,
        "name": "string",
        "client_id": 15,
        "is_offline": true,
        "currency_code": "USD",
        "client_business_name": "Example Client",
        "client_first_name": "Example",
        "client_last_name": "Client",
        "client_email": "client@example.com",
        "client_address1": "string",
        "client_address2": "string",
        "client_postal_code": "string",
        "client_city": "string",
        "client_state": "string",
        "client_country_code": "EG",
        "date": "2018-11-07",
        "draft": "0",
        "discount": 0,
        "discount_amount": 0,
        "deposit": 0,
        "deposit_type": 0,
        "notes": "string",
        "html_notes": "string",
        "invoice_layout_id": 1,
        "estimate_id": "The primary store id",
        "shipping_options": "",
        "shipping_amount": null,
        "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",
        "follow_up_status": null,
        "work_order_id": null,
        "requisition_delivery_status": null,
        "pos_shift_id": null,
        "qr_code_url": "https://yoursite.daftra.com/qr/?d64=QVE1TmIyaGhiV1ZrSUVGemFISmhaZ0lJTVRFMU16WTJRMUlERkRJd01qSXRNVEF0TWpoVU1EQTZNREU2TVRWYUJBRXdCUUV3",
        "invoice_html_url": "https://yoursite.daftra.com/invoices/preview/2621?hash=c06543fe13bd4850b521733687c53259",
        "invoice_pdf_url": "https://yoursite.daftra.com/invoices/view/2621.pdf?hash=c06543fe13bd4850b521733687c53259"
    },
    "InvoiceItem": [
        {
            "invoice_id": 0,
            "item": "string",
            "description": "string",
            "unit_price": 0,
            "quantity": 0,
            "tax1": 0,
            "tax2": 0,
            "product_id": 0,
            "col_3": null,
            "col_4": null,
            "col_5": null,
            "discount": 0,
            "discount_type": "1 => Percentage",
            "store_id": "The invoice store id"
        }
    ],
    "InvoicePayment": [
        {
            "invoice_id": 0,
            "payment_method": "string",
            "amount": 0,
            "transaction_id": "string",
            "treasury_id": 0,
            "date": "2019-08-24T14:15:22Z",
            "email": "string",
            "status": 0,
            "notes": "string",
            "response_code": "string",
            "response_message": "string",
            "created": "2019-08-24T14:15:22Z",
            "modified": "2019-08-24T14:15:22Z",
            "currency_code": "str",
            "first_name": "string",
            "last_name": "string",
            "address1": "string",
            "address2": "string",
            "city": "string",
            "state": "string",
            "postal_code": "string",
            "country_code": "str",
            "phone1": "string",
            "phone2": "string",
            "transaction_type": "string",
            "processed": true,
            "attachment": "string",
            "staff_id": 0,
            "receipt_notes": "string"
        }
    ],
    "InvoiceCustomField": {},
    "Deposit": {},
    "InvoiceReminder": {},
    "Document": {},
    "DocumentTitle": {}
}'
Response Response Example
200 - Example 1
{
  "code": 200,
  "result": "successful"
}

Request

Path Params
id
string 
required
format
string 
required
Header Params
Accept
string 
optional
Default:
application/json
Content-Type
string 
optional
Default:
application/json
Authorization
string 
optional
You can generate the bearer token using the the authorization endpoint then use it here to be able to operate over your account's data
Default:
Bearer {{access_token}}
apikey
string 
deprecated
You can find/generate your apikey(s) from inside your Daftra Account
Default:
{{apikey}}
Body Params application/json
Estimate
object 
InvoiceBase
optional
staff_id
integer <int64>
optional
Staff ID who created the invoice get it from GET STAFF API if it's 0 that means the site owner is the staff that created it
Default:
0
Example:
0
subscription_id
integer <int64> | null 
optional
Invoice id which this invoice follows so when adding refund this field indicates which invoice is being refunded get the invoice ids from GET All Invoices API when this field is set to null that means that this invoice isn't a child of any invoice
Default:
null
Example:
26
store_id
integer <int64>
required
The store which this invoice uses get it from GET STORE API
Example:
0
no
string  | null 
optional
Invoice number, this field is auto generated but can be overridden
<= 255 characters
Example:
0700000AAAAA0001
po_number
string  | null 
optional
Purchase invoice number
<= 255 characters
Example:
26
name
string  | null 
optional
used in template and subscription only
<= 255 characters
client_id
integer <int64>
required
The client id get it from GET Client API
Example:
15
is_offline
boolean 
optional
!! 0 / 1 indicates if the client is offline
currency_code
string 
optional
Currency Code
<= 10 characters
Example:
USD
client_business_name
string 
optional
Client's business name
<= 100 characters
Example:
Example Client
client_first_name
string 
optional
Client's first name
<= 255 characters
Example:
Example
client_last_name
string 
optional
Client's last name
<= 255 characters
Example:
Client
client_email
string <email>
optional
Client's email
<= 255 characters
Example:
client@example.com
client_address1
string 
optional
Client's Address line 1
<= 255 characters
client_address2
string 
optional
Client's Address line 2
<= 255 characters
client_postal_code
string 
optional
Client's postal code
<= 20 characters
client_city
string 
optional
Client's City
<= 100 characters
client_state
string 
optional
Client's State
<= 100 characters
client_country_code
string 
optional
Client's country ISO "ALPHA-2" Code
<= 3 characters
Example:
EG
date
string <date>
optional
the date of the invoice
Example:
2018-11-07
draft
boolean 
optional
[0 => not draft,1 => draft]
Example:
0
discount
optional
discount percentage of the invoice ```note that this field alternate with discount_amount```` example to set 5% discount is set this field to 5 and discount_amount` field to 0
Default:
0
discount_amount
optional
absolute discount of the invoice ```note that this field alternate with discount```` example to set 5 USD discount is set this field to 5 and discount` field to 0
Default:
0
deposit
optional
Deposit amount
Default:
0
deposit_type
enum<integer> 
optional
Deposit Type
Allowed values:
0 => Unpaid1 => Unpaid2 => Paid
Default:
0
notes
string 
optional
Notes for the client
html_notes
string 
optional
html template notes
invoice_layout_id
integer <int64> | null 
optional
the layout for viewing this invoice get it from GET General Listing API with model InvoiceLayout if not set the default layout is used
Example:
1
estimate_id
integer <int64>
optional
The estimate of this invoice get it from GET Estimates API if it's not set the primary store is used
Default:
The primary store id
Example:
0
shipping_options
enum<integer> 
optional
Deposit Type
Allowed values:
'' => Auto1 => Don't show shipping options2 => Show the main client details3 => Show secondary client details
Default:
shipping_amount
null 
optional
Deposit amount
Default:
null
client_active_secondary_address
boolean 
optional
0/1 if the secondary data is active
client_secondary_name
string 
optional
Supplier's name
<= 255 characters
client_secondary_address1
string 
optional
Client's address line 1
<= 255 characters
client_secondary_address2
string 
optional
Client's address line 2
<= 255 characters
client_secondary_city
string 
optional
Client's City
<= 100 characters
client_secondary_state
string 
optional
Client's State
<= 100 characters
client_secondary_postal_code
string 
optional
Client's postal code
<= 50 characters
client_secondary_country_code
string 
optional
Client's country ISO "ALPHA-2" Code
<= 10 characters
follow_up_status
integer  | null 
optional
Follow Up Status get it from GET Follow up statuses with model invoice
Default:
null
work_order_id
integer  | null 
optional
Work Order ID get it from GET Work orders
Default:
null
requisition_delivery_status
enum<integer>  | enum<null> 
optional
Requisition delivery Status
Allowed values:
1 => Pending2 => Not All Available3 => Accepted4 => Cancelled5 => Modified
Default:
null
pos_shift_id
integer  | null 
optional
POS session id
Default:
null
qr_code_url
string 
optional
direct url for the QR Code image of that invoice for KSA Electronic Invoice only
Example:
https://yoursite.daftra.com/qr/?d64=QVE1TmIyaGhiV1ZrSUVGemFISmhaZ0lJTVRFMU16WTJRMUlERkRJd01qSXRNVEF0TWpoVU1EQTZNREU2TVRWYUJBRXdCUUV3
invoice_html_url
string 
optional
direct url that will return HTML code of the invoice
Example:
https://yoursite.daftra.com/invoices/preview/2621?hash=c06543fe13bd4850b521733687c53259
invoice_pdf_url
string 
optional
direct url to download pdf version of the invoice
Example:
https://yoursite.daftra.com/invoices/view/2621.pdf?hash=c06543fe13bd4850b521733687c53259
InvoiceItem
array [object {14}] 
optional
invoice_id
integer 
required
Invoice Ref #
item
string 
optional
Name of the product
description
string 
optional
Description of the item
unit_price
number <double>
required
Unit price of the item
quantity
integer <int32>
required
Quantity of the item in the order
tax1
integer 
optional
Tax 1 id applied on this item get if from GET Taxes
tax2
integer 
optional
Tax 2 id applied on this item get if from GET Taxes
product_id
integer <int32>
required
Product Ref # get it from GET Products
col_3
string  | null 
optional
additional data to be appear in the invoice layout
Default:
null
col_4
string  | null 
optional
additional data to be appear in the invoice layout
Default:
null
col_5
string  | null 
optional
additional data to be appear in the invoice layout
Default:
null
discount
number <double>
optional
discount amount
discount_type
enum<integer> 
optional
discount type
Allowed values:
1 => Percentage2 => Absolute
store_id
integer <int64>
optional
The store which this item belongs to get it from GET STORE API if it's not set the invoice store is used
Default:
The invoice store id
Example:
0
InvoicePayment
array[object (PaymentBase) {29}] 
optional
invoice_id
integer <int64>
required
Invoice REF#, you can get it through the Invoices API
payment_method
string 
required
Method of payment
<= 100 characters
amount
number <double>
required
Amount paid
transaction_id
string 
optional
Visual identifier for the process
<= 100 characters
treasury_id
integer 
optional
Treasury Ref get it from GET Treasuries
date
string <date-time>
optional
date of the payment
email
string 
optional
Optional Email
<= 255 characters
status
integer <int32>
optional
Status of the payment 0=>failded, 1=>completed , 2=>pending, 3=>not completed
notes
string 
optional
Notes for payment
response_code
string 
optional
Response code of the API called ex:(stripe , paypal , .. )
response_message
string 
optional
Response message of the API called ex:(stripe , paypal , .. )
created
string <date-time>
optional
Time of creation for the client
modified
string <date-time>
optional
Last Time this Payment was updated
currency_code
string 
optional
3 Digit currency code following ISO 4217 standard
<= 3 characters
first_name
string 
optional
First Name (Extra Info)
<= 255 characters
last_name
string 
optional
Last name (Extra Info)
<= 255 characters
address1
string 
optional
Address line 1 (Extra Info)
<= 255 characters
address2
string 
optional
Address line 2 (Extra Info)
<= 255 characters
city
string 
optional
City (Extra Info)
<= 255 characters
state
string 
optional
State (Extra Info)
<= 100 characters
postal_code
string 
optional
Postal code (Extra Info)
<= 10 characters
country_code
string 
optional
Country ISO "ALPHA-2" Code (Extra Info)
<= 3 characters
phone1
string 
optional
Phone number (Extra Info)
<= 50 characters
phone2
string 
optional
Mobile number (Extra Info)
<= 50 characters
transaction_type
string 
optional
!!
<= 255 characters
processed
boolean 
optional
0/1 if the payment is processed
attachment
string 
optional
Link for the attachment
<= 255 characters
staff_id
integer <int32>
optional
Staff user submitting the request get it from GET STAFF API if it's 0 that means the site owner is the staff that created it
receipt_notes
string 
optional
Notes for the receipt .
InvoiceCustomField
object 
optional
Deposit
object 
optional
InvoiceReminder
object 
optional
Document
object 
optional
DocumentTitle
object 
optional
Examples

Responses

🟢200OK
application/json
OK
Body
code
integer 
optional
Example:
200
result
string 
optional
Example:
successful
🟠400Bad Request
🟠401Unauthorized
🟠403Forbidden
🟠404Record Not Found
Previous
GET Single Estimate
Next
Delete Estimates