BigCommerce API REST Client for .NET
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


BigCommerce API REST Client for .NET


To connect to the API, you need the following credentials:


using BigCommerce4Net.Api;
using BigCommerce4Net.Domain;

Basic Configuration

Api_Configuration = new Api.Configuration() {
                ServiceURL = "https://--yourstore--/api/v2",
                UserName = "--Your User Name--",
                UserApiKey = "--Your Api Key--",
                MaxPageLimit = 250,
                AllowDeletions = true // Is false by default, must be true to allow deletions
var Client = new Api.Client(Api_Configuration);

Accessing Store Data

var response = Client.Countries.Count();
            Assert.AreEqual(response.RestResponse.StatusCode, System.Net.HttpStatusCode.OK);
            Assert.Greater(response.Data.Count, 0);
var response = Client.Countries.Get();
            Assert.AreEqual(response.RestResponse.StatusCode, System.Net.HttpStatusCode.OK);
            Assert.AreEqual(response.Data.Count, 50);			
var filter = new Api.FilterCountries
                Limit = 200

            var response = Client.Countries.Get(filter);
            Assert.AreEqual(response.RestResponse.StatusCode, System.Net.HttpStatusCode.OK);
            Assert.AreEqual(response.Data.Count, 200);			

Updating Store Data

var updatedata = new { store_credit = 2500M };

            var response = Client.Customers.Update(100, updatedata);	
	    Assert.AreNotEqual(null, response.Data);
            Assert.AreEqual(100, response.Data.Id);
            Assert.AreEqual(2500M, response.Data.StoreCredit);			

Create Store Data

var customer = new { 
			first_name = "FirstName",
			last_name = "LastName",
			email = ""

var response = Client.Customers.Create(customer);
Assert.AreEqual(response.RestResponse.StatusCode, System.Net.HttpStatusCode.Created);			
Assert.AreNotEqual(null, response.Data);
Assert.AreEqual("FirstName", response.Data.FirstName);
Assert.AreEqual("LastName", response.Data.LastName);	
Assert.AreEqual("""", response.Data.Email);			

Delete Store Data

Note: Configuration.AllowDeletions must be true

var response = Client.Customers.Delete(100);
Assert.AreEqual(response.Data, true);
Assert.AreEqual(response.RestResponse.StatusCode, System.Net.HttpStatusCode.NoContent );


Copyright 2013 Ken Worst - R.C. Worst & Company Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.