GuardQuote

Parse natural language guard transaction text using AI

Parses a natural language description of a guard transaction into structured fields using LLM integration (Google Gemini).

Example Request:

{
  "text": "Thames Trading needs to buy €650k against GBP in 45 days for supplier invoice TT-2025-443 with 25 basis points and they want to pay later"
}

Example Response:

{
  "payReceive": "PAY",
  "foreignCurrency": "EUR",
  "guardCurrency": "GBP",
  "foreignAmount": 650000,
  "guardSettlementWindowTo": "2026-01-06T00:00:00Z",
  "salesMarginRate": 0.0025,
  "externalRef": "TT-2025-443",
  "companyName": "Thames Trading",
  "isPayLater": true,
  "amountInputMode": "foreign",
  "reason": "Supplier invoice TT-2025-443"
}

What gets parsed:

  • Direction: "buy" → PAY
  • Amount: "€650k" → 650000 (foreignAmount)
  • Amount mode: "foreign" (indicates foreignAmount was specified, not targetGuardAmount)
  • Currency pair: "€" → EUR, "against GBP" → GBP
  • Settlement: "in 45 days" → calculated date
  • Margin: "25 basis points" → 0.0025 (decimal rate)
  • Reference: "invoice TT-2025-443" → TT-2025-443
  • Company/Customer: Returned as strings (companyName, customerName, customerEmail) for client-side fuzzy matching
  • Payment terms: "pay later" → true
  • Context: "supplier invoice" → extracted to reason field

The parsed fields can then be used to pre-populate a guard quote request. Client performs fuzzy matching against their company/customer lists.

post/api-regulated/v1/guard-quotes/smart-parse

Request

  • Base URL: https://api.currencyguard.com
  • URL: https://api.currencyguard.com/api-regulated/v1/guard-quotes/smart-parse
  • Auth: HTTP bearer

Request body

textstring required

Natural language text describing the guard transaction

Example request

{
  "text": "Thames Trading needs to buy €650k against GBP in 45 days for supplier invoice TT-2025-443 with 25 basis points and they want to pay later"
}

Response

Text successfully parsed

payReceive'PAY' | 'RECEIVE'

Indicates whether the guard will pay or receive foreign currency

foreignCurrencystring

Foreign currency of this guard (ISO 4217 code)

guardCurrencystring

Guard currency, typically the corporate base currency (ISO 4217 code)

foreignAmountnumber

Amount of the guard in the foreign currency

targetGuardAmountnumber

Target amount in guard currency (net of fees) - alternative to foreignAmount

guardSettlementWindowTostring

End settlement window of this guard in ISO 8601 format

salesMarginRatenumber

Sales margin rate as a decimal (e.g., 0.0025 = 25bps = 0.25%)

salesMarginAmountnumber

Sales margin as an absolute amount in guard currency

guardMarginRatenumber

Guard margin rate as a decimal, incorporated into the guard fee (e.g., 0.01 = 1%)

paymentMarginAtInceptionnumber

Payment margin rate inside the guard rate, applied at inception, as a decimal (e.g., 0.01 = 1%)

externalRefstring

External reference such as invoice or contract number

companyNamestring

Parsed company name for fuzzy matching

customerNamestring

Parsed customer contact name

customerEmailstring

Customer email address

isPayLaterboolean

Whether pay-later option was requested

amountInputMode'foreign' | 'guard'

Amount input mode indicating which amount was specified

reasonstring

Additional context or notes about the guard transaction

Example response

{
  "payReceive": "PAY",
  "foreignCurrency": "EUR",
  "guardCurrency": "GBP",
  "foreignAmount": 650000,
  "targetGuardAmount": 735000,
  "guardSettlementWindowTo": "2026-01-06T00:00:00Z",
  "salesMarginRate": 0.0025,
  "salesMarginAmount": 800,
  "guardMarginRate": 0.01,
  "paymentMarginAtInception": 0.01,
  "externalRef": "TT-2025-443",
  "companyName": "Thames Trading",
  "customerName": "John Smith",
  "customerEmail": "john.smith@thamestrading.co.uk",
  "isPayLater": true,
  "amountInputMode": "foreign",
  "reason": "Supplier invoice TT-2025-443"
}

Changes

No recorded changes to this operation across all 1 revision of this API.