Retrieve Customer Lead Time

Beta
GET/v1/sales/customers/{id}/lead-time

This 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.

Permissions requiredValues:customers:read
The role behind your API key or agent must grant every one of these permissions.
idstring

Customer ID.

include[]optional arrayenumValues:account_groupparent_customer

Sub-objects to expand in the response. When omitted, sub-objects are returned as null.

objectstringenumValues:customer_lead_time

Resource type identifier.

customerentitynullable

The customer the lead time was resolved for.

idstring

Unique identifier for the entity.

objectstringenumValues:entity

Resource type identifier.

typestringenumValues:accountactorentity

The 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.

namestringnullable

Human-readable display name for the entity (e.g. a user's full name, a sales order number).

handlestringnullable

Secondary human-readable identifier (e.g. email address, username, redacted API key value).

daysinteger

Calendar 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_group

Which 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.

account_groupaccount_groupExpandablenullable

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.

idstring

Account group ID.

objectstringenumValues:account_group

Resource type identifier.

typestringenumValues:pricing_grouptype_group

How 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.

namestring

Display name of the account group.

Unique within the account.

descriptionstringnullable

Free-form description of the account group.

commission_policystringenumValues:commission_appliedcommission_exempt

How 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_freight

How 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_daysintegernullable

Calendar 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.

parent_customercustomerExpandablenullable

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.

idstring

Customer ID.

objectstringenumValues:customer

Resource type identifier.

namestring

The customer's business name, as shown throughout the app and on documents.

numberstring

Human-readable customer number used to identify the account, distinct from the id.

Unique within your account.

statusstringenumValues:normalpreferredhold_shipment

The 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:enableddisabled

Whether EDI (Electronic Data Interchange) is enabled for exchanging orders and documents with this customer.

relationship_typestringenumValues:standaloneparentchild

The customer's position in the account hierarchy.

  • standalone: no parent or child accounts.
  • parent: has one or more child accounts (see child_accounts).
  • child: belongs to a parent account (see parent_account).
commission_policystringenumValues:commission_appliedcommission_exempt

How 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.

notestringnullable

Free-form note about the customer.

credit_limitquantitynullable

Maximum 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.

Always returned as null in this endpoint.
contact_infocustomer_contact_infonullable

General contact details for the customer's business.

Always returned as null in this endpoint.
freight_preferencescustomer_freight_preferencesnullable

Freight and carrier preferences applied to this customer's shipments.

Always returned as null in this endpoint.
defaultscustomer_defaultsnullable

Default settings applied to new orders for this customer.

Always returned as null in this endpoint.
notification_preferencescustomer_notification_preferencesnullable

Which document emails this customer is set up to receive.

Always returned as null in this endpoint.
bill_to_addressaddressnullable

Default billing address.

Always returned as null in this endpoint.
ship_to_addressaddressnullable

Default shipping address.

Always returned as null in this endpoint.
typeaccount_groupnullable

The account group of type type_group that categorizes this customer (for example "Distributors").

Always returned as null in this endpoint.
price_groupslistnullable

Account groups of type pricing_group that this customer belongs to, used to apply pricing rules.

Always returned as null in this endpoint.
parent_accountcustomernullable

The customer this account belongs to, when it is a child account.

Always returned as null in this endpoint.
child_accountslistnullable

The customers belonging to this account, when it is a parent account.

Always returned as null in this endpoint.
created_atstring (date-time)

Creation timestamp.

updated_atstring (date-time)

Last updated timestamp.

Responses

200

Successful response for Retrieve Customer Lead Time