Fiat Transactions

Endpoints to post and manage fiat transactions for contracts

Post a Fiat Transaction

Whenever a Fiat Transaction such as a payment or interest / fees have been posted, a new Fiat Transaction can be added to the contract transactions. This will impact the current balance on the contract and will reflect in the history of the contract.

Request format

method: 'POST'
endpoint: '/api/external/arc/fiat-transaction'
headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'your api key' }
body: {
  "contractId": "string",
  "transactionType": "balanceDecrease",
  "amount": 0,
  "currency": "usd",
  "description": "string",
  "timestamp": 0
}

Response format

{
  "_id": "123456789012",
  "contractId": "123456789012",
  "transactionType": "balanceDecrease",
  "previousBalance": 0,
  "currentBalance": 0,
  "amount": {
    "fiatValue": 0,
    "btcValue": 0,
    "currency": "usd",
    "exchangeRate": 0
  },
  "description": "string",
  "timestamp": 0
}

Response fields

Field
Description

_id

The transaction ID

contactId

The contract ID associated with the transaction

transactionType

Either "balanceDecrease" or "balanceIncrease"

previousBalance

The contract's balance before the transaction was applied

currentBalance

The contract's balance after the transaction was applied

amount

An object with the transaction amount

fiatValue

The amount that was passed in on the transaction in the fiat currency requested with currency

btcValue

The amount of Fiat Currency in Bitcoin at the exchange rate specified by the exchangeRate

currency

The Fiat Currency specified for the transaction

exchangeRate

The exchange rate used, which is a blended rate using multiple sources including Coinbase, CoinGecko, CoinCap

description

The description passed in on the original request

timestamp

The timestamp of the original transaction passed on the request

Last updated