Transaction Details

Transaction details are modelled at the transaction and line level.

You can use the Transactions object to send transaction information to and from the API.

Transaction Object

The Transaction object refers to the JSON structure that contains most of the information that you need to send to the API.

You can include the following information at the Transaction object level:

  • Currency code
  • Buyer's details
  • Ship-to Address

For example:

"{
  "transaction": {
    "currency_code": "EUR",
     "buyer_name": "Jane Murphy",
    "buyer_email": "jane.murphy@example.,com",
    "ship_to_address": {
      "street_name": "5 Shop Street",
      "city": "Cork",
      "postal_code": "GHT10256",
      "country_code": "IE"
    },
    "description": "Shoes",
    "transaction_lines": [
      {
        "custom_id": "EG_101",
        "amount": 1.99,
        "ship_from_address": {
          "country_code"": "CN"
        },
        "product_class": "P",
        "description": "Shoes",
        "parcel_reference": "ABC_123",
        "carrier_id": "DHL",
        "product_cn_code": "01022110000",
        "product_reference_number": ""
      }
    ]
  }
}"

For a full list of the fields available in the Transaction object, see Transaction Object Fields.

Transaction Lines Object

The API is designed so that you can include any necessary information at the transaction and transaction line item level.

Transaction line item information is specified in the Transaction Lines object. You can specify information such as the following:

  • Transaction amounts
  • Your ecommerce or order ID (custom_id field)
  • Product identifiers and classifications
  • Addresses
  • Refunds

For example:

"transaction_lines": [
      {
        "custom_id": "EG_101",
        "amount": 1.99,
        "ship_from_address": {
          "country_code": "CN"
        },
        "product_class": "P",
        "description": "Shoes",
        "parcel_reference": "ABC_123",
        "carrier_id": "DHL",
        "product_cn_code": "01022110000",
        "product_reference_number": ""
      }
    ]
  }
}"

When the API receives this request, it will generate an identifier for the line called a line_key:

"tax_country_code": "FR",
                "special_tax_scheme": "IOSS",
                "line_key": "ZP4J3BMePMEYMoPt",
                "custom_id": "51315A00-DC44-408E-A575-8CE42A32AE1B",

For a full list of the fields in this object, see Transaction Lines Object Fields.