async lookupById(params = {}) {
    const { customerId, reQueryOnInactive } = await validateAsync(Joi.object({
      customerId: this.schema.customerId.required(),
      reQueryOnInactive: Joi.boolean().default(true),
    }).required(), params);
    const endpoint = `/customer/${customerId}/*`;
    try {
      const response = await this.client.get({ endpoint });
      return new BasicCustomerResponse({ response, resource: this });
    } catch (e) {
      // on inactive, re-query.
      if (reQueryOnInactive) {
        const inactive = /^customer id \d+ is valid but not active.+please use (\d+)/i.exec(e.message);
        if (inactive && inactive[1]) {
          return this.lookupById({ customerId: parseInt(inactive[1], 10) });
        }
      }
      throw e;
    }
  }
/**
   * This API provides the ability look up a Customer by the Customer id.
   * The response will include basic Customer information.
   *
   * @link https://main.omeda.com/knowledge-base/customer-lookup-by-customer-id/
   * @param {object} params
   * @param {number} params.customerId
   * @returns {Promise<BasicCustomerResponse>} The basic Customer properties
   */
This API provides the ability look up a Customer by the Customer id.
The response will include basic Customer information.


This API provides the ability look up a Customer by the Customer id . The response will include basic Customer information .
async lookupById(params = {}) {
    const { customerId, reQueryOnInactive } = await validateAsync(Joi.object({
      customerId: this.schema.customerId.required(),
      reQueryOnInactive: Joi.boolean().default(true),
    }).required(), params);
    const endpoint = `/customer/${customerId}/*`;
    try {
      const response = await this.client.get({ endpoint });
      return new BasicCustomerResponse({ response, resource: this });
    } catch (e) {
      if (reQueryOnInactive) {
        const inactive = /^customer id \d+ is valid but not active.+please use (\d+)/i.exec(e.message);
        if (inactive && inactive[1]) {
          return this.lookupById({ customerId: parseInt(inactive[1], 10) });
        }
      }
      throw e;
    }
  }
async lookupById ( params = { } ) { const { customerId , reQueryOnInactive } = await validateAsync ( Joi . object ( { customerId : this . schema . customerId . required ( ) , reQueryOnInactive : Joi . boolean ( ) . default ( true ) , } ) . required ( ) , params ) ; const endpoint = ` ${ customerId } ` ; try { const response = await this . client . get ( { endpoint } ) ; return new BasicCustomerResponse ( { response , resource : this } ) ; } catch ( e ) { if ( reQueryOnInactive ) { const inactive = / ^customer id \d+ is valid but not active.+please use (\d+) / i . exec ( e . message ) ; if ( inactive && inactive [ 1 ] ) { return this . lookupById ( { customerId : parseInt ( inactive [ 1 ] , 10 ) } ) ; } } throw e ; } }
This API provides the ability look up a Customer by the Customer id.
This API provides the ability look up a Customer by the Customer id .
// on inactive, re-query.