Skip to main content
POST
/
ecommerce
/
transactions
Create Transaction
curl --request POST \
  --url https://api.rootfi.dev/v4/ecommerce/transactions \
  --header 'Content-Type: application/json' \
  --header 'api_key: <api-key>' \
  --data '
{
  "company_id": 1089,
  "data": [
    {
      "type": "PAYMENT",
      "order_id": "ord_shopify_001",
      "currency_id": "USD",
      "amount": 97.19,
      "status": "PAID",
      "payment_method_type": "CARD",
      "gateway": "shopify_payments",
      "description": "Payment for order ORD-2024-001"
    }
  ]
}
'
{
  "data": [
    {
      "rootfi_id": 8001,
      "rootfi_created_at": "2024-01-22T05:07:31.465Z",
      "rootfi_updated_at": "2024-01-22T05:07:31.000Z",
      "rootfi_company_id": 1089,
      "platform_id": "pay_shopify_001",
      "type": "PAYMENT",
      "order_id": "ord_shopify_001",
      "contact_id": "cus_001",
      "currency_id": "USD",
      "amount": 97.19,
      "status": "PAID",
      "payment_method_type": "CARD",
      "gateway": "shopify_payments",
      "description": "Payment for order ORD-2024-001",
      "created_at": "2024-01-22T05:07:31.465Z",
      "updated_at": "2024-01-22T05:07:31.000Z"
    }
  ],
  "sync_id": "sync_123456"
}
Create a new transaction in the e-commerce platform. Transactions represent all monetary movements including payments, refunds, chargebacks, and adjustments.

Request Body

FieldTypeRequiredDescription
company_idintegerYesThe rootfi_company_id to associate this transaction with
dataarrayYesArray of transaction objects to create
data[].typestringYesType of transaction (PAYMENT, REFUND, CHARGEBACK, ADJUSTMENT)
data[].order_idstringYesReference to the associated Order
data[].contact_idstringNoReference to the Contact
data[].currency_idstringYesISO 4217 currency code (e.g., USD, EUR)
data[].amountnumberYesTransaction amount (always positive, use type to determine direction)
data[].statusstringNoTransaction status (REQUIRES_ACTION, PENDING, AUTHORIZED, PAID, FAILED, CANCELED, REFUNDED, UNKNOWN, REVERSED). Defaults to PENDING
data[].payment_method_typestringNoPayment method used (CARD, BANK_TRANSFER, WIRE_TRANSFER, etc.)
data[].gatewaystringNoPayment processor or gateway name (e.g., “shopify”, “stripe”)
data[].gateway_transaction_idstringNoTransaction ID from the payment gateway
data[].original_transaction_idstringNoFor refunds, reference to the original payment transaction
data[].descriptionstringNoHuman-readable description of the transaction
data[].reasonstringNoReason for the transaction (primarily used for refunds)
See Transaction Overview for complete field details.

Authorizations

api_key
string
header
required

Body

application/json
company_id
integer
required

The ID of the company in the accounting platform

data
ecommerceTransactionsFields · object[]
required

The data of the transactions endpoint

run_async
boolean | null

Run the request asynchronously

Response

Transaction created successfully

data
ecommerceTransactionObject · object[]
required

The data of the transactions endpoint

sync_id
string | null

The sync id of the request