Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.grainfinance.co/llms.txt

Use this file to discover all available pages before exploring further.

Envelope fields

Every webhook notification includes these top-level metadata fields:
FieldTypeDescription
eventIdstringDeterministic unique UUID. Use for idempotency and deduplication.
environmentstring”Live” or “Sandbox”.
createdAtTsnumberUnix timestamp (ms) indicating when the event was created.
versionstringPayload schema version. Currently “1.0”.
organizationIdstringUUID of the organization the event belongs to.

Events summary

EventTrigger
hedge.cancelledHedge has been canceled.
hedge.completedHedge has been fully settled.
hedge.overdueHedge has passed its settlement date without settling.
hedge.initial.collateral.receivedInitial collateral deposit has been received.
hedge.initial.collateral.overdueInitial collateral deposit is past due.
hedge.upcoming.settlementSettlement date is approaching.
wallet.deposit.receivedA deposit has been received into a wallet.

hedge.cancelled

Sent when a hedge is canceled by the customer or by the system. Payload fields:
FieldTypeDescription
hedgeIdstringUnique identifier of the hedge.
fromCurrencystringSource currency code (e.g., “USD”).
fromCurrencyAmountnumberAmount in the source currency.
toCurrencystringTarget currency code (e.g., “EUR”).
toCurrencyAmountnumberAmount in the target currency.
settlementTypestring”full”, “offset”, or “manual”.
externalTransactionIdstringExternal transaction identifier.
cancelledAtstringDate the hedge was canceled (YYYY-MM-DD).
cancelReasonstringReason for cancellation.
Example payload:
{
  "environment": "Live",
  "version": "1.0",
  "organizationId": "98f7e6d5-c4b3-2a10-9876-543210fedcba",
  "eventId": "hedge-cancelled_c3d4e5f6-a7b8-9012-cdef-123456789012",
  "createdAtTs": 1710932100000,
  "type": "hedge.cancelled",
  "data": {
    "hedgeId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "fromCurrency": "USD",
    "fromCurrencyAmount": 100000,
    "toCurrency": "EUR",
    "toCurrencyAmount": 91250,
    "settlementType": "full",
    "externalTransactionId": "ext_tx_001",
    "cancelledAt": "2026-03-20",
    "cancelReason": "Requested by customer"
  }
}

hedge.completed

Sent when a hedge is fully settled on its settlement date. Payload fields:
FieldTypeDescription
hedgeIdstringUnique identifier of the hedge.
fromCurrencystringSource currency code (e.g., “USD”).
fromCurrencyAmountnumberAmount in the source currency.
toCurrencystringTarget currency code (e.g., “EUR”).
toCurrencyAmountnumberAmount in the target currency.
settlementTypestring”full”, “offset”, or “manual”.
externalTransactionIdstringExternal transaction identifier.
completedAtstringDate the hedge was settled (YYYY-MM-DD).
Example payload:
{
  "environment": "Live",
  "version": "1.0",
  "organizationId": "98f7e6d5-c4b3-2a10-9876-543210fedcba",
  "eventId": "hedge-completed_a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "createdAtTs": 1711461000000,
  "type": "hedge.completed",
  "data": {
    "hedgeId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "fromCurrency": "USD",
    "fromCurrencyAmount": 100000,
    "toCurrency": "EUR",
    "toCurrencyAmount": 91250,
    "settlementType": "full",
    "externalTransactionId": "ext_tx_001",
    "completedAt": "2026-03-26"
  }
}

hedge.overdue

Sent when a hedge passes its settlement date without being settled. Payload fields:
FieldTypeDescription
hedgeIdstringUnique identifier of the hedge.
fromCurrencystringSource currency code (e.g., “USD”).
fromCurrencyAmountnumberAmount in the source currency.
toCurrencystringTarget currency code (e.g., “EUR”).
toCurrencyAmountnumberAmount in the target currency.
settlementTypestring”full”, “offset”, or “manual”.
externalTransactionIdstringExternal transaction identifier.
overdueAtstringDate the hedge became overdue (YYYY-MM-DD).
Example payload:
{
  "environment": "Live",
  "version": "1.0",
  "organizationId": "98f7e6d5-c4b3-2a10-9876-543210fedcba",
  "eventId": "hedge-overdue_b2c3d4e5-f6a7-8901-bcde-f12345678901",
  "createdAtTs": 1711524000000,
  "type": "hedge.overdue",
  "data": {
    "hedgeId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "fromCurrency": "USD",
    "fromCurrencyAmount": 100000,
    "toCurrency": "EUR",
    "toCurrencyAmount": 91250,
    "settlementType": "full",
    "externalTransactionId": "ext_tx_001",
    "overdueAt": "2026-03-27"
  }
}

hedge.initial.collateral.received

Sent when the initial collateral deposit for a hedge has been received. Payload fields:
FieldTypeDescription
hedgeIdstringUnique identifier of the hedge.
fromCurrencystringSource currency code (e.g., “USD”).
fromCurrencyAmountnumberAmount in the source currency.
toCurrencystringTarget currency code (e.g., “EUR”).
toCurrencyAmountnumberAmount in the target currency.
settlementTypestring”full”, “offset”, or “manual”.
externalTransactionIdstringExternal transaction identifier.
initialCollateralAmountnumberAmount of collateral received.
initialCollateralReceivedAtstringDate the collateral was received (YYYY-MM-DD).
Example payload:
{
  "environment": "Live",
  "version": "1.0",
  "organizationId": "98f7e6d5-c4b3-2a10-9876-543210fedcba",
  "eventId": "hedge-initial-collateral-received_d4e5f6a7-b8c9-0123-defa-234567890123",
  "createdAtTs": 1710496500000,
  "type": "hedge.initial.collateral.received",
  "data": {
    "hedgeId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "fromCurrency": "USD",
    "fromCurrencyAmount": 100000,
    "toCurrency": "EUR",
    "toCurrencyAmount": 91250,
    "settlementType": "full",
    "externalTransactionId": "ext_tx_001",
    "initialCollateralAmount": 5000,
    "initialCollateralReceivedAt": "2026-03-15"
  }
}

hedge.initial.collateral.overdue

Sent when the initial collateral deposit has not been received by its due date. Payload fields:
FieldTypeDescription
hedgeIdstringUnique identifier of the hedge.
fromCurrencystringSource currency code (e.g., “USD”).
fromCurrencyAmountnumberAmount in the source currency.
toCurrencystringTarget currency code (e.g., “EUR”).
toCurrencyAmountnumberAmount in the target currency.
settlementTypestring”full”, “offset”, or “manual”.
externalTransactionIdstringExternal transaction identifier.
initialCollateralAmountnumberExpected collateral amount.
initialCollateralDueAtstringDate the collateral was due (YYYY-MM-DD).
Example payload:
{
  "environment": "Live",
  "version": "1.0",
  "organizationId": "98f7e6d5-c4b3-2a10-9876-543210fedcba",
  "eventId": "hedge-initial-collateral-overdue_e5f6a7b8-c9d0-1234-efab-345678901234",
  "createdAtTs": 1710576000000,
  "type": "hedge.initial.collateral.overdue",
  "data": {
    "hedgeId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "fromCurrency": "USD",
    "fromCurrencyAmount": 100000,
    "toCurrency": "EUR",
    "toCurrencyAmount": 91250,
    "settlementType": "full",
    "externalTransactionId": "ext_tx_001",
    "initialCollateralAmount": 5000,
    "initialCollateralDueAt": "2026-03-15"
  }
}

hedge.upcoming.settlement

Sent as a reminder that a hedge settlement date is approaching. Payload fields:
FieldTypeDescription
hedgeIdstringUnique identifier of the hedge.
fromCurrencystringSource currency code (e.g., “USD”).
fromCurrencyAmountnumberAmount in the source currency.
toCurrencystringTarget currency code (e.g., “EUR”).
toCurrencyAmountnumberAmount in the target currency.
settlementTypestring”full”, “offset”, or “manual”.
externalTransactionIdstringExternal transaction identifier.
settlementAtstringUpcoming settlement date (YYYY-MM-DD).
Example payload:
{
  "environment": "Live",
  "version": "1.0",
  "organizationId": "98f7e6d5-c4b3-2a10-9876-543210fedcba",
  "eventId": "hedge-upcoming-settlement_f6a7b8c9-d0e1-2345-fabc-456789012345",
  "createdAtTs": 1711180800000,
  "type": "hedge.upcoming.settlement",
  "data": {
    "hedgeId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "fromCurrency": "USD",
    "fromCurrencyAmount": 100000,
    "toCurrency": "EUR",
    "toCurrencyAmount": 91250,
    "settlementType": "full",
    "externalTransactionId": "ext_tx_001",
    "settlementAt": "2026-03-26"
  }
}

wallet.deposit.received

Sent when a deposit is received into a wallet. Payload fields:
FieldTypeDescription
walletIdstringUnique identifier of the wallet.
transferIdstringUnique identifier of the transfer.
currencystringCurrency code of the deposit (e.g., “USD”).
amountnumberDeposit amount.
completedAtstringDate the deposit was completed (YYYY-MM-DD).
depositedBystring | nullName of the depositing entity, if available.
Example payload:
{
  "environment": "Live",
  "version": "1.0",
  "organizationId": "98f7e6d5-c4b3-2a10-9876-543210fedcba",
  "eventId": "wallet-deposit-received_a7b8c9d0-e1f2-3456-abcd-567890123456",
  "createdAtTs": 1711200000000,
  "type": "wallet.deposit.received",
  "data": {
    "walletId": "f1e2d3c4-b5a6-7890-fedc-ba0987654321",
    "transferId": "f6a7b8c9-d0e1-2345-f012-678901234567",
    "currency": "USD",
    "amount": 25000,
    "completedAt": "2026-03-23",
    "depositedBy": "Acme Corp"
  }
}