Customer

Learn how to use the Customer resource with Metaprise Invoicing.

Overview

The Customerobject represents a business or individual that consumes goods or services from your Organization. Create a customer for every new user or business you want to bill. When you create a new customer, set up a minimal customer profile to help generate more useful invoices.

Caution

Before you create a new customer, make sure that the customer doesn’t already exist in the Dashboard. Creating multiple customer entries for the same customer can cause you problems later on, such as when you need to reconcile transaction history or coordinate saved payment methods.



Before you begin

Sign up the Metaprise developer devhub platform to get your unique Client ID and API key.
Obtain your access token by authenticating to Metaprise using your unique Client ID and API key. You will need the access token to make API calls.
Set up webhooks to receive notifications on Global Account events.


Customer profiles


Customer ProfileDescription
Customer BasicCompany Name
Email Address
Customer name
See Create a customer for more information.
Billing AddressCountry
Address Line1 & Address Line2
City
State/Province
Zip/Postal code
ContactFirst name
Last name
Phone
Fax
Customer DescriptionCustomer description

Create a Customer

  1. Use dashboard to create a new customer.

    1. Sign up and log in the Metaprise dashboard

    2. Click 'Add Customer' button.

    3. Fill minimal customer profile .

    4. You can Edit one existing customer.

    5. You can also Active/Inactive one existing customer by clicking the 'Active' or 'Inactive' right top button.

  2. Use API to create a customer

    1. Before you create a new customer, verify that the customer doesn’t already exist. For example, pass an email address to the list all customers API.
      curl -G https://api.metaprise.com/v1/customers \
        -u "sk_test_wU7nrJCZspk1NPDxiQgAF05q:" \
        -d email={EMAIL_ADDRESS}
      
    2. The following example shows how to create a new customer with minimal customer profile. See create a customer for a full list of arguments you can pass to the API.
      1. Example Request
        curl https://api.metaprise.com/v1/customers \
          -u "sk_test_wU7nrJCZspk1NPDxiQgAF05q:" \
          --data-urlencode email="[email protected]" \
          -d payment_method=pm_card_visa \
          -d "invoice_settings[default_payment_method]"=pm_card_visa
        
      2. Example Response
        {
            "result": "success",
            "data": {
                "uid": "12217",
                "customer_name": "Fantastic Juicy",
                "company_name": "Fantastic Juicy",
                "email": "[email protected]",
                "address_1": "Queen street",
                "address_2": " ",
                "address_3": " ",
                "address_4": " ",
                "country": "United States",
                "city": "New York",
                "state": "New York",
                "zipcode": "10002",
                "ct_first_name": "Alex",
                "ct_last_name": "Yang",
                "ct_phone": "+1,3343343344", 
                "ct_fax": "+1,3343343344",
                "customer_type": "business",
                "customer_desc": "",
                "create_at": "2015-10-06T10:50:42-07:00",
                "update_at": "2015-10-06T10:50:42-07:00",
                "delete_time": "2015-10-06T10:50:42-07:00",  
                "status": "active",  
                "source": "Metaprise", 
                "quickbook_id": "", 
                
            }
        }
        

Retrieve a customer details

Call Retrieve a customer by specifying customer ID in the endpoint URL.


Example request

curl --request GET  
--url '<https://api-demo.metaprise.com/api/v1/global_accounts/>\<your_global_account_id>'  
--header 'Authorization: Bearer \<your_bearer_token>'

Example response

{
    "result": "success",
    "data": {
        "uid": "12217",
        "customer_name": "Fantastic Juicy",
        "company_name": "Fantastic Juicy",
        "email": "[email protected]",
        "address_1": "Queen street",
        "address_2": " ",
        "address_3": " ",
        "address_4": " ",
        "country": "United States",
        "city": "New York",
        "state": "New York",
        "zipcode": "10002",
        "ct_first_name": "Alex",
        "ct_last_name": "Yang",
        "ct_phone": "+1,3343343344", 
        "ct_fax": "+1,3343343344",
        "customer_type": "business",
        "customer_desc": "",
        "create_at": "2015-10-06T10:50:42-07:00",
        "update_at": "2015-10-06T10:50:42-07:00",
        "delete_time": "2015-10-06T10:50:42-07:00",  
        "status": "active",  
        "source": "Metaprise", 
        "quickbook_id": "", 
        
    }
}