Business-to-Customer Order Process (Fewer Calls)

Business-to-Customer Order Process (Fewer Calls)

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 only made when more detailed shipping information is added and the user requests an estimate of the tax, and later when the order is finalized.

Sample Request/Response A: Shopper Enters ZIP and Clicks Estimate Tax

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": [
    {
      "description": "Clothing - Modern Fit Jeans (30x28)",
      "goodServiceCode": "CLTH867",
      "grossAmount": 200,
      "identifier": "INV-123456-001",
      "quantity": 2,
      "deliveryDate": "2019-05-13"
    },
    {
      "description": "Clothing - Blue Buttoned Down Dress Shirt (M)",
      "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": "3fc67f62-20db-44f6-a573-4fd4af73fadd",
        "invoiceNumber": "INV-123456",
        "currencyCode": "USD",
        "invoiceDate": "2019-05-05",
        "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.1,
                "taxInfo": [
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO State Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 5.97,
                        "taxRate": 0.029,
                        "taxableAmount": 205.82,
                        "exemptAmount": 0,
                        "messages": [],
                        "jurisdictionType": "STATE"
                    },
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO City Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 8.87,
                        "taxRate": 0.0431,
                        "taxableAmount": 205.82,
                        "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.82,
                        "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.06,
                        "taxRate": 0.01,
                        "taxableAmount": 205.82,
                        "exemptAmount": 0,
                        "messages": [],
                        "jurisdictionType": "DISTRICT",
                        "cityOrCountyOrDistrict": "REGIONAL TRANSPORTATION DISTRICT"
                    }
                ]
            },
            {
                "identifier": "INV-123456-002",
                "totalTaxAmount": 5.59,
                "taxInfo": [
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO State Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 1.95,
                        "taxRate": 0.029,
                        "taxableAmount": 67.18,
                        "exemptAmount": 0,
                        "messages": [],
                        "jurisdictionType": "STATE"
                    },
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO City Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 2.9,
                        "taxRate": 0.0431,
                        "taxableAmount": 67.18,
                        "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": 67.18,
                        "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.67,
                        "taxRate": 0.01,
                        "taxableAmount": 67.18,
                        "exemptAmount": 0,
                        "messages": [],
                        "jurisdictionType": "DISTRICT",
                        "cityOrCountyOrDistrict": "REGIONAL TRANSPORTATION DISTRICT"
                    }
                ]
            }
        ]
    },
    "success": true
} 

Sample Request/Response B: Shopper Finalizes Transaction

Request

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

Body

{
  "currencyCode": "USD",
  "invoiceDate": "2019-05-05",
  "invoiceNumber": "INV-123456",
  "deliveryAmount": 8.00,
  "lineItems": [
    {
      "description": "Clothing - Modern Fit Jeans (30x28)",
      "goodServiceCode": "CLTH867",
      "grossAmount": 200,
      "identifier": "INV-123456-001",
      "quantity": 2,
      "deliveryDate": "2019-05-13"
    },
    {
      "description": "Clothing - Blue Buttoned Down Dress Shirt (M)",
      "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: COMMIT",
    "data": {
        "transactionId": "3fc67f62-20db-44f6-a573-4fd4af73fadd",
        "invoiceNumber": "INV-123456",
        "currencyCode": "USD",
        "invoiceDate": "2019-05-05",
        "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.1,
                "taxInfo": [
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO State Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 5.97,
                        "taxRate": 0.029,
                        "taxableAmount": 205.82,
                        "exemptAmount": 0,
                        "messages": [],
                        "jurisdictionType": "STATE"
                    },
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO City Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 8.87,
                        "taxRate": 0.0431,
                        "taxableAmount": 205.82,
                        "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.82,
                        "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.06,
                        "taxRate": 0.01,
                        "taxableAmount": 205.82,
                        "exemptAmount": 0,
                        "messages": [],
                        "jurisdictionType": "DISTRICT",
                        "cityOrCountyOrDistrict": "REGIONAL TRANSPORTATION DISTRICT"
                    }
                ]
            },
            {
                "identifier": "INV-123456-002",
                "totalTaxAmount": 5.59,
                "taxInfo": [
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO State Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 1.95,
                        "taxRate": 0.029,
                        "taxableAmount": 67.18,
                        "exemptAmount": 0,
                        "messages": [],
                        "jurisdictionType": "STATE"
                    },
                    {
                        "type": "SALES_TAX",
                        "authorityName": "CO City Tax",
                        "stateOrProvince": "COLORADO",
                        "country": "UNITED STATES",
                        "taxAmount": 2.9,
                        "taxRate": 0.0431,
                        "taxableAmount": 67.18,
                        "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": 67.18,
                        "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.67,
                        "taxRate": 0.01,
                        "taxableAmount": 67.18,
                        "exemptAmount": 0,
                        "messages": [],
                        "jurisdictionType": "DISTRICT",
                        "cityOrCountyOrDistrict": "REGIONAL TRANSPORTATION DISTRICT"
                    }
                ]
            }
        ]
    },
    "success": true
}