Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Accounts

Index

Constructors

constructor

Properties

Private Readonly store

store: Store

Methods

add

  • Add an account to the CRM. Must include a name.

    import { AccountStage } from 'outseta-api-client/dist/models/crm/account-stage';
    
    const client = new OutsetaApiClient({
      subdomain: 'test-company',
      apiKey: example_key,
      secretKey: example_secret
    });
    const response = await client.crm.accounts.add({
      Name: 'TiltCamp',
      AccountStage: AccountStage.Trialing
    });
    console.log(response);
    

    For adding a new person with the account:

    const response = await client.crm.accounts.add({
      Name: 'TiltCamp',
      AccountStage: AccountStage.Trialing
      PersonAccount: [{
        Person: {
          Email: 'hello@tiltcamp.com'
        },
        IsPrimary: true
      }]
    });
    

    For adding an existing person with the account:

    const response = await client.crm.accounts.add({
      Name: 'TiltCamp',
      AccountStage: AccountStage.Trialing
      PersonAccount: [{
        Person: {
          Uid: 'L9P6gepm'
        },
        IsPrimary: true
      }]
    });
    
    throws

    Response If the server returns a non-"OK" status, the whole response object will be thrown.

    Parameters

    • account: AccountAdd

      The details for the account to add.

    • options: { fields?: string } = {}
      • Optional fields?: string

        Not all fields on the model are returned by default - you can request specific fields with a that looks something like ',PersonAccount.,PersonAccount.Person.Uid'. Note: the shape of the returned object may not match the model in this library if this string does not start with '*' as shown.

    Returns Promise<Account | ValidationError<Account>>

    The response body if response status OK, or response body with validation errors if response status 400.

cancel

  • Cancel a subscribed account.

    const client = new OutsetaApiClient({
      subdomain: 'test-company',
      apiKey: example_key,
      secretKey: example_secret
    });
    const response = await client.crm.accounts.cancel({
      CancelationReason: 'I am cancelling because ...',
      Comment: 'Insert comments here',
      Account: {
        Uid: 'BWz87NQE'
      }
    });
    console.log(response);
    
    throws

    Response If the server returns a non-"OK" or non-"400" status, the whole response object will be thrown.

    Parameters

    Returns Promise<null | ValidationError<Account>>

    Null if response status OK, or response body with validation errors if response status 400.

delete

  • delete(uid: string): Promise<null>
  • Delete a specific account in the Outseta CRM by its uid.

    const client = new OutsetaApiClient({
      subdomain: 'test-company',
      apiKey: example_key,
      secretKey: example_secret
    });
    const response = await client.crm.accounts.cancel(uid);
    console.log(response);
    
    throws

    Response If the server returns a non-"OK" status, the whole response object will be thrown.

    Parameters

    • uid: string

      The uid for the account to delete.

    Returns Promise<null>

    Null if deletion was successful.

expireCurrentSubscription

  • Immediately cancel an account's subscription by "expiring" it now.

    const client = new OutsetaApiClient({
      subdomain: 'test-company',
      apiKey: example_key,
      secretKey: example_secret
    });
    const response = await client.crm.accounts.expireCurrentSubscription(uid);
    console.log(response);
    
    throws

    Response If the server returns a non-"OK" or non-"400" status, the whole response object will be thrown.

    Parameters

    • uid: string

      The uid for the account to expire.

    Returns Promise<null | ValidationError<Subscription>>

    Null if deletion was successful, or response body of validation errors if response status 400.

extendTrial

  • Set the trial expiration to a particular date. Meant for extension, but seems to also work for shortening a trial period.

    const client = new OutsetaApiClient({
      subdomain: 'test-company',
      apiKey: example_key,
      secretKey: example_secret
    });
    const response = await client.crm.accounts.extendTrial(uid, new Date('01/01/2021'));
    console.log(response);
    
    throws

    Response If the server returns a non-"OK" or non-"400" status, the whole response object will be thrown.

    Parameters

    • uid: string

      The uid for the account to edit.

    • date: Date

      The date to set the trial expiration to.

    Returns Promise<null | ValidationError<Subscription>>

    Null if deletion was successful, or response body of validation errors if response status 400.

get

  • get(uid: string, options?: { fields?: string }): Promise<Account>
  • Get a specific account in the Outseta CRM by its uid.

    const client = new OutsetaApiClient({
      subdomain: 'test-company',
      apiKey: example_key,
      secretKey: example_secret
    });
    const response = await client.crm.accounts.get(uid);
    console.log(response);
    
    throws

    Response If the server returns a non-"OK" status, the whole response object will be thrown.

    Parameters

    • uid: string

      The uid for the account to get.

    • options: { fields?: string } = {}
      • Optional fields?: string

        Not all fields on the model are returned by default - you can request specific fields with a that looks something like ',PersonAccount.,PersonAccount.Person.Uid'. Note: the shape of the returned object may not match the model in this library if this string does not start with '*' as shown.

    Returns Promise<Account>

    The response body.

getAll

  • getAll(options?: { accountStage?: AccountStage; fields?: string; limit?: number; offset?: number }): Promise<List<Account>>
  • Get all accounts in the Outseta CRM.

    const client = new OutsetaApiClient({
      subdomain: 'test-company',
      apiKey: example_key,
      secretKey: example_secret
    });
    const response = await client.crm.accounts.getAll();
    console.log(response);
    
    throws

    Response If the server returns a non-"OK" status, the whole response object will be thrown.

    Parameters

    • options: { accountStage?: AccountStage; fields?: string; limit?: number; offset?: number } = {}
      • Optional accountStage?: AccountStage

        Filter the results to only users in this account stage.

      • Optional fields?: string

        Not all fields on the model are returned by default - you can request specific fields with a that looks something like ',PersonAccount.,PersonAccount.Person.Uid'. Note: the shape of the returned object may not match the model in this library if this string does not start with '*' as shown.

      • Optional limit?: number

        The number of results returned by the API.

      • Optional offset?: number

        For pagination; returns (limit) results after this value.

    Returns Promise<List<Account>>

    The response body.

removeCancellation

  • Removes the "cancellation" flag from an account with a subscription that is scheduled to expire.

    const client = new OutsetaApiClient({
      subdomain: 'test-company',
      apiKey: example_key,
      secretKey: example_secret
    });
    const response = await client.crm.accounts.removeCancellation(uid);
    console.log(response);
    
    throws

    Response If the server returns a non-"OK" or non-"400" status, the whole response object will be thrown.

    Parameters

    • uid: string

      The uid for the account to "uncancel".

    Returns Promise<null | ValidationError<Account>>

    Null if deletion was successful, or response body of validation errors if response status 400.

update

  • Update an account in the CRM. Must include its uid.

    const client = new OutsetaApiClient({
      subdomain: 'test-company',
      apiKey: example_key,
      secretKey: example_secret
    });
    const response = await client.crm.accounts.update({
      Uid: 'DQ2DyknW',
      Name: 'New Name for TiltCamp'
    });
    console.log(response);
    
    throws

    Response If the server returns a non-"OK" or non-"400" status, the whole response object will be thrown.

    Parameters

    • account: AccountUpdate

      The account fields and values to update. Must include the account's uid.

    • options: { fields?: string } = {}
      • Optional fields?: string

        Not all fields on the model are returned by default - you can request specific fields with a that looks something like ',PersonAccount.,PersonAccount.Person.Uid'. Note: the shape of the returned object may not match the model in this library if this string does not start with '*' as shown.

    Returns Promise<Account | ValidationError<Account>>

    The response body if response status OK, or response body with validation errors if response status 400.

Generated using TypeDoc