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 (payment, refund, credit note, or adjustment).
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>"
}| Field | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | Transaction type: PAYMENT, REFUND, CREDIT_NOTE, ADJUSTMENT |
| contact_id | string | Yes | Reference to the Contact |
| currency_id | string | Yes | ISO 4217 currency code |
| amount | number | Yes | Transaction amount (always positive) |
| invoice_id | string | No* | Reference to associated Invoice |
| order_id | string | No | Reference to associated Order |
| subscription_id | string | No | Reference to Subscription (for recurring payments) |
| payment_method_type | string | No | Payment method (for payments): CARD, BANK_TRANSFER, PAYPAL, etc. |
| description | string | No | Human-readable description |
| original_transaction_id | string | No* | For refunds, the original payment transaction ID |
| reason | string | No | Reason code for refunds/credits |
| metadata | object | No | Additional platform-specific data |
invoice_id or order_id typically requiredoriginal_transaction_id requiredinvoice_id or contact_id required| Type | Description | Required Fields |
|---|---|---|
PAYMENT | Record a contact payment | contact_id, amount, invoice_id or order_id |
REFUND | Refund a previous payment | amount, original_transaction_id |
CREDIT_NOTE | Apply credit to contact account | contact_id, amount |
ADJUSTMENT | Manual balance adjustment | contact_id, amount, description |
The Commenda company ID.
Transaction type.
PAYMENT, REFUND, CREDIT_NOTE, FEE, CHARGEBACK, PAYOUT, ADJUSTMENT Reference to the Contact.
ISO 4217 currency code.
Transaction amount (always positive).
CARD, BANK_TRANSFER, WIRE_TRANSFER, PAYPAL, APPLE_PAY, GOOGLE_PAY, CHECK, CASH, CRYPTO, OTHER, UNKNOWN For refunds, the original payment transaction ID.
CUSTOMER_REQUEST, DUPLICATE, FRAUD, QUALITY_ISSUE, BILLING_ERROR, LOYALTY_DISCOUNT, PROMOTIONAL, ADJUSTMENT, OTHER Transaction created successfully
V4 unified Transaction model consolidating payments, refunds, and credit notes.
The unique ID we assign for that data's information
157
The date at which RootFi first synced this data
"2024-01-22T05:07:31.465Z"
The latest date at which RootFi updated this data
"2024-01-22T05:07:31.000Z"
The ID of the company in the accounting platform
1089
An unique custom RootFi ID made from platform's unique_id.
"123456"
The date at which the data was deleted in the accounting platform
The ID of the data in the accounting platform.
A JSON containing fields that you can directly get from the accounting platform.
The hash of the data
Type of transaction (PAYMENT, REFUND, CREDIT_NOTE, FEE, CHARGEBACK, PAYOUT, ADJUSTMENT).
PAYMENT, REFUND, CREDIT_NOTE, FEE, CHARGEBACK, PAYOUT, ADJUSTMENT Reference to the associated Invoice.
Reference to the associated Order (if applicable).
Reference to the associated Subscription (for recurring payments).
Reference to the Contact.
ISO 4217 currency code.
Transaction amount (always positive; type indicates direction).
Current status of the transaction (DRAFT, REQUIRES_ACTION, PENDING, AUTHORIZED, PAID, FAILED, CANCELED, REFUNDED).
DRAFT, REQUIRES_ACTION, PENDING, AUTHORIZED, PAID, FAILED, CANCELED, REFUNDED Payment method used (for payments).
CARD, BANK_TRANSFER, WIRE_TRANSFER, PAYPAL, APPLE_PAY, GOOGLE_PAY, CHECK, CASH, CRYPTO, OTHER, UNKNOWN Payment gateway/processor name (e.g., stripe, razorpay).
Platform-specific transaction ID from the gateway.
For refunds/reversals, reference to the original payment.
Human-readable reference number.
Human-readable description of the transaction.
Standardized reason code (primarily for refunds and credit notes).
CUSTOMER_REQUEST, DUPLICATE, FRAUD, QUALITY_ISSUE, BILLING_ERROR, LOYALTY_DISCOUNT, PROMOTIONAL, ADJUSTMENT, OTHER Platform-specific reason code.
Additional platform-specific data.
Original transaction timestamp from platform (ISO 8601).
Last update timestamp from platform (ISO 8601).