Websites v4 docs v5.2.4
    Preparing search index...

    Hierarchy

    • default<void, void>
      • InstantValuation
    Index

    Properties

    Methods

    Properties

    serializer: (model: any) => any

    serializer is a pure function that takes a model instance and returns a plain object that describes how to convert the model to JSON

    Methods

    • Retrieves a value from raw API data. Prioritises DBAPI data if available

      Parameters

      • key: string

      Returns any

    • Special method to define behaviour of JSON.stringify() on model instance

      Returns any

    • Requests an instant valuation estimate and, when trigger_iov_on_create is set, creates a matching lead in a single call to the Valuations API.

      Parameters

      Returns Promise<
          | {
              errors: { message: string }[];
              errorType: InstantValuationErrorType;
              valuation: null;
          }
          | {
              errors: null;
              errorType?: undefined;
              valuation: | {
                  lower_bound?: number;
                  price?: number;
                  upper_bound?: number;
                  valuation_errors?: string[];
              }
              | null;
          },
      >

      const { valuation, errors } = await InstantValuation.create({
      valuation: { postcode: 'BN2 9SQ', paon: '10', property_type: 'terrace', bedrooms: 3 },
      lead_params: {
      user: { first_name: 'Jane', last_name: 'Smith', email: 'jane@example.com' },
      valuation_department: 'Sales valuation',
      },
      trigger_iov_on_create: true,
      });