BigCommer API How to create a customer

BigCommerce API 2024: How To Create A Customer

Every business must manage its customers well. Creating Customers and using information about your customers, you can send marketing campaigns and emails or remind them to create an account if they don’t already have one to become loyal customers. 

Due to the reasons mentioned above, Beehexa will help you create a customer on BigCommerce today. If you want to manage customers effectively and retain customers for a long time, this is necessary for your business.

Step 1: Check Scope on BigCommerce

Scope limits the ability to read or write data. Set the scopes to the minimum level of access needed to accomplish the task at hand.

When using data, that data must be allowed access because BigCommerce only provides access to the information you are granted access to.

To know you have the right to access any information, you must verify the Scope.

Let’s check the scope: 

  • Go to the Home page
  • Select settings
  • Roll down on the API section, then click on API Accounts
01 How To Create A Customer

Step 2: Access Postman

After checking the Scope, we can start retrieving information, and in today’s tutorial, we will create a customer on BigCommerce.

Now, we are ready to make a new customer using Postman. 

Log in to your Postman and create a new workspace.

02 How To Create A Customer

Step 3: Create a customer

Notes

You can create a customer with global access or channel-specific access.

– Global access:

  • Make sure the channel has allow_global_logins enabled. This is on by default only for the default storefront. Find more info at Customer Settings > Channel.
  • Omit channel_ids field, or provide channel_ids: null.

– Channel-specific access:

  • Provide a channel_ids array containing the channels accessible by the customer. This array cannot be empty.

Now we are prepared to create a new customer:

  • Create a new POST with this URL: 
https://api.bigcommerce.com/stores/wxrj2hgngy/v2/customers
  • Replace {store_hash} with your store_hash generated on BigCommerce from the API path.

1.In the Header section, you need to declare the information :

  • Accept: application/JSON
  • Content-Type: application/JSON
  • X-Auth-Client: Client ID
  • X-Auth-Token: Access token

If this is the first time you make a call in the Postman, you must generate API credentials from the BigCommerce Admin Account. You can read Blog How to create a BigCommerce API account on the Beehexa website.

03 How To Create A Customer

2. In the Body section

In this step, you need to click on the Body section, then tick at โ€œrawโ€ to fill the data; remember to change the โ€œtextโ€ to โ€œJSON.โ€

After that, you need to declare the information about your customer

Required Fields

  • Last_name: The last name of the customer.
  • First_name: The first name of the customer.
  • Email: The email of the customer. It must be unique.

Required Fields Customer Address

  • First_name: The first name associated with the customer address.
  • City: The city of the customer’s address.
  • Country_code: The country code of the customer address.
  • Last_name: The last name of the customer’s address.
  • Address1: The address 1 line.

Optional fields

  • Company: The company of the customer.
  • Phone: The phone number of the customer.
  • Notes: The customer notes.

For instance, I will show you how to create a customer below.

{
   "first_name": "Chriss",
  "last_name": "Hoang",
  "email": "[email protected]"
}
Code language: JSON / JSON with Comments (json)

Note: You can create multiple customers in one call.

04 How To Create A Customer

Moreover, If you want to know more about the attributes to declare,  follow BigCommerce Dev Center .

After filling in all the information, click the send button to send the API request.

As a result, The API will return the data like this.  

{
    "id": 1,
    "company": "",
    "first_name": "Chriss",
    "last_name": "hoang",
    "email": "[email protected]",
    "phone": "",
    "form_fields": null,
    "date_created": "Mon, 04 Jul 2022 03:20:55 +0000",
    "date_modified": "Mon, 04 Jul 2022 03:20:55 +0000",
    "store_credit": "0.0000",
    "registration_ip_address": "",
    "customer_group_id": 0,
    "notes": "",
    "tax_exempt_category": "",
    "reset_pass_on_login": false,
    "accepts_marketing": false,
    "addresses": {
        "url": "https://api.bigcommerce.com/stores/wxrj2hgngy/v2/customers/2/addresses",
        "resource": "/customers/2/addresses"
    }
}
Code language: JSON / JSON with Comments (json)

 After that, let’s back to the BigCommerce Store to check out, you will see the result.

05 How To Create A Customer

In conclusion, the above are all steps to create a Customer on BigCommerce using Postman. Please comment below or refer to our BigCommerce API documentation if you have any questions.

Hopefully, you can do it!

These steps will be shown visually in the video below.