Update sell

Requires authentication

HTTP Request

PUT connector/api/sell/{sell}

PATCH connector/api/sell/{sell}

URL Parameters

Parameter Status Description
sell required id of sell to update

Body Parameters

Parameter Type Status Description
contact_id integer optional id of the customer
transaction_date string optional transaction date format:Y-m-d H:i:s,
status string optional sale status (final, draft)
tax_rate_id integer optional id of the tax rate applicable to the sale
discount_amount float optional discount amount applicable to the sale
discount_type string optional type of the discount amount (fixed, percentage)
sale_note string optional
staff_note string optional
commission_agent integer optional commission agent id
shipping_details string optional shipping details
shipping_address string optional shipping address
shipping_status string optional ('ordered', 'packed', 'shipped', 'delivered', 'cancelled')
delivered_to string optional Name of the person recieved the consignment
shipping_charges float optional shipping amount
packing_charge float optional packing charge
exchange_rate float optional exchange rate for the currency used
selling_price_group_id integer optional id of the selling price group
pay_term_number integer optional pay term value
pay_term_type string optional type of the pay term value ('days', 'months')
is_recurring integer optional whether the invoice is recurring (0, 1)
recur_interval integer optional value of the interval invoice will be regenerated
recur_interval_type string optional type of the recur interval ('days', 'months', 'years')
subscription_repeat_on integer optional day of the month on which invoice will be generated if recur interval type is months (1-30)
subscription_no string optional subscription number
recur_repetitions integer optional total number of invoices to be generated
rp_redeemed integer optional reward points redeemed
rp_redeemed_amount float optional reward point redeemed amount after conversion
types_of_service_id integer optional types of service id
service_custom_field_1 string optional types of service custom field 1
service_custom_field_2 string optional types of service custom field 2
service_custom_field_3 string optional types of service custom field 3
service_custom_field_4 string optional types of service custom field 4
round_off_amount float optional round off amount on total payable
table_id integer optional id of the table
service_staff_id integer optional id of the service staff assigned to the sale
change_return float optional Excess paid amount
change_return_id integer optional id of the change return payment if exists
products array required array of the products for the sale
payments array optional payment lines for the sale
sell_line_id integer optional sell line id for existing item only
products.*.product_id integer optional product id
products.*.variation_id integer optional variation id
products.*.quantity float optional quantity
products.*.unit_price float optional unit selling price
products.*.tax_rate_id integer optional tax rate id applicable on the product
products.*.discount_amount float optional discount amount applicable on the product
products.*.discount_type string optional type of discount amount ('fixed', 'percentage')
products.*.sub_unit_id integer optional sub unit id
products.*.note string optional note for the product
payments.*.payment_id integer optional payment id for existing payment line
payments.*.amount float optional amount of the payment
payments.*.method string optional payment methods ('cash', 'card', 'cheque', 'bank_transfer', 'other', 'custom_pay_1', 'custom_pay_2', 'custom_pay_3')
payments.*.account_id integer optional account id
payments.*.card_number string optional
payments.*.card_holder_name string optional
payments.*.card_transaction_number string optional
payments.*.card_type string optional
payments.*.card_month string optional
payments.*.card_year string optional
payments.*.card_security string optional
payments.*.transaction_no_1 string optional
payments.*.transaction_no_2 string optional
payments.*.transaction_no_3 string optional
payments.*.note string optional payment note
payments.*.cheque_number string optional
payments.*.bank_account_number string optional

Example request:

curl -X PUT \
"http://erp.dstadvertising.com/connector/api/sell/6" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-d '{"contact_id":8,"transaction_date":"2020-5-7 15:20:22","status":"final","tax_rate_id":13,"discount_amount":10,"discount_type":"fixed","sale_note":"dolores","staff_note":"accusantium","commission_agent":11,"shipping_details":"Express Delivery","shipping_address":"et","shipping_status":"ordered","delivered_to":"Mr Robin","shipping_charges":10,"packing_charge":10,"exchange_rate":1,"selling_price_group_id":11,"pay_term_number":8,"pay_term_type":"months","is_recurring":0,"recur_interval":16,"recur_interval_type":"days","subscription_repeat_on":7,"subscription_no":"et","recur_repetitions":18,"rp_redeemed":20,"rp_redeemed_amount":13.5,"types_of_service_id":5,"service_custom_field_1":"dolor","service_custom_field_2":"qui","service_custom_field_3":"fugiat","service_custom_field_4":"ut","round_off_amount":7,"table_id":18,"service_staff_id":15,"change_return":0,"change_return_id":10,"products":[{"product_id":17,"variation_id":58,"quantity":1,"unit_price":437.5,"tax_rate_id":7,"discount_amount":0,"discount_type":"percentage","sub_unit_id":2,"note":"ducimus"}],"payments":[{"payment_id":11,"amount":453.13,"method":"cash","account_id":5,"card_number":"animi","card_holder_name":"amet","card_transaction_number":"sapiente","card_type":"similique","card_month":"error","card_year":"quae","card_security":"fugit","transaction_no_1":"ullam","transaction_no_2":"ipsum","transaction_no_3":"laboriosam","note":"nulla","cheque_number":"nostrum","bank_account_number":"dignissimos"}],"sell_line_id":3}'

Example response (200):

{
"id": 91,
"business_id": 1,
"location_id": 1,
"res_table_id": null,
"res_waiter_id": null,
"res_order_status": null,
"type": "sell",
"sub_type": null,
"status": "final",
"is_quotation": 0,
"payment_status": "paid",
"adjustment_type": null,
"contact_id": 1,
"customer_group_id": 1,
"invoice_no": "AS0020",
"ref_no": "",
"subscription_no": null,
"subscription_repeat_on": null,
"transaction_date": "25-09-2020 15:22",
"total_before_tax": 962.5,
"tax_id": null,
"tax_amount": 0,
"discount_type": "fixed",
"discount_amount": "19.5000",
"rp_redeemed": 0,
"rp_redeemed_amount": "0.0000",
"shipping_details": null,
"shipping_address": null,
"shipping_status": null,
"delivered_to": null,
"shipping_charges": "0.0000",
"additional_notes": null,
"staff_note": null,
"round_off_amount": "0.0000",
"final_total": 943,
"expense_category_id": null,
"expense_for": null,
"commission_agent": null,
"document": null,
"is_direct_sale": 0,
"is_suspend": 0,
"exchange_rate": "1.000",
"total_amount_recovered": null,
"transfer_parent_id": null,
"return_parent_id": null,
"opening_stock_product_id": null,
"created_by": 9,
"import_batch": null,
"import_time": null,
"types_of_service_id": null,
"packing_charge": "0.0000",
"packing_charge_type": null,
"service_custom_field_1": null,
"service_custom_field_2": null,
"service_custom_field_3": null,
"service_custom_field_4": null,
"mfg_parent_production_purchase_id": null,
"mfg_wasted_units": null,
"mfg_production_cost": "0.0000",
"mfg_production_cost_type": "percentage",
"mfg_is_final": 0,
"is_created_from_api": 0,
"essentials_duration": "0.00",
"essentials_duration_unit": null,
"essentials_amount_per_unit_duration": "0.0000",
"essentials_allowances": null,
"essentials_deductions": null,
"rp_earned": 0,
"repair_completed_on": null,
"repair_warranty_id": null,
"repair_brand_id": null,
"repair_status_id": null,
"repair_model_id": null,
"repair_job_sheet_id": null,
"repair_defects": null,
"repair_serial_no": null,
"repair_checklist": null,
"repair_security_pwd": null,
"repair_security_pattern": null,
"repair_due_date": null,
"repair_device_id": null,
"repair_updates_notif": 0,
"order_addresses": null,
"is_recurring": 0,
"recur_interval": 1,
"recur_interval_type": "days",
"recur_repetitions": 0,
"recur_stopped_on": null,
"recur_parent_id": null,
"invoice_token": null,
"pay_term_number": null,
"pay_term_type": null,
"pjt_project_id": null,
"pjt_title": null,
"woocommerce_order_id": null,
"selling_price_group_id": 0,
"created_at": "2020-09-23 20:16:19",
"updated_at": "2020-09-25 17:57:08",
"payment_lines": [
{
"id": 55,
"transaction_id": 91,
"business_id": 1,
"is_return": 0,
"amount": "461.7500",
"method": "cash",
"transaction_no": null,
"card_transaction_number": null,
"card_number": null,
"card_type": "credit",
"card_holder_name": null,
"card_month": null,
"card_year": null,
"card_security": null,
"cheque_number": null,
"bank_account_number": null,
"paid_on": "2020-09-23 20:16:19",
"created_by": 9,
"is_advance": 0,
"payment_for": 1,
"parent_id": null,
"note": null,
"document": null,
"payment_ref_no": "SP2020\/0018",
"account_id": null,
"created_at": "2020-09-23 20:16:19",
"updated_at": "2020-09-23 20:16:19"
}
]
}

javascript

const url = new URL(
"https://pos.ultimatefosters.com/connector/api/sell/6"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
let body = {
"contact_id": 8,
"transaction_date": "2020-5-7 15:20:22",
"status": "final",
"tax_rate_id": 13,
"discount_amount": 10,
"discount_type": "fixed",
"sale_note": "dolores",
"staff_note": "accusantium",
"commission_agent": 11,
"shipping_details": "Express Delivery",
"shipping_address": "et",
"shipping_status": "ordered",
"delivered_to": "Mr Robin",
"shipping_charges": 10,
"packing_charge": 10,
"exchange_rate": 1,
"selling_price_group_id": 11,
"pay_term_number": 8,
"pay_term_type": "months",
"is_recurring": 0,
"recur_interval": 16,
"recur_interval_type": "days",
"subscription_repeat_on": 7,
"subscription_no": "et",
"recur_repetitions": 18,
"rp_redeemed": 20,
"rp_redeemed_amount": 13.5,
"types_of_service_id": 5,
"service_custom_field_1": "dolor",
"service_custom_field_2": "qui",
"service_custom_field_3": "fugiat",
"service_custom_field_4": "ut",
"round_off_amount": 7,
"table_id": 18,
"service_staff_id": 15,
"change_return": 0,
"change_return_id": 10,
"products": [
{
"product_id": 17,
"variation_id": 58,
"quantity": 1,
"unit_price": 437.5,
"tax_rate_id": 7,
"discount_amount": 0,
"discount_type": "percentage",
"sub_unit_id": 2,
"note": "ducimus"
}
],
"payments": [
{
"payment_id": 11,
"amount": 453.13,
"method": "cash",
"account_id": 5,
"card_number": "animi",
"card_holder_name": "amet",
"card_transaction_number": "sapiente",
"card_type": "similique",
"card_month": "error",
"card_year": "quae",
"card_security": "fugit",
"transaction_no_1": "ullam",
"transaction_no_2": "ipsum",
"transaction_no_3": "laboriosam",
"note": "nulla",
"cheque_number": "nostrum",
"bank_account_number": "dignissimos"
}
],
"sell_line_id": 3
}
fetch(url, {
method: "PUT",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));