Store Transaction

Read about how to create a Store Transaction request using the sample files.

You use the Store Transaction request to store transaction data before the buyer's payment details are confirmed. For example, you might use this request to store a pending transaction. If your customer has placed goods in their basket but has not finished shopping.

In this sample scenario, you use the Store Transaction request to emulate a buyer who has entered some details but is not yet ready to checkout or complete the transaction.

The difference between this sample request and the Calculate Tax one is that here you specify some additional details, including the product code in the request's body. Note also that a custom ID has been added to show you how this can be done.

When the request is returned, it contains a transaction key. This is used later to confirm the transaction.

Process Flow

This diagram shows the steps for this scenario:

579

Store Transaction

The process flow is as follows:

  1. Buyer visits the store and views the tax information for the product.
    The buyer, Eric, visits the seller. Angela's, Smoked Herring Store web store. He views the price (and tax information) for a packet of smoked herring.
  2. Store uses Store Transaction request to connect to Taxamo.
    The seller, Angela, uses the Store Transaction request to connect her store to Taxamo. It uses the details entered on the UI to retrieve the tax rate for these goods. In the sample scenario, the address details for the buyer and seller are also included in the information that is sent to the API.
    For more information, see Store Transaction.
  3. The tax rate is returned by the Taxamo API.
  4. Eric views the tax rate on the store's UI.

Request Notes

In the sample files, note the product code that is sent in the request:

},
        "product_cn_code": "0305420000"
      }

This is the identifier that the systems uses in tax calculations. You generate these codes for each of your products during the configuration. For more information, see Product Classification.

The product code here is included for your convenience. If you do not include a valid product code, the request will be rejected.

Note that some information is maintained at the Transaction level:

"transaction": {
    "currency_code": "EUR",
    "buyer_name": "Eric Papin",
    "ship_to_address": {
      "address_detail": "Chateuax 12",
      "building_number": "55",
      "street_name": "Rue du Saint-Germain",
      "city": "Paris",
      "postal_code": "75008 ",
      "country_code": "FR"
    },

Further information is maintained at the Transaction Line Object level:

"transaction_lines": [
      {
        "product_class": "P",
        "quantity": 1,
        "description": "Smoked herrings",
        "amount": "19.95",
        "custom_id": "51315A00-DC44-408E-A575-8CE42A32AE1B",
        "import_address":{
            "country_code": "FR"
        },

Response Notes

Note the transaction key. You use this value in the next request to confirm the transaction:

"key": "PkwXc6wAAG85PZFTRCmIC3yf6qRphOzcvkUZN7g",

The line_key is used to identify the line:

"line_key": "eG0ylX-MdCzNWGCE",

The custom_id is a custom ID that you can add:

"custom_id": "51315A00-DC44-408E-A575-8CE42A32AE1B",

Sample Request

{
"transaction": {
    "currency_code": "EUR",
    "buyer_name": "Eric Papin",
    "ship_to_address": {
      "address_detail": "Chateuax 12",
      "building_number": "55",
      "street_name": "Rue du Saint-Germain",
      "city": "Paris",
      "postal_code": "75008 ",
      "country_code": "FR"
    },
    "transaction_lines": [
      {
        "product_class": "P",
        "quantity": 1,
        "description": "Smoked herrings",
        "amount": "19.95",
        "custom_id": "51315A00-DC44-408E-A575-8CE42A32AE1B",
        "import_address":{
            "country_code": "FR"
        },
        "ship_from_address": {
            "building_number": "12",
            "street_name": "Wessex End Street",
            "city": "London",
          "postal_code": "SW1A 2AA",
          "country_code": "GB"
        },
        "product_cn_code": "0305420000"
      }
    ]
  }
}

Sample Response

{
    "transaction": {
        "ship_to_address": {
            "city": "Paris",
            "country_code": "FR",
            "postal_code": "75008 ",
            "street_name": "Rue du Saint-Germain",
            "address_detail": "Chateuax 12",
            "building_number": "55",
            "tax_region": "EU"
        },
        "amount": 19.95,
        "required_fields": {
            "tax_required_fields": [],
            "audit_required_fields": [],
            "storage_required_fields": []
        },
        "marketplace_code": "Taxamo",
        "tax_country_codes": "FR",
        "key": "PkwXc6wAAG85PZFTRCmIC3yf6qRphOzcvkUZN7g",
        "tax_amount": 2,
        "invoice_timestamp": "2021-09-10T10:45:03Z",
        "tax_liability_owner_codes": "Taxamo",
        "create_timestamp": "2021-09-10T10:45:03Z",
        "countries": {},
        "transaction_lines": [
            {
                "description": "Smoked herrings",
                "reverse_charge": false,
                "amount": 19.95,
                "tax_rule_applied": "physical-tax",
                "unit_price": 19.95,
                "taxes": [
                    {
                        "rate": 10,
                        "tax_name": "European VAT",
                        "rate_type": "Reduced",
                        "amount_fraction_taxable": 1,
                        "tax_base_amount": 19.95
                    }
                ],
                "tax_amount": 2,
                "import_address": {
                    "country_code": "FR",
                    "tax_region": "EU"
                },
                "tax_liability_rule": "physical-shipment-into-EU-goods-below-150-eur-with-ioss-non-EU-supplier",
                "platform_liability_assumed_amount": 19.95,
                "seller_tax_number": "IE3764989CH",
                "tax_region": "EU",
                "invoice_place": "The RDI Hub, Killarney Road, Killorglin, Co. Kerry, V93 KP68",
                "tax_exempt": false,
                "additional_currencies": {
                    "consignment": {
                        "currency_code": "EUR",
                        "fx_date": "2021-09-10T10:45:03Z",
                        "fx_rate": 1,
                        "fx_source": "ECB"
                    }
                },
                "tax_country_code": "FR",
                "special_tax_scheme": "IOSS",
                "line_key": "eG0ylX-MdCzNWGCE",
                "custom_id": "51315A00-DC44-408E-A575-8CE42A32AE1B",
                "tax_address_kind": "ship_to_address",
                "ship_from_address": {
                    "city": "London",
                    "country_code": "GB",
                    "postal_code": "SW1A 2AA",
                    "street_name": "Wessex End Street",
                    "building_number": "12",
                    "tax_region": "GB"
                },
                "tax_engine": "taxamo",
                "invoice_status": "R",
                "kind": "b2c",
                "tax_number_service": "vies",
                "product_class": "P",
                "fees": [
                    {
                        "amount": {
                            "amount": 2,
                            "currency_code": "EUR"
                        },
                        "fee_key": "VoHHQllPSnCR1HTM",
                        "rule": "tax-fee",
                        "type": "tax-fee",
                        "seller_code": "seller_jftest_1",
                        "currency_code": "EUR"
                    }
                ],
                "tax_liability_owner_code": "Taxamo",
                "line_num": 1,
                "is_seller_permanent": true,
                "quantity": 1,
                "total_amount": 21.95,
                "seller_code": "seller_jftest_1",
                "product_cn_code": "0305420000",
                "tax_entity_name": "France",
                "tax_supported": true
            }
        ],
        "discounts": [],
        "location_evidence": {},
        "vouchers": [],
        "refunded_tax_amount": 0,
        "product_classes": "P",
        "billing_address": {
            "city": "Paris",
            "country_code": "FR",
            "postal_code": "75008 ",
            "street_name": "Rue du Saint-Germain",
            "address_detail": "Chateuax 12",
            "building_number": "55",
            "tax_region": "EU"
        },
        "status": "N",
        "refunded_total_amount": 0,
        "update_timestamp": "2021-09-10T10:45:03Z",
        "fees": [
            {
                "amount": {
                    "amount": 2,
                    "currency_code": "GBP"
                },
                "fee_key": "EkL16A2sibGBAj6a",
                "rule": "flat-fee",
                "type": "amount-fee",
                "seller_code": "seller_jftest_1"
            }
        ],
        "buyer_name": "Eric Papin",
        "tax_timestamp": "2021-09-10T10:45:03Z",
        "total_amount": 21.95,
        "currency_code": "EUR"
    }
}