Transactions

Transactions are fundamental to financial services, representing the movement of funds between accounts. On this page, we’ll dive into the different transactions endpoints you can use to manage transactions programmatically. We'll look at how to query, create, update, and delete transaction records.

The transaction model

The transaction model contains all the information related to a transaction, including the transaction amount, type, and status.

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the transaction record.

  • Name
    account_id
    Type
    string
    Description

    Unique identifier for the account involved in the transaction.

  • Name
    amount
    Type
    number
    Description

    Amount of the transaction.

  • Name
    type
    Type
    string
    Description

    Type of transaction (e.g., credit, debit).

  • Name
    status
    Type
    string
    Description

    Status of the transaction (e.g., pending, completed, failed).

  • Name
    created_at
    Type
    timestamp
    Description

    Timestamp of when the transaction was created.

  • Name
    updated_at
    Type
    timestamp
    Description

    Timestamp of when the transaction was last updated.


GET/v1/transactions

List all transactions

This endpoint allows you to retrieve a paginated list of all your transaction records. By default, a maximum of ten records are shown per page.

Optional attributes

  • Name
    limit
    Type
    integer
    Description

    Limit the number of transaction records returned.

  • Name
    account_id
    Type
    string
    Description

    Only show records for the specified account.

  • Name
    type
    Type
    string
    Description

    Only show records with the specified transaction type.

  • Name
    status
    Type
    string
    Description

    Only show records with the specified status.

Request

GET
/v1/transactions
curl -G https://api.finx.ai/v1/transactions \
  -H "Authorization: Bearer {token}" \
  -d limit=10

Response

{
  "has_more": false,
  "data": [
    {
      "id": "xgQQXg3hrtjh7AvZ",
      "account_id": "WAz8eIbvDR60rouK",
      "amount": 100.00,
      "type": "credit",
      "status": "completed",
      "created_at": 705103200,
      "updated_at": 705103200
    },
    {
      "id": "hSIhXBhNe8X1d8Et"
      // ...
    }
  ]
}

POST/v1/transactions

Create a transaction

This endpoint allows you to add a new transaction record. You need to provide the account ID, amount, type, and status to create a transaction record.

Required attributes

  • Name
    account_id
    Type
    string
    Description

    Unique identifier for the account involved in the transaction.

  • Name
    amount
    Type
    number
    Description

    Amount of the transaction.

  • Name
    type
    Type
    string
    Description

    Type of transaction (e.g., credit, debit).

  • Name
    status
    Type
    string
    Description

    Status of the transaction (e.g., pending, completed, failed).

Request

POST
/v1/transactions'
curl https://api.finx.ai/v1/transactions \
  -H "Authorization: Bearer {token}" \
  -d 'account_id'="WAz8eIbvDR60rouK" \
  -d 'amount'=100.00 \
  -d 'type'="credit" \
  -d 'status'="pending"

Response

{
  "id": "xgQQXg3hrtjh7AvZ",
  "account_id": "WAz8eIbvDR60rouK",
  "amount": 100.00,
  "type": "credit",
  "status": "pending",
  "created_at": 705103200,
  "updated_at": 705103200
}

GET/v1/transactions/:id

Retrieve a transaction

This endpoint allows you to retrieve a transaction record by providing the record id. Refer to the list at the top of this page to see which properties are included with transaction objects.

Request

GET
/v1/transactions/xgQQXg3hrtjh7AvZ
curl https://api.finx.ai/v1/transactions/xgQQXg3hrtjh7AvZ \
  -H "Authorization: Bearer {token}"

Response

{
  "id": "xgQQXg3hrtjh7AvZ",
  "account_id": "WAz8eIbvDR60rouK",
  "amount": 100.00,
  "type": "credit",
  "status": "completed",
  "created_at": 705103200,
  "updated_at": 705103200
}

PUT/v1/transactions/:id

Update a transaction

This endpoint allows you to perform an update on a transaction record. Examples of updates are changing the amount, updating the type, or modifying the status.

Optional attributes

  • Name
    amount
    Type
    number
    Description

    Updated amount of the transaction.

  • Name
    type
    Type
    string
    Description

    Updated type of transaction.

  • Name
    status
    Type
    string
    Description

    Updated status of the transaction.

Request

PUT
/v1/transactions/xgQQXg3hrtjh7AvZ
curl -X PUT https://api.finx.ai/v1/transactions/xgQQXg3hrtjh7AvZ \
  -H "Authorization: Bearer {token}" \
  -d 'status'="completed"


Response

{
  "id": "xgQQXg3hrtjh7AvZ",
  "account_id": "WAz8eIbvDR60rouK",
  "amount": 100.00,
  "type": "credit",
  "status": "completed",
  "created_at": 705103200,
  "updated_at": 705103200
}

DELETE/v1/transactions/:id

Delete a transaction

This endpoint allows you to delete your transaction records in Fin X. Note: This will permanently delete the record and all its data — ensure this is the desired action before proceeding.

Request

DELETE
/v1/transactions/xgQQXg3hrtjh7AvZ
curl -X DELETE https://api.finx.ai/v1/transactions/xgQQXg3hrtjh7AvZ \
  -H "Authorization: Bearer {token}"

Was this page helpful?