Skip to main content
cURL
curl --request POST \
  --url https://api.grainfinance.co/v1/customers/{customerId}/hedges/{hedgeId}/early-settlement/accept \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "earlySettlementProposalId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
'
{
  "id": "8173b9a7-ee61-413e-b9e3-7c04b2a067c5",
  "customerId": "1b0ada1e-fa1b-4cfe-a553-01b340c5650e",
  "status": "Active",
  "transactionId": "4d78ac65-2c3f-47e2-8bf3-3f76124e9d27",
  "externalTransactionId": "780231b3ae0d7e9e5097nd89",
  "fromCurrency": "MXN",
  "toCurrency": "USD",
  "externalCustomerId": "630231b3ae0d7e9e5097ad35",
  "toCurrencyAmount": 1560,
  "fromCurrencyAmount": 32161.8,
  "fixedSide": "toCurrencyAmount",
  "initialCollateralAmount": 1608.09,
  "quote": 20.6165,
  "externalMarkupPct": 1,
  "acceptedAtTs": 1674057600,
  "issuedAt": "2023-01-18",
  "endAt": "2023-02-23",
  "updatedAt": "2023-01-18",
  "cancelledAt": null,
  "initialCollateralReceivedAt": null,
  "fundsReceivedAt": null,
  "completedAt": null,
  "completedAtTs": null,
  "overdueAt": "2023-02-28",
  "settlementAt": "2023-02-23",
  "settlementType": "full",
  "adjustedMtmChangePct": 0.0125,
  "adjustedMtmChangeTs": 1674144000
}

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.

Authorizations

Authorization
string
header
required

Basic authentication using the partner API keys from https://console.grainfinance.co/api-keys

Path Parameters

customerId
string
required

The id of the customer within the Grain platform.

hedgeId
string
required

The id of the hedge within the Grain platform.

Body

application/json

The payload required to accept an early settlement proposal

The payload required to accept an early settlement proposal

earlySettlementProposalId
string
required

The unique identifier of the early settlement proposal to accept.

Example:

"a1b2c3d4-e5f6-7890-abcd-ef1234567890"

Response

Early Settlement Accepted

Hedge objects represent transactions which are currently hedged.

id
string<uuid>
required

The id of the hedge within the Grain platform.

Pattern: [0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}
Example:

"8173b9a7-ee61-413e-b9e3-7c04b2a067c5"

customerId
string<uuid>
required

The id of the customer within the Grain platform.

Pattern: [0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}
Example:

"1b0ada1e-fa1b-4cfe-a553-01b340c5650e"

status
enum<string>
required

The Status of the Hedge

Available options:
Active,
Cancelled,
Completed,
InProcess,
Overdue
Example:

"Active"

transactionId
string<uuid>
required

The id of the transaction within the Grain platform.

Pattern: [0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}
Example:

"4d78ac65-2c3f-47e2-8bf3-3f76124e9d27"

externalTransactionId
string
required

The transaction id as identified within your system.

Example:

"780231b3ae0d7e9e5097nd89"

fromCurrency
string
required

The currency in which the transaction should be paid at by your customer.

Example:

"MXN"

toCurrency
string
required

The currency in which the inventory item is listed at on your platform.

Example:

"USD"

externalCustomerId
string
required

The id used to identify the customer within your platform

Example:

"630231b3ae0d7e9e5097ad35"

toCurrencyAmount
number<double>
required

The amount to hedge in the toCurrency. If fromCurrencyAmount is provided, then toCurrencyAmount calculated as: toCurrencyAmount = fromCurrencyAmount / quote

Example:

1560

fromCurrencyAmount
number<double>
required

The amount to hedge in the fromCurrency. If toCurrencyAmount is provided, then fromCurrencyAmount calculated as: fromCurrencyAmount = toCurrencyAmount * quote

Example:

32161.8

fixedSide
enum<string>
required

Indicates which currency amount was fixed (specified) when creating the hedge. When fixedSide is toCurrencyAmount, the toCurrencyAmount was specified and fromCurrencyAmount was calculated. When fixedSide is fromCurrencyAmount, the fromCurrencyAmount was specified and toCurrencyAmount was calculated.

Available options:
toCurrencyAmount,
fromCurrencyAmount
Example:

"toCurrencyAmount"

initialCollateralAmount
number<double>
required

The initial collateral amount required for this hedge in the fromCurrency. Calculated as fromCurrencyAmount * initialCollateralPercentage.

Example:

1608.09

quote
number<double>
required

The rate locked by this hedge.

Example:

20.6165

externalMarkupPct
number<double> | null
required

The external markup percentage that should be added to this quote on top of Grain’s internal pricing. For example, a value of 1.0 represents a 1.0% additional markup.

Example:

1

acceptedAtTs
number<double>
required

The unix timestamp in which the hedge offer was accepted (if it was).

Example:

1659625088

issuedAt
string<YYYY-MM-DD>
required

The date in which the hedge was issued, denoted in YYYY-MM-DD format.

Pattern: \d{4}-\d{2}-\d{2}
Example:

"2023-01-18"

endAt
string<YYYY-MM-DD>
required

The date in which the hedge will be settled, denoted in YYYY-MM-DD format.

Pattern: \d{4}-\d{2}-\d{2}
Example:

"2023-02-23"

updatedAt
string<YYYY-MM-DD>
required

The date in which the hedge was last modified, denoted in YYYY-MM-DD format.

Pattern: \d{4}-\d{2}-\d{2}
Example:

"2023-02-23"

cancelledAt
string<YYYY-MM-DD>
required

The date in which the hedge was cancelled, denoted in YYYY-MM-DD format.

Pattern: \d{4}-\d{2}-\d{2}
Example:

"2023-02-23"

initialCollateralReceivedAt
string<YYYY-MM-DD>
required

The date in which the initial collateral was received, denoted in YYYY-MM-DD format. Null if not yet received.

Pattern: \d{4}-\d{2}-\d{2}
Example:

"2023-01-20"

fundsReceivedAt
string<YYYY-MM-DD>
required

The date in which the funds of the hedge arrived, afterwards the settlement occurs denoted in YYYY-MM-DD format.

Pattern: \d{4}-\d{2}-\d{2}
Example:

"2023-02-23"

completedAt
string<YYYY-MM-DD>
required

The date in which the hedge was completed, denoted in YYYY-MM-DD format.

Pattern: \d{4}-\d{2}-\d{2}
Example:

"2023-02-23"

completedAtTs
number<double> | null
required

The unix timestamp in which the hedge was completed.

Example:

1659625090

overdueAt
string<YYYY-MM-DD>
required

The date in which the hedge will become overdue, denoted in YYYY-MM-DD format.

Pattern: \d{4}-\d{2}-\d{2}
Example:

"2023-02-23"

settlementAt
string<YYYY-MM-DD>
required

The date in which the hedge begins settlement, denoted in YYYY-MM-DD format.

Pattern: \d{4}-\d{2}-\d{2}
Example:

"2023-02-23"

settlementType
enum<string>
required

The method in which the hedge is being settled. If 'full' type is set, the total hedge amount should be sent to Grain prior to settlement

Available options:
full
adjustedMtmChangePct
number<double> | null
required

The percentage change in the adjusted mark-to-market value since the previous valuation

Example:

0.0125

adjustedMtmChangeTs
number<double> | null
required

The timestamp at which the latest adjusted mark-to-market change was calculated.

Example:

1674057600