Retrieve Customer Lead Time
Beta/v1/sales/customers/{id}/lead-timeThis endpoint is idempotent. Learn more
Returns the ship-by lead time a new order for this customer would be committed to.
Resolved through the same chain the issue path stamps onto an order, most specific first: a lead time set on the customer, then on its parent account, then on the customer's account group, then the account-wide default. source names which rule applied, so a form can show where the number came from rather than leaving a rep to guess.
A lead time set on a parent account therefore governs every child account under it that has not set its own, which is how a head office's terms are given to its locations without repeating them on each one.
This is a preview of a commitment, not the commitment itself. An order takes its own ship_by_date when it is issued and keeps it afterwards, so changing a lead time here moves what future orders will promise and leaves promises already made alone.
idstringCustomer ID.
include[]optional arrayenumValues:account_groupparent_customerSub-objects to expand in the response. When omitted, sub-objects are returned as null.
objectstringenumValues:customer_lead_timeResource type identifier.
customerentitynullableThe customer the lead time was resolved for.
idstringUnique identifier for the entity.
objectstringenumValues:entityResource type identifier.
typestringenumValues:accountactorentityThe resource kind that this entity references, as an object-type value (e.g. user, account).
Unlike object — which is always entity — this names the underlying resource the id points to.
namestringnullableHuman-readable display name for the entity (e.g. a user's full name, a sales order number).
handlestringnullableSecondary human-readable identifier (e.g. email address, username, redacted API key value).
daysintegerCalendar days between an order being issued and it being due to ship.
0 means same-day: an order issued today would be due to ship today.
sourcestringenumValues:customerparent_customeraccount_groupWhich rule in the chain produced this lead time.
customer: a lead time set on the customer itself.parent_customer: inherited from the customer's parent account.account_group: inherited from the customer's account group.account: the account-wide fallback.
The shared manual value cannot appear here: it means a promised date was set on one specific order, which is a fact about that order rather than about the customer.
The account group the lead time was inherited from.
Present only when source is account_group. A customer that belongs to a group but sets its own lead time inherited nothing.
idstringAccount group ID.
objectstringenumValues:account_groupResource type identifier.
typestringenumValues:pricing_grouptype_groupHow this account group is used.
pricing_group: used for pricing rules, such as a "Preferred" group that receives a special discount.type_group: used to categorize accounts, such as "Consumers" or "Distributors".
A group's type is fixed when it is created and cannot be changed afterwards.
namestringDisplay name of the account group.
Unique within the account.
descriptionstringnullableFree-form description of the account group.
commission_policystringenumValues:commission_appliedcommission_exemptHow sales commission applies to accounts in this group.
commission_applied: sales commission is calculated on orders from accounts in this group.commission_exempt: orders from accounts in this group are exempt from commission.
freight_policystringenumValues:free_freightbilled_freightHow freight charges apply to orders from accounts in this group.
free_freight: customers within this group will not have to pay for freight.billed_freight: freight will be applied to any order within this account group, unless overridden elsewhere.
default_lead_time_daysintegernullableCalendar days between an order being issued and it being due to ship, inherited by every customer in this group that has neither set its own nor inherited one from a parent account.
created_atstring (date-time)Creation timestamp.
updated_atstring (date-time)Last updated timestamp.
The parent customer the lead time was inherited from.
Present only when source is parent_customer. A customer that has a parent but sets its own lead time inherited nothing.
idstringCustomer ID.
objectstringenumValues:customerResource type identifier.
namestringThe customer's business name, as shown throughout the app and on documents.
numberstringHuman-readable customer number used to identify the account, distinct from the id.
Unique within your account.
statusstringenumValues:normalpreferredhold_shipmentThe customer's account standing.
normal: standard account with no restrictions.preferred: account flagged for prioritized handling.hold_shipment: the customer's shipments should be held, typically over a credit problem, while orders can still be placed.hold_all: all activity for the customer should be held.
The hold statuses are advisory: OpenMRP flags the customer's orders as being on credit hold, but requests to create orders or shipments for the customer are not rejected.
edi_statusstringenumValues:enableddisabledWhether EDI (Electronic Data Interchange) is enabled for exchanging orders and documents with this customer.
relationship_typestringenumValues:standaloneparentchildThe customer's position in the account hierarchy.
standalone: no parent or child accounts.parent: has one or more child accounts (seechild_accounts).child: belongs to a parent account (seeparent_account).
commission_policystringenumValues:commission_appliedcommission_exemptHow sales commission applies to this customer's orders.
commission_exempt: this customer's orders are exempt from sales commission.commission_applied: sales commission is calculated on this customer's orders.
The customer counts as exempt if this field, its type group, or any of its price_groups is commission_exempt. Exempt customers never have a sales rep assigned automatically when an order is created without one.
notestringnullableFree-form note about the customer.
credit_limitquantitynullableMaximum credit extended to this customer.
Used to flag orders once the customer's outstanding balance approaches or passes the limit; orders that exceed it are not rejected.
null in this endpoint.contact_infocustomer_contact_infonullableGeneral contact details for the customer's business.
null in this endpoint.freight_preferencescustomer_freight_preferencesnullableFreight and carrier preferences applied to this customer's shipments.
null in this endpoint.defaultscustomer_defaultsnullableDefault settings applied to new orders for this customer.
null in this endpoint.notification_preferencescustomer_notification_preferencesnullableWhich document emails this customer is set up to receive.
null in this endpoint.Default billing address.
null in this endpoint.Default shipping address.
null in this endpoint.The account group of type type_group that categorizes this customer (for example "Distributors").
null in this endpoint.Account groups of type pricing_group that this customer belongs to, used to apply pricing rules.
null in this endpoint.The customer this account belongs to, when it is a child account.
null in this endpoint.The customers belonging to this account, when it is a parent account.
null in this endpoint.created_atstring (date-time)Creation timestamp.
updated_atstring (date-time)Last updated timestamp.
Responses
Successful response for Retrieve Customer Lead Time