Fern Developer Docs
  • Overview
    • Fern overview
    • Earning revenue with Fern
    • Developer dashboard
    • Help & support
  • Coverage
    • Customer types
    • Restricted customer geographies
  • Fiat currency support
  • Cryptocurrency support
  • Guides
    • Core API concepts
    • Create and verify customers
      • Requirements for Individuals
      • Requirements for Businesses
      • Customer statuses
      • Country codes
    • Create Fern wallets
    • First-party onramps
    • First-party offramps
    • Webhooks
      • Events
      • Sample Payloads
      • Verification
      • Retries
  • API reference
    • Customers
    • Payment accounts
    • Quotes
    • Transactions
      • Additional details
  • Advanced
    • Slippage and price impact
    • Rate limits
Powered by GitBook
On this page
Export as PDF
  1. API reference

Transactions

Use this API to create and get transactions for a customer and a quote. Requires the creation of a quote beforehand per transaction.

Last updated 1 month ago

List transactions

get

List all transactions for a customer

Authorizations
Query parameters
pageTokenstringOptional

Page token to fetch entries after

Example: abc
pageSizeinteger · min: 1 · max: 100Optional

Number of entries to fetch

Example: 10
customerIdstring · uuidOptional

Customer to list transaction for

Example: 072a8b7b-38c7-429a-a6cf-35dae7f2fb77
Responses
200
Response schema for listing transactions
application/json
400
Bad Request
application/json
401
Unauthorized
application/json
403
Forbidden
application/json
404
Not Found
application/json
500
Internal Server Error
application/json
get
GET /transactions HTTP/1.1
Host: api.fernhq.com
Authorization: Bearer API Key
Accept: */*
{
  "transactions": [
    {
      "transactionId": "1d8beb26-b4d1-47ee-8e5d-0d3905f200c7",
      "transactionStatus": "PROCESSING",
      "correlationId": "03b7030f-6da1-4e76-3352-3debd82112c8",
      "source": {
        "sourcePaymentAccountId": "072a8b7b-38c7-429a-a6cf-35dae7f2fb77",
        "sourceCurrency": "USD",
        "sourcePaymentMethod": "ACH",
        "sourceAmount": "100.00"
      },
      "destination": {
        "destinationPaymentAccountId": "072a8b7b-38c7-429a-a6cf-35dae7f2fb77",
        "destinationPaymentMethod": "ETHEREUM",
        "destinationCurrency": "USDC",
        "exchangeRate": "1.2",
        "destinationAmount": "100",
        "minGuaranteedDestinationAmount": "98"
      },
      "fees": {
        "feeCurrency": "5.50",
        "fernFee": {
          "feeAmount": "5.45",
          "feeUSDAmount": "5.45"
        },
        "developerFee": {
          "feeAmount": "5.45",
          "feeUSDAmount": "5.45"
        }
      },
      "transferInstructions": {
        "type": "fiat",
        "transferPaymentMethod": "ACH",
        "transferMessage": "Payment for order #12345",
        "transferBankName": "First National Bank",
        "transferBankAddress": "123 Bank St, Finance City",
        "transferBankAccountNumber": "987654321",
        "transferRoutingNumber": "123456789",
        "transferBankBeneficiaryName": "John Doe",
        "transferIban": "GB29NWBK60161331926819",
        "transferBicSwift": "DEUTDEFF",
        "transferIfscCode": "SBIN0005943",
        "transferSortCode": "40-47-36",
        "transferBsbNumber": "082-902",
        "transferTransitNumber": "12345",
        "transferBankCode": "001",
        "transferClabeNumber": "002010077777777771",
        "transferRoutingCode": "ROUT1234",
        "transferBranchCode": "0001",
        "transferClearingCode": "110000",
        "transferCnapsCode": "102033003330",
        "transferNubanCode": "1234567890",
        "transferPixCode": "user@bank.com"
      },
      "createdAt": "2023-08-01T12:00:00Z",
      "updatedAt": "2023-08-01T12:00:00Z"
    }
  ],
  "nextPageToken": "xyz"
}
  • POSTCreate transaction
  • GETGet transaction
  • GETList transactions

Get transaction

get

Get a transaction by ID

Authorizations
Path parameters
transactionIdstring · uuidRequired

Unique identifier of the transaction

Example: 1d8beb26-b4d1-47ee-8e5d-0d3905f200c7
Responses
200
Response schema for a transaction creation request
application/json
400
Bad Request
application/json
401
Unauthorized
application/json
403
Forbidden
application/json
404
Not Found
application/json
500
Internal Server Error
application/json
get
GET /transactions/{transactionId} HTTP/1.1
Host: api.fernhq.com
Authorization: Bearer API Key
Accept: */*
{
  "transactionId": "1d8beb26-b4d1-47ee-8e5d-0d3905f200c7",
  "transactionStatus": "PROCESSING",
  "correlationId": "03b7030f-6da1-4e76-3352-3debd82112c8",
  "source": {
    "sourcePaymentAccountId": "072a8b7b-38c7-429a-a6cf-35dae7f2fb77",
    "sourceCurrency": "USD",
    "sourcePaymentMethod": "ACH",
    "sourceAmount": "100.00"
  },
  "destination": {
    "destinationPaymentAccountId": "072a8b7b-38c7-429a-a6cf-35dae7f2fb77",
    "destinationPaymentMethod": "ETHEREUM",
    "destinationCurrency": "USDC",
    "exchangeRate": "1.2",
    "destinationAmount": "100",
    "minGuaranteedDestinationAmount": "98"
  },
  "fees": {
    "feeCurrency": "5.50",
    "fernFee": {
      "feeAmount": "5.45",
      "feeUSDAmount": "5.45"
    },
    "developerFee": {
      "feeAmount": "5.45",
      "feeUSDAmount": "5.45"
    }
  },
  "transferInstructions": {
    "type": "fiat",
    "transferPaymentMethod": "ACH",
    "transferMessage": "Payment for order #12345",
    "transferBankName": "First National Bank",
    "transferBankAddress": "123 Bank St, Finance City",
    "transferBankAccountNumber": "987654321",
    "transferRoutingNumber": "123456789",
    "transferBankBeneficiaryName": "John Doe",
    "transferIban": "GB29NWBK60161331926819",
    "transferBicSwift": "DEUTDEFF",
    "transferIfscCode": "SBIN0005943",
    "transferSortCode": "40-47-36",
    "transferBsbNumber": "082-902",
    "transferTransitNumber": "12345",
    "transferBankCode": "001",
    "transferClabeNumber": "002010077777777771",
    "transferRoutingCode": "ROUT1234",
    "transferBranchCode": "0001",
    "transferClearingCode": "110000",
    "transferCnapsCode": "102033003330",
    "transferNubanCode": "1234567890",
    "transferPixCode": "user@bank.com"
  },
  "createdAt": "2023-08-01T12:00:00Z",
  "updatedAt": "2023-08-01T12:00:00Z"
}

Create transaction

post

Create a transactionCreates a transaction using a given quoteID. QuoteID must be valid and not expired.

Authorizations
Header parameters
x-idempotency-keystringRequired
Body

Schema for creating a new transaction

quoteIdstring · uuidRequired

Identifier of the quote to initiate the transaction

Example: c88ebfc2-3356-48b5-b2bb-6fca7b618c96
correlationIdstringOptional

Optional: You can add your own correlationId to match the transaction to your own internal records.

Example: 03b7030f-6da1-4e76-3352-3debd82112c8
Responses
201
Response schema for a transaction creation request
application/json
400
Bad Request
application/json
401
Unauthorized
application/json
403
Forbidden
application/json
404
Not Found
application/json
500
Internal Server Error
application/json
post
POST /transactions HTTP/1.1
Host: api.fernhq.com
Authorization: Bearer API Key
x-idempotency-key: text
Content-Type: application/json
Accept: */*
Content-Length: 105

{
  "quoteId": "c88ebfc2-3356-48b5-b2bb-6fca7b618c96",
  "correlationId": "03b7030f-6da1-4e76-3352-3debd82112c8"
}
{
  "transactionId": "1d8beb26-b4d1-47ee-8e5d-0d3905f200c7",
  "transactionStatus": "PROCESSING",
  "correlationId": "03b7030f-6da1-4e76-3352-3debd82112c8",
  "source": {
    "sourcePaymentAccountId": "072a8b7b-38c7-429a-a6cf-35dae7f2fb77",
    "sourceCurrency": "USD",
    "sourcePaymentMethod": "ACH",
    "sourceAmount": "100.00"
  },
  "destination": {
    "destinationPaymentAccountId": "072a8b7b-38c7-429a-a6cf-35dae7f2fb77",
    "destinationPaymentMethod": "ETHEREUM",
    "destinationCurrency": "USDC",
    "exchangeRate": "1.2",
    "destinationAmount": "100",
    "minGuaranteedDestinationAmount": "98"
  },
  "fees": {
    "feeCurrency": "5.50",
    "fernFee": {
      "feeAmount": "5.45",
      "feeUSDAmount": "5.45"
    },
    "developerFee": {
      "feeAmount": "5.45",
      "feeUSDAmount": "5.45"
    }
  },
  "transferInstructions": {
    "type": "fiat",
    "transferPaymentMethod": "ACH",
    "transferMessage": "Payment for order #12345",
    "transferBankName": "First National Bank",
    "transferBankAddress": "123 Bank St, Finance City",
    "transferBankAccountNumber": "987654321",
    "transferRoutingNumber": "123456789",
    "transferBankBeneficiaryName": "John Doe",
    "transferIban": "GB29NWBK60161331926819",
    "transferBicSwift": "DEUTDEFF",
    "transferIfscCode": "SBIN0005943",
    "transferSortCode": "40-47-36",
    "transferBsbNumber": "082-902",
    "transferTransitNumber": "12345",
    "transferBankCode": "001",
    "transferClabeNumber": "002010077777777771",
    "transferRoutingCode": "ROUT1234",
    "transferBranchCode": "0001",
    "transferClearingCode": "110000",
    "transferCnapsCode": "102033003330",
    "transferNubanCode": "1234567890",
    "transferPixCode": "user@bank.com"
  },
  "createdAt": "2023-08-01T12:00:00Z",
  "updatedAt": "2023-08-01T12:00:00Z"
}