Skip to main content
POST
/
payments
/
transactions
Create Transaction
curl --request POST \
  --url https://api.rootfi.dev/v4/payments/transactions \
  --header 'Content-Type: application/json' \
  --header 'api_key: <api-key>' \
  --data '
{
  "company_id": 123,
  "type": "PAYMENT",
  "contact_id": "<string>",
  "currency_id": "<string>",
  "amount": 123,
  "invoice_id": "<string>",
  "order_id": "<string>",
  "subscription_id": "<string>",
  "payment_method_type": "CARD",
  "original_transaction_id": "<string>",
  "description": "<string>",
  "reason": "CUSTOMER_REQUEST",
  "metadata": {}
}
'
{
  "rootfi_id": 157,
  "rootfi_created_at": "2024-01-22T05:07:31.465Z",
  "rootfi_updated_at": "2024-01-22T05:07:31.000Z",
  "rootfi_company_id": 1089,
  "platform_id": "123456",
  "rootfi_deleted_at": "2023-11-07T05:31:56Z",
  "platform_unique_id": "<string>",
  "raw_data": {},
  "data_hash": "<string>",
  "type": "PAYMENT",
  "invoice_id": "<string>",
  "order_id": "<string>",
  "subscription_id": "<string>",
  "contact_id": "<string>",
  "currency_id": "<string>",
  "amount": 123,
  "status": "DRAFT",
  "payment_method_type": "CARD",
  "gateway": "<string>",
  "gateway_transaction_id": "<string>",
  "original_transaction_id": "<string>",
  "reference_number": "<string>",
  "description": "<string>",
  "reason": "CUSTOMER_REQUEST",
  "reason_code": "<string>",
  "metadata": {},
  "created_at": "<string>",
  "updated_at": "<string>"
}
Create a new transaction in the payment platform. The unified Transaction model supports creating payments, refunds, credit notes, and adjustments.

Request Body

FieldTypeRequiredDescription
typestringYesTransaction type: PAYMENT, REFUND, CREDIT_NOTE, ADJUSTMENT
contact_idstringYesReference to the Contact
currency_idstringYesISO 4217 currency code
amountnumberYesTransaction amount (always positive)
invoice_idstringNo*Reference to associated Invoice
order_idstringNoReference to associated Order
subscription_idstringNoReference to Subscription (for recurring payments)
payment_method_typestringNoPayment method (for payments): CARD, BANK_TRANSFER, PAYPAL, etc.
descriptionstringNoHuman-readable description
original_transaction_idstringNo*For refunds, the original payment transaction ID
reasonstringNoReason code for refunds/credits
metadataobjectNoAdditional platform-specific data
*Required fields vary by transaction type:
  • Payment: invoice_id or order_id typically required
  • Refund: original_transaction_id required
  • Credit Note: invoice_id or contact_id required

Transaction Types

TypeDescriptionRequired Fields
PAYMENTRecord a contact paymentcontact_id, amount, invoice_id or order_id
REFUNDRefund a previous paymentamount, original_transaction_id
CREDIT_NOTEApply credit to contact accountcontact_id, amount
ADJUSTMENTManual balance adjustmentcontact_id, amount, description
See Transaction Overview for complete field details.

Authorizations

api_key
string
header
required

Body

application/json
company_id
integer
required

The Commenda company ID.

type
enum<string>
required

Transaction type.

Available options:
PAYMENT,
REFUND,
CREDIT_NOTE,
FEE,
CHARGEBACK,
PAYOUT,
ADJUSTMENT
contact_id
string
required

Reference to the Contact.

currency_id
string
required

ISO 4217 currency code.

amount
number<double>
required

Transaction amount (always positive).

invoice_id
string | null
order_id
string | null
subscription_id
string | null
payment_method_type
enum<string> | null
Available options:
CARD,
BANK_TRANSFER,
WIRE_TRANSFER,
PAYPAL,
APPLE_PAY,
GOOGLE_PAY,
CHECK,
CASH,
CRYPTO,
OTHER,
UNKNOWN
original_transaction_id
string | null

For refunds, the original payment transaction ID.

description
string | null
reason
enum<string> | null
Available options:
CUSTOMER_REQUEST,
DUPLICATE,
FRAUD,
QUALITY_ISSUE,
BILLING_ERROR,
LOYALTY_DISCOUNT,
PROMOTIONAL,
ADJUSTMENT,
OTHER
metadata
object

Response

Transaction created successfully

V4 unified Transaction model consolidating payments, refunds, and credit notes.

rootfi_id
number<double>
required

The unique ID we assign for that data's information

Example:

157

rootfi_created_at
string<date-time>
required

The date at which RootFi first synced this data

Example:

"2024-01-22T05:07:31.465Z"

rootfi_updated_at
string<date-time>
required

The latest date at which RootFi updated this data

Example:

"2024-01-22T05:07:31.000Z"

rootfi_company_id
number<double>
required

The ID of the company in the accounting platform

Example:

1089

platform_id
string
required

An unique custom RootFi ID made from platform's unique_id.

Example:

"123456"

rootfi_deleted_at
string<date-time> | null

The date at which the data was deleted in the accounting platform

platform_unique_id
string | null

The ID of the data in the accounting platform.

raw_data
object

A JSON containing fields that you can directly get from the accounting platform.

data_hash
string | null

The hash of the data

type
enum<string> | null

Type of transaction (PAYMENT, REFUND, CREDIT_NOTE, FEE, CHARGEBACK, PAYOUT, ADJUSTMENT).

Available options:
PAYMENT,
REFUND,
CREDIT_NOTE,
FEE,
CHARGEBACK,
PAYOUT,
ADJUSTMENT
invoice_id
string | null

Reference to the associated Invoice.

order_id
string | null

Reference to the associated Order (if applicable).

subscription_id
string | null

Reference to the associated Subscription (for recurring payments).

contact_id
string | null

Reference to the Contact.

currency_id
string | null

ISO 4217 currency code.

amount
number<double> | null

Transaction amount (always positive; type indicates direction).

status
enum<string> | null

Current status of the transaction (DRAFT, REQUIRES_ACTION, PENDING, AUTHORIZED, PAID, FAILED, CANCELED, REFUNDED).

Available options:
DRAFT,
REQUIRES_ACTION,
PENDING,
AUTHORIZED,
PAID,
FAILED,
CANCELED,
REFUNDED
payment_method_type
enum<string> | null

Payment method used (for payments).

Available options:
CARD,
BANK_TRANSFER,
WIRE_TRANSFER,
PAYPAL,
APPLE_PAY,
GOOGLE_PAY,
CHECK,
CASH,
CRYPTO,
OTHER,
UNKNOWN
gateway
string | null

Payment gateway/processor name (e.g., stripe, razorpay).

gateway_transaction_id
string | null

Platform-specific transaction ID from the gateway.

original_transaction_id
string | null

For refunds/reversals, reference to the original payment.

reference_number
string | null

Human-readable reference number.

description
string | null

Human-readable description of the transaction.

reason
enum<string> | null

Standardized reason code (primarily for refunds and credit notes).

Available options:
CUSTOMER_REQUEST,
DUPLICATE,
FRAUD,
QUALITY_ISSUE,
BILLING_ERROR,
LOYALTY_DISCOUNT,
PROMOTIONAL,
ADJUSTMENT,
OTHER
reason_code
string | null

Platform-specific reason code.

metadata
object

Additional platform-specific data.

created_at
string | null

Original transaction timestamp from platform (ISO 8601).

updated_at
string | null

Last update timestamp from platform (ISO 8601).