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

Edit Products

Production
https://{{subdomain}}.daftra.com/api2
Production
https://{{subdomain}}.daftra.com/api2
PUT
https://{{subdomain}}.daftra.com/api2
/products/{id}{format}
Products
Request Request Example
Shell
JavaScript
Java
Swift
curl --location -g --request PUT 'https://.daftra.com/api2/products/' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer ' \
--header 'apikey: ' \
--header 'Content-Type: application/json' \
--data-raw '{
    "Product": {
        "staff_id": 0,
        "name": "string",
        "description": "string",
        "unit_price": 0,
        "tax1": 0,
        "tax2": 0,
        "supplier_id": 0,
        "brand": "string",
        "category": "string",
        "tags": "string",
        "buy_price": 0,
        "product_code": "string",
        "track_stock": true,
        "stock_balance": 0,
        "low_stock_thershold": 0,
        "barcode": "string",
        "notes": "string",
        "status": 0,
        "follow_up_status": null,
        "updated_price": true,
        "average_price": 0,
        "type": null,
        "minimum_price": null,
        "profit_margin": null,
        "discount": null,
        "discount_type": null,
        "duration_minutes": 0,
        "availabe_online": 0,
        "raw_store_id": null
    }
}'
Response Response Example
200 - Example 1
{
    "code": 200,
    "result": "successful"
}

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
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
Product
object 
ProductBase
optional
staff_id
integer <int64>
optional
Staff ID who created the product 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
name
string 
optional
Name of the product
<= 255 characters
description
string 
optional
Description of the product
unit_price
number <double>
optional
Price of 1 unit of this product
tax1
integer <int32>
optional
First Tax ID get it from GET Taxes API
tax2
integer <int32>
optional
Second Tax ID get it from GET Taxes API
supplier_id
integer <int32>
optional
Supplier REF#, you can get it through the GET Taxes API
brand
string 
optional
Brand ® name of the product
<= 255 characters
category
string 
deprecated
Category of the product
<= 255 characters
tags
string 
optional
Tags for the product ( comma separated string values ex: tag1 , tag2, .. )
buy_price
number <double>
optional
Buy price of the product
product_code
string 
optional
Numberic code for the product
<= 255 characters
track_stock
boolean 
optional
0/1 if to track the stock of product (Must have Inventory plugin active).
stock_balance
number <double>
optional
Initial stock balance
low_stock_thershold
integer <int32>
optional
Threshold before it notifies the user of low stock in inventory
barcode
string 
optional
Barcode for the product
<= 255 characters
notes
string 
optional
Notes for the product
<= 255 characters
status
integer 
optional
0 Active / 1 Inactive / 2 Suspended
Default:
0
follow_up_status
integer  | null 
optional
Follow Up Status get it from GET Follow up statuses with model product
Default:
null
updated_price
boolean 
optional
0/1 if the price was updated or not
average_price
number <double>
optional
current active price
type
enum<integer> <int32> | enum<null> 
optional
Type of the product.
Allowed values:
1 => Product2 => Service3 => Bundle
Default:
null
minimum_price
number <double>
optional
Minimum price of the product
Default:
null
profit_margin
number <double>
optional
Profit margin of the product
Default:
null
discount
number <double>
optional
discount amount
Default:
null
discount_type
enum<integer> 
optional
discount type
Allowed values:
1 => Percentage2 => Absolute
Default:
null
duration_minutes
number <double>
optional
time of service
Default:
0
availabe_online
boolean 
optional
0/1 if the priduct is available online or not.
Default:
0
raw_store_id
integer <int64> | null 
optional
The store which the items of the bundle get it from GET STORE API
Default:
null
Example:
0
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 Product
Next
Delete Products