Business-to-Customer Order Process

Business-to-Customer Order Process

NOTE: This page contains information for Production Environment users only.

This process shows a typical order process between a business and a customer. In this instance, a customer adds two items to their cart consecutively, enters their shipping and billing information, and then finalizes the transaction. Notice that in this example, a call is made for each shopper action.

Sample Request/Response A: Shopper Adds Item to Cart

Request

POST https://<S1 host>/api/basic-auth/simple-connect-ar/v1/transactions?state=EVALUATE 

Body

{
  "currencyCode": "USD",
  "customerCode": "CU5689",
  "invoiceDate": "2019-05-05",
  "invoiceNumber": "INV-123456",
  "lineItems": [
    {
      "description": "Clothing - Modern Fit Jeans (30x28)",
      "goodServiceCode": "CLTH867",
      "grossAmount": 200,
      "identifier": "INV-123456-001",
      "quantity": 2
    }
  ],
  "shipFrom": {
    "address": "123 Main Street",
    "cityMunicipality": "New York",
    "country": "USA",
    "stateProvince": "NY",
    "zipPostalCode": "10004"
  },
  "shipTo": {
    "address": "451 Broadway",
    "cityMunicipality": "Denver",
    "country": "USA",
    "stateProvince": "CO",
    "zipPostalCode": "80203"
  }
} 

Response

Body

{
    "status": 200,
    "message": "Successfully created new transaction with new state: EVALUATE",
    "data": {
        "transactionId": "230822a5-9f04-4edf-8e8d-ef464c6a2f3a",
        "invoiceNumber": "INV-123456",
        "currencyCode": "USD",
        "invoiceDate": "2019-05-05",
        "customerCode": "CU5689",
        "totalTaxAmount": 16.62,
        "shipTo": {
            "cityMunicipality": "Denver",
            "stateProvince": "CO",
            "country": "USA",
            "zipPostalCode": "80203",
            "address": "451 Broadway"
        },
        "shipFrom": {
            "cityMunicipality": "New York",
            "stateProvince": "NY",
            "country": "USA",
            "zipPostalCode": "10004",
            "address": "123 Main Street"
        },
        "lineItems": [
            {
                "identifier": "INV-123456-001",
                "totalTaxAmount": 16.62,
                "taxInfo": [
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO State Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 5.8,
                        "taxRate": 0.029,
                        "taxableAmount": 200,
                        "exemptAmount": 0,
                        "messages": [],
                        "jurisdictionType": "STATE"
                    },
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO City Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 8.62,
                        "taxRate": 0.0431,
                        "taxableAmount": 200,
                        "exemptAmount": 0,
                        "messages": [],
                        "jurisdictionType": "CITY",
                        "cityOrCountyOrDistrict": "DENVER"
                    },
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO District Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 0.2,
                        "taxRate": 0.001,
                        "taxableAmount": 200,
                        "exemptAmount": 0,
                        "messages": [],
                        "jurisdictionType": "DISTRICT",
                        "cityOrCountyOrDistrict": "SCIENTIFIC AND CULTURAL FACILITIES DISTRICT"
                    },
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO District Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 2,
                        "taxRate": 0.01,
                        "taxableAmount": 200,
                        "exemptAmount": 0,
                        "messages": [],
                        "jurisdictionType": "DISTRICT",
                        "cityOrCountyOrDistrict": "REGIONAL TRANSPORTATION DISTRICT"
                    }
                ]
            }
        ]
    },
    "success": true
} 

Sample Request/Response B: Shopper Adds Item to Cart

Request

POST https://<S1 host>/api/basic-auth/simple-connect-ar/v1/transactions?state=EVALUATE 

Body

{
    "currencyCode": "USD",
    "invoiceDate": "2019-05-05",
    "invoiceNumber": "INV-123456",
    "deliveryAmount": 8.00,
    "lineItems": [
        {
            "goodServiceCode": "CLTH867",
            "grossAmount": 200,
            "identifier": "INV-123456-001",
            "quantity": 2,
            "deliveryDate": "2019-05-13"
        },
        {
            "goodServiceCode": "CLTH5309",
            "grossAmount": 75,
            "identifier": "INV-123456-002",
            "quantity": 1,
            "deliveryDate": "2019-05-13",
            "discounts": [
                {
                    "amount": 10
                }
            ]
        }
    ],
    "shipFrom": {
        "address": "123 Main Street",
        "cityMunicipality": "New York",
        "country": "USA",
        "stateProvince": "NY",
        "zipPostalCode": "10004"
    },
    "shipTo": {
        "address": "451 Broadway",
        "cityMunicipality": "Denver",
        "country": "USA",
        "stateProvince": "CO",
        "zipPostalCode": "80203"
    },
    "billTo": {
        "address": "451 Broadway",
        "cityMunicipality": "Denver",
        "country": "USA",
        "stateProvince": "CO",
        "zipPostalCode": "80203"
    }
} 

Response

Body

{
    "status": 200,
    "message": "Successfully created new transaction with new state: EVALUATE",
    "data": {
        "transactionId": "deb6f1e8-d826-4432-9484-10b09e520dd7_173576215",
        "currencyCode": "USD",
        "totalTaxAmount": 10.92,
        "billTo": {
            "cityMunicipality": "Denver",
            "stateProvince": "CO",
            "country": "USA",
            "zipPostalCode": "80203",
            "address": "451 Broadway"
        },
        "shipTo": {
            "cityMunicipality": "Denver",
            "stateProvince": "CO",
            "country": "USA",
            "zipPostalCode": "80203",
            "address": "451 Broadway"
        },
        "shipFrom": {
            "cityMunicipality": "New York",
            "stateProvince": "NY",
            "country": "USA",
            "zipPostalCode": "10004",
            "address": "123 Main Street"
        },
        "lineItems": [
            {
                "identifier": "INV-123456-001",
                "totalTaxAmount": 8.23,
                "taxInfo": [
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO State Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 5.97,
                        "taxRate": 0.029,
                        "taxableAmount": 205.82,
                        "exemptAmount": 0.0,
                        "messages": [],
                        "jurisdictionType": "STATE"
                    },
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO City Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 0.0,
                        "taxRate": 0.0,
                        "taxableAmount": 0.0,
                        "exemptAmount": 0.0,
                        "messages": [],
                        "jurisdictionType": "CITY",
                        "cityOrCountyOrDistrict": "DENVER"
                    },
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO District Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 0.2,
                        "taxRate": 0.001,
                        "taxableAmount": 205.82,
                        "exemptAmount": 0.0,
                        "messages": [],
                        "jurisdictionType": "DISTRICT",
                        "cityOrCountyOrDistrict": "SCIENTIFIC AND CULTURAL FACILITIES DISTRICT"
                    },
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO District Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 2.06,
                        "taxRate": 0.01,
                        "taxableAmount": 205.82,
                        "exemptAmount": 0.0,
                        "messages": [],
                        "jurisdictionType": "DISTRICT",
                        "cityOrCountyOrDistrict": "REGIONAL TRANSPORTATION DISTRICT"
                    }
                ]
            },
            {
                "identifier": "INV-123456-002",
                "totalTaxAmount": 2.69,
                "taxInfo": [
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO State Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 1.95,
                        "taxRate": 0.029,
                        "taxableAmount": 67.18,
                        "exemptAmount": 0.0,
                        "messages": [],
                        "jurisdictionType": "STATE"
                    },
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO City Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 0.0,
                        "taxRate": 0.0,
                        "taxableAmount": 0.0,
                        "exemptAmount": 0.0,
                        "messages": [],
                        "jurisdictionType": "CITY",
                        "cityOrCountyOrDistrict": "DENVER"
                    },
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO District Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 0.07,
                        "taxRate": 0.001,
                        "taxableAmount": 67.18,
                        "exemptAmount": 0.0,
                        "messages": [],
                        "jurisdictionType": "DISTRICT",
                        "cityOrCountyOrDistrict": "SCIENTIFIC AND CULTURAL FACILITIES DISTRICT"
                    },
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO District Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 0.67,
                        "taxRate": 0.01,
                        "taxableAmount": 67.18,
                        "exemptAmount": 0.0,
                        "messages": [],
                        "jurisdictionType": "DISTRICT",
                        "cityOrCountyOrDistrict": "REGIONAL TRANSPORTATION DISTRICT"
                    }
                ]
            }
        ],
        "invoiceDate": "2019-05-05",
        "invoiceNumber": "INV-123456"
    },
    "success": true
} 

Sample Request/Response C: Shopper Enters Complete Bill-to and Ship-to Information

Request

POST https://<S1 host>/api/basic-auth/simple-connect-ar/v1/transactions?state=EVALUATE 

Body

{
  "currencyCode": "USD",
  "customerCode": "CU5689",
  "invoiceDate": "2019-05-05",
  "invoiceNumber": "INV-123456",
  "lineItems": [
    {
      "description": "Clothing - Modern Fit Jeans (30x28)",
      "goodServiceCode": "CLTH867",
      "grossAmount": 200,
      "identifier": "INV-123456-001",
      "quantity": 2,
      "deliveryAmount": 5,
      "deliveryDate": "2019-05-13"
    },
    {
      "description": "Clothing - Blue Buttoned Down Dress Shirt (M)",
      "goodServiceCode": "CLTH5309",
      "grossAmount": 75,
      "identifier": "INV-123456-002",
      "quantity": 1,
      "deliveryAmount": 3,
      "deliveryDate": "2019-05-13",
      "discounts": [
        {
          "amount": 10
        }
      ]
    }
  ],
  "shipFrom": {
    "address": "123 Main Street",
    "cityMunicipality": "New York",
    "country": "USA",
    "stateProvince": "NY",
    "zipPostalCode": "10004"
  },
  "shipTo": {
    "address": "451 Broadway",
    "cityMunicipality": "Denver",
    "country": "USA",
    "stateProvince": "CO",
    "zipPostalCode": "80203"
  },
  "billTo": {
    "address": "451 Broadway",
    "cityMunicipality": "Denver",
    "country": "USA",
    "stateProvince": "CO",
    "zipPostalCode": "80203"
  }
} 

Response

Body

{
    "status": 200,
    "message": "Successfully created transaction with new state: EVALUATE",
    "data": {
        "transactionId": "230822a5-9f04-4edf-8e8d-ef464c6a2f3a",
        "invoiceNumber": "INV-123456",
        "currencyCode": "USD",
        "invoiceDate": "2019-05-05",
        "customerCode": "CU5689",
        "totalTaxAmount": 22.69,
        "billTo": {
            "cityMunicipality": "Denver",
            "stateProvince": "CO",
            "country": "USA",
            "zipPostalCode": "80203",
            "address": "451 Broadway"
        },
        "shipTo": {
            "cityMunicipality": "Denver",
            "stateProvince": "CO",
            "country": "USA",
            "zipPostalCode": "80203",
            "address": "451 Broadway"
        },
        "shipFrom": {
            "cityMunicipality": "New York",
            "stateProvince": "NY",
            "country": "USA",
            "zipPostalCode": "10004",
            "address": "123 Main Street"
        },
        "lineItems": [
            {
                "identifier": "INV-123456-001",
                "totalTaxAmount": 17.04,
                "taxInfo": [
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO State Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 5.95,
                        "taxRate": 0.029,
                        "taxableAmount": 205,
                        "exemptAmount": 0,
                        "messages": [],
                        "jurisdictionType": "STATE"
                    },
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO City Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 8.84,
                        "taxRate": 0.0431,
                        "taxableAmount": 205,
                        "exemptAmount": 0,
                        "messages": [],
                        "jurisdictionType": "CITY",
                        "cityOrCountyOrDistrict": "DENVER"
                    },
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO District Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 0.2,
                        "taxRate": 0.001,
                        "taxableAmount": 205,
                        "exemptAmount": 0,
                        "messages": [],
                        "jurisdictionType": "DISTRICT",
                        "cityOrCountyOrDistrict": "SCIENTIFIC AND CULTURAL FACILITIES DISTRICT"
                    },
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO District Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 2.05,
                        "taxRate": 0.01,
                        "taxableAmount": 205,
                        "exemptAmount": 0,
                        "messages": [],
                        "jurisdictionType": "DISTRICT",
                        "cityOrCountyOrDistrict": "REGIONAL TRANSPORTATION DISTRICT"
                    }
                ]
            },
            {
                "identifier": "INV-123456-002",
                "totalTaxAmount": 5.65,
                "taxInfo": [
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO State Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 1.97,
                        "taxRate": 0.029,
                        "taxableAmount": 68,
                        "exemptAmount": 0,
                        "messages": [],
                        "jurisdictionType": "STATE"
                    },
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO City Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 2.93,
                        "taxRate": 0.0431,
                        "taxableAmount": 68,
                        "exemptAmount": 0,
                        "messages": [],
                        "jurisdictionType": "CITY",
                        "cityOrCountyOrDistrict": "DENVER"
                    },
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO District Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 0.07,
                        "taxRate": 0.001,
                        "taxableAmount": 68,
                        "exemptAmount": 0,
                        "messages": [],
                        "jurisdictionType": "DISTRICT",
                        "cityOrCountyOrDistrict": "SCIENTIFIC AND CULTURAL FACILITIES DISTRICT"
                    },
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO District Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 0.68,
                        "taxRate": 0.01,
                        "taxableAmount": 68,
                        "exemptAmount": 0,
                        "messages": [],
                        "jurisdictionType": "DISTRICT",
                        "cityOrCountyOrDistrict": "REGIONAL TRANSPORTATION DISTRICT"
                    }
                ]
            }
        ]
    },
    "success": true
} 

Sample Request/Response D: Shopper Finalizes Transaction

Request

POST https://<S1 host>/api/basic-auth/simple-connect-ar/v1/transactions?state=COMMIT 

Body

{
  "currencyCode": "USD",
  "customerCode": "CU5689",
  "invoiceDate": "2019-05-05",
  "invoiceNumber": "INV-123456",
  "lineItems": [
    {
      "description": "Clothing - Modern Fit Jeans (30x28)",
      "goodServiceCode": "CLTH867",
      "grossAmount": 200,
      "identifier": "INV-123456-001",
      "quantity": 2,
      "deliveryAmount": 5,
      "deliveryDate": "2019-05-13"
    },
    {
      "description": "Clothing - Blue Buttoned Down Dress Shirt (M)",
      "goodServiceCode": "CLTH5309",
      "grossAmount": 75,
      "identifier": "INV-123456-002",
      "quantity": 1,
      "deliveryAmount": 3,
      "deliveryDate": "2019-05-13",
      "discounts": [
        {
          "amount": 10
        }
      ]
    }
  ],
  "shipFrom": {
    "address": "123 Main Street",
    "cityMunicipality": "New York",
    "country": "USA",
    "stateProvince": "NY",
    "zipPostalCode": "10004"
  },
  "shipTo": {
    "address": "451 Broadway",
    "cityMunicipality": "Denver",
    "country": "USA",
    "stateProvince": "CO",
    "zipPostalCode": "80203"
  },
  "billTo": {
    "address": "451 Broadway",
    "cityMunicipality": "Denver",
    "country": "USA",
    "stateProvince": "CO",
    "zipPostalCode": "80203"
  }
} 

Response

Body

{
    "status": 200,
    "message": "Successfully created transaction with new state: COMMIT",
    "data": {
        "transactionId": "230822a5-9f04-4edf-8e8d-ef464c6a2f3a",
        "invoiceNumber": "INV-123456",
        "currencyCode": "USD",
        "invoiceDate": "2019-05-05",
        "customerCode": "CU5689",
        "totalTaxAmount": 22.69,
        "billTo": {
            "cityMunicipality": "Denver",
            "stateProvince": "CO",
            "country": "USA",
            "zipPostalCode": "80203",
            "address": "451 Broadway"
        },
        "shipTo": {
            "cityMunicipality": "Denver",
            "stateProvince": "CO",
            "country": "USA",
            "zipPostalCode": "80203",
            "address": "451 Broadway"
        },
        "shipFrom": {
            "cityMunicipality": "New York",
            "stateProvince": "NY",
            "country": "USA",
            "zipPostalCode": "10004",
            "address": "123 Main Street"
        },
        "lineItems": [
            {
                "identifier": "INV-123456-001",
                "totalTaxAmount": 17.04,
                "taxInfo": [
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO State Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 5.95,
                        "taxRate": 0.029,
                        "taxableAmount": 205,
                        "exemptAmount": 0,
                        "messages": [],
                        "jurisdictionType": "STATE"
                    },
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO City Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 8.84,
                        "taxRate": 0.0431,
                        "taxableAmount": 205,
                        "exemptAmount": 0,
                        "messages": [],
                        "jurisdictionType": "CITY",
                        "cityOrCountyOrDistrict": "DENVER"
                    },
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO District Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 0.2,
                        "taxRate": 0.001,
                        "taxableAmount": 205,
                        "exemptAmount": 0,
                        "messages": [],
                        "jurisdictionType": "DISTRICT",
                        "cityOrCountyOrDistrict": "SCIENTIFIC AND CULTURAL FACILITIES DISTRICT"
                    },
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO District Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 2.05,
                        "taxRate": 0.01,
                        "taxableAmount": 205,
                        "exemptAmount": 0,
                        "messages": [],
                        "jurisdictionType": "DISTRICT",
                        "cityOrCountyOrDistrict": "REGIONAL TRANSPORTATION DISTRICT"
                    }
                ]
            },
            {
                "identifier": "INV-123456-002",
                "totalTaxAmount": 5.65,
                "taxInfo": [
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO State Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 1.97,
                        "taxRate": 0.029,
                        "taxableAmount": 68,
                        "exemptAmount": 0,
                        "messages": [],
                        "jurisdictionType": "STATE"
                    },
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO City Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 2.93,
                        "taxRate": 0.0431,
                        "taxableAmount": 68,
                        "exemptAmount": 0,
                        "messages": [],
                        "jurisdictionType": "CITY",
                        "cityOrCountyOrDistrict": "DENVER"
                    },
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO District Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 0.07,
                        "taxRate": 0.001,
                        "taxableAmount": 68,
                        "exemptAmount": 0,
                        "messages": [],
                        "jurisdictionType": "DISTRICT",
                        "cityOrCountyOrDistrict": "SCIENTIFIC AND CULTURAL FACILITIES DISTRICT"
                    },
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO District Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 0.68,
                        "taxRate": 0.01,
                        "taxableAmount": 68,
                        "exemptAmount": 0,
                        "messages": [],
                        "jurisdictionType": "DISTRICT",
                        "cityOrCountyOrDistrict": "REGIONAL TRANSPORTATION DISTRICT"
                    }
                ]
            }
        ]
    },
    "success": true
}