Transactions API

Create Transaction

This API endpoint (POST) creates a transaction. If the request succeeds, it returns a Transaction Object.

Body Parameters

customer object * Configure the customer object if you like to create the invoice for an existing customer. Required if new_customer is not set.

JSON

  • id string * The id of the customer.
  • billing_address_id string The id of the customer's billing address. Configuring a billing address is not required for most use cases but is recommended.
  • shipping_address_id string The id of the customer's shipping address. Required if the invoice has shipping requirements.
  • same_shipping_address boolean Set it to true, if you like the shipping information to be the same as the billing information.
  • shipping_information object (example) Configure this object if you like to save a new shipping address for the customer while creating the transaction.
  • billing_information object (example) Configure this object if you like to save a new billing address for the customer while creating the transaction.
    


new_customer object * (full example) The customer details for the invoice. Required if customer is not set.

JSON



products array of objects * The products to purchase. You can offer your existing Tamio Products or create invoice items for this transaction.



Example: Existing Products #1

The example below shows how to configure the request for your Tamio products. The quantity parameter is optional; if not provided, it will default to 1.

Example


Example: Existing Products #2

The example below shows how to configure the request for a Tamio product with variants. Variants can be configured on physical products and services. If a product has variants and a variant id is not provided in the request, it will be rejected from the transaction.

Example


Example: Existing Product - Selling Packs #3

Some products, such as physical goods, can be sold in packs. The example below shows how to configure the request to purchase three packs of a specific product.

Example


Example: Invoice Item #4

The example below shows how to configure the request for an invoice item. Each invoice item must have a name and a price (in cents). The quantity attribute is optional. The currency of the invoice item will always match the transaction currency.

Exampe



currency string (currency code) The currency of the transaction. This is optional but the most basic way of configuring the currency of a transaction. Required if convert_prices is not provided.

Transactions can be created in any currency if activated on your account. The currency affects which products are allowed to be included in the order, which discounts can be applied and what shipping methods can be used.

In the example below, the transaction currency is set to Euros. If the product's supported currencies include Euros, it will be validated and included in the transaction.

Example



convert_prices boolean In the example below, if the product does not support Euros, its default price will be converted to Euros.

Example


In the example below, if no common currency is found, the products' default currencies will be converted to your account's default currency.

Example



locale string (Language Codes) The customer's language. The default is English (en).



coupons array of strings An array of strings, each representing a coupon that you want to validate for this transaction.



page string The id of the Tamio page associated with this transaction.



affiliate string The id of the affiliate that referred this order. When provided, the appropriate commission will be credited to the affiliate once a transaction is finalised and payment is received.