RocketKOR

Design  /  Transaction Use Cases  /  Create a Transaction

Create a Transaction

Overview

In this use case, we’ll walk through creating a financial transaction. A transaction requires two Financial Accounts: a debit account and a credit account. These accounts must belong to the Business Account associated with the access token included in the request.

Debit Financial Account
The funds will be taken from this account. The debit account can be a Business Financial Account or a Customer Financial Account.

Credit Financial Account
The funds will be transferred to this account. The credit account can be a Business Financial Account, a Customer Financial Account, or a Recipient Financial Account.

Prerequisites

Create any Cusomer card or bank account Financial Accounts needed for the transaction.

Create any Recipient card or bank account Financial Accounts needed for the transaction.

API Operation

Steps

Send a request to the following endpoint:

POST ​/v1​/transactions

  • Include an Authorization header with your RocketKOR access token as a Bearer Token.
  • Include a unique idempotency key in the Idempotency-Key header. The idempotency key is a unique string that identifies the transaction. For details, see the API Reference.
  • Include details about the transaction in the request body (debit and credit Financial Accounts, amount, Provider, currency, and so on). For a list of required fields, see the API Reference.

Sample Request

The following request would create a new ACH SEND transaction.

				
					{
  "metadata": {
    "myPaymentId": "100000333",
    "invoiceNumber": "123232333",
    "authorizedBy": "user@email.com"
  },
  "debitFinancialAccountId": "6a017f06-83a3-44b7-be6f-5e5cae4a9ed7",
  "creditFinancialAccountId": "4py56a34-4686-1539-c2ga-1a723g55dlq3",
  "transactionType": "SEND",
  "solution": "ach",
  "paymentReasonId": "loan-payouts",
  "amount": 1000.00,
  "currency": "USD",
  "settlementPriority": "SAME_DAY"
}
				
			

Sample Response

If the transaction creation request is successful, a unique ID is returned for the transaction. The transaction details and status are also returned. For details, see the Transaction object.

				
					{
  "id": "2av81w47-9367-1295-h4ng-1q520p28wfn1",
  "businessAccountId": "4hy47a98-2453-9867-u3qa-5p347q98kim4",
  "metadata": {
    "myPaymentId": "100000333",
    "invoiceNumber": "123232333",
    "authorizedBy": "user@email.com"
  },
  "debitFinancialAccountId": "6a017f06-83a3-44b+7-be6f-5e5cae4a9ed7",
  "creditFinancialAccountId": "4py56a34-4686-1539-c2ga-1a723g55dlq3",
  "transactionType": "SEND",
  "solution": "ach",
  "paymentReasonId": "loan-payouts",
  "paymentReason": "Loan Payouts",
  "amount": 1000.00,
  "currency": "USD",
  "settlementPriority": "SAME_DAY",
  "latestStatus": {
    "status": "NEW",
    "message": "Transaction creation successful",
    "createdAt": "2021-07-01T17:40:22.601Z"
  },
  "createdAt": "2021-07-01T17:40:22.601Z",
  "createdBy": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "type": "EMPLOYEE"
  },
  "reversalReason": ""
}
				
			
ON THIS PAGE