npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@deliverart/sdk-js-customer

v2.10.5

Published

Deliverart JavaScript SDK for Customer and CustomerAddress Management

Downloads

1,315

Readme

@deliverart/sdk-js-customer

Customer and business profile management package for the DeliverArt JavaScript SDK.

Installation

npm install @deliverart/sdk-js-customer @deliverart/sdk-js-core

Exported Types

Core Types

  • Customer - Customer basic information
  • CustomerDetails - Extended customer with relations
  • CustomerAddress - Customer delivery address
  • CustomerBusinessProfile - Business profile for B2B customers

IRI Types

  • CustomerIri - Customer IRI (/customers/:id)
  • CustomerAddressIri - Customer address IRI (/customer_addresses/:id)
  • CustomerBusinessProfileIri - Business profile IRI (/customer_business_profiles/:id)

Available Requests

Customer Management

CreateCustomer

import { CreateCustomer } from '@deliverart/sdk-js-customer';

const customer = await sdk.call(new CreateCustomer({
  firstName: 'John',
  lastName: 'Doe',
  email: '[email protected]',
  phoneNumber: '+39123456789',
  company: '/companies/123' // Optional
}));

Input Parameters:

  • firstName: string (required) - First name
  • lastName: string (required) - Last name
  • email: string (required) - Email address
  • phoneNumber: string (required) - Phone number
  • company?: string (optional) - Company IRI

GetCustomers

import { GetCustomers } from '@deliverart/sdk-js-customer';

const customers = await sdk.call(new GetCustomers({
  query: {
    email: '[email protected]',
    phoneNumber: '+39123456789',
    page: 1
  }
}));

Query Parameters:

  • firstName?: string - Filter by first name
  • lastName?: string - Filter by last name
  • email?: string - Filter by email
  • phoneNumber?: string - Filter by phone number
  • company?: string - Filter by company IRI
  • page?: number - Page number

GetCustomerDetails

import { GetCustomerDetails } from '@deliverart/sdk-js-customer';

const customer = await sdk.call(new GetCustomerDetails('customer-123'));

UpdateCustomer

import { UpdateCustomer } from '@deliverart/sdk-js-customer';

const updated = await sdk.call(new UpdateCustomer('customer-123', {
  firstName: 'Jane'
}));

DeleteCustomer

import { DeleteCustomer } from '@deliverart/sdk-js-customer';

await sdk.call(new DeleteCustomer('customer-123'));

Customer Addresses

CreateCustomerAddress

import { CreateCustomerAddress } from '@deliverart/sdk-js-customer';

const address = await sdk.call(new CreateCustomerAddress({
  customer: '/customers/123',
  street: 'Via Roma 1',
  city: 'Milano',
  postalCode: '20100',
  country: 'IT',
  location: {
    latitude: 45.464664,
    longitude: 9.188540
  }
}));

Input Parameters:

  • customer: string (required) - Customer IRI
  • street: string (required) - Street address
  • city: string (required) - City
  • postalCode: string (required) - Postal code
  • country: string (required) - Country code (ISO 3166-1 alpha-2)
  • state?: string (optional) - State/region
  • province?: string (optional) - Province
  • location?: { latitude: number, longitude: number } (optional) - GPS coordinates

GetCustomerAddresses

import { GetCustomerAddresses } from '@deliverart/sdk-js-customer';

const addresses = await sdk.call(new GetCustomerAddresses({
  query: {
    customer: '/customers/123'
  }
}));

UpdateCustomerAddress

import { UpdateCustomerAddress } from '@deliverart/sdk-js-customer';

const updated = await sdk.call(new UpdateCustomerAddress('address-123', {
  street: 'Via Nuova 10'
}));

DeleteCustomerAddress

import { DeleteCustomerAddress } from '@deliverart/sdk-js-customer';

await sdk.call(new DeleteCustomerAddress('address-123'));

Business Profiles (B2B)

CreateCustomerBusinessProfile

import { CreateCustomerBusinessProfile } from '@deliverart/sdk-js-customer';

const profile = await sdk.call(new CreateCustomerBusinessProfile({
  customer: '/customers/123',
  businessName: 'Acme Inc',
  vat: 'IT12345678901',
  taxCode: 'ACME123',
  billingAddress: {
    street: 'Via Business 1',
    city: 'Milano',
    postalCode: '20100',
    country: 'IT'
  },
  billingData: {
    email: '[email protected]',
    pec: '[email protected]'
  }
}));

Input Parameters:

  • customer: string (required) - Customer IRI
  • businessName: string (required) - Business name
  • vat: string (required) - VAT number
  • taxCode?: string (optional) - Tax code
  • billingAddress: Address (required) - Billing address
  • billingData: BillingData (required) - Billing contact information

GetCustomerBusinessProfiles

import { GetCustomerBusinessProfiles } from '@deliverart/sdk-js-customer';

const profiles = await sdk.call(new GetCustomerBusinessProfiles({
  query: {
    customer: '/customers/123'
  }
}));

UpdateCustomerBusinessProfile

import { UpdateCustomerBusinessProfile } from '@deliverart/sdk-js-customer';

const updated = await sdk.call(new UpdateCustomerBusinessProfile('profile-123', {
  businessName: 'Acme Corporation'
}));

DeleteCustomerBusinessProfile

import { DeleteCustomerBusinessProfile } from '@deliverart/sdk-js-customer';

await sdk.call(new DeleteCustomerBusinessProfile('profile-123'));

Complete Usage Example

import { sdk } from './lib/sdk';
import {
  CreateCustomer,
  CreateCustomerAddress,
  CreateCustomerBusinessProfile,
  GetCustomers
} from '@deliverart/sdk-js-customer';

async function customerWorkflow() {
  // Create customer
  const customer = await sdk.call(new CreateCustomer({
    firstName: 'John',
    lastName: 'Doe',
    email: '[email protected]',
    phoneNumber: '+39123456789',
    company: '/companies/123'
  }));

  // Add delivery address
  const address = await sdk.call(new CreateCustomerAddress({
    customer: `/customers/${customer.id}`,
    street: 'Via Roma 1',
    city: 'Milano',
    postalCode: '20100',
    country: 'IT',
    location: {
      latitude: 45.464664,
      longitude: 9.188540
    }
  }));

  // Add business profile (for B2B)
  const businessProfile = await sdk.call(new CreateCustomerBusinessProfile({
    customer: `/customers/${customer.id}`,
    businessName: 'Acme Inc',
    vat: 'IT12345678901',
    billingAddress: {
      street: 'Via Business 1',
      city: 'Milano',
      postalCode: '20100',
      country: 'IT'
    },
    billingData: {
      email: '[email protected]',
      pec: '[email protected]'
    }
  }));

  // Search customers
  const customers = await sdk.call(new GetCustomers({
    query: {
      email: '[email protected]'
    }
  }));

  console.log(`Found ${customers.pagination.totalItems} customers`);
}

License

MIT