Skip to main content

Grain API (1.0.0)

Download OpenAPI specification:Download

Grain's API provides a comprehensive set of endpoints for managing hedging, spot transactions, pricing, and fund movements - enabling seamless integration of FX workflows into your platform. Each API call follows REST conventions, uses secure authentication, and returns standardized responses for consistency across environments.

Hedges

Hedge objects represent transactions that lock exchange rates for future dates. A single hedge locks an exchange rate for a future transaction between two currencies.

Real-time Quote

Generates a real-time rate proposal for a new hedge associated with the specified customer. Once accepted, this proposal becomes a confirmed hedge.

Authorizations:
api-key
path Parameters
customerId
required
string

The id of the customer within the Grain platform.

header Parameters
X-Customer-IP
required
string <IPv4> (CustomerIP)

The IPv4 address of the browser from which the customer contacts your platform.
example: 192.158.1.38

Request Body schema: application/json
required

The payload required in order to ask for a hedge quote

fromCurrency
required
string

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

toCurrency
required
string

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

toCurrencyAmount
number <double>

The amount of toCurrency to hedge, using this amount and the hedge rate will determine the fromCurrency amount of the hedge.

externalMarkupPct
number <double>

Optional external markup percentage to be applied to the hedge quote. This markup is applied on top of Grain's internal pricing and will be reflected in the final quote rate. Value must be between 0 and 100 (representing 0% to 100%). For example, 1.0 means a 1.0% markup, 0.5 means 0.5% markup, not basis points. If not provided, defaults to 0 (no external markup).

endAt
required
string <YYYY-MM-DD> (GrainDateFormat)

The date format accepted by Grain's API. We accept dash separated ISO-8601 date-only strings.

Responses

Request samples

Content type
application/json
{
  • "fromCurrency": "MXN",
  • "toCurrency": "USD",
  • "toCurrencyAmount": 1560,
  • "externalMarkupPct": 1,
  • "endAt": "2023-04-15"
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "fromCurrency": "MXN",
  • "toCurrency": "USD",
  • "quote": 20.6165,
  • "validUntilTs": 1659625098,
  • "endAt": "2023-04-15",
  • "initialCollateralPercentage": 5,
  • "toCurrencyAmount": 1560,
  • "fromCurrencyAmount": 32161.8,
  • "externalMarkupPct": 1
}

Real-time Accept

Accepts a previously generated real-time rate proposal and creates the hedge transaction.

Authorizations:
api-key
path Parameters
customerId
required
string

The id of the customer within the Grain platform.

header Parameters
X-Customer-IP
required
string <IPv4> (CustomerIP)

The IPv4 address of the browser from which the customer contacts your platform.
example: 192.158.1.38

Request Body schema: application/json
required

The payload required in order to accept a hedge

hedgeProposalId
required
string

The id of the hedge proposal to accept.

endAt
string <YYYY-MM-DD> (GrainDateFormat)

The date format accepted by Grain's API. We accept dash separated ISO-8601 date-only strings.

toCurrencyAmount
number <double>

The amount to hedge in the toCurrency, if amount was not specified on quote, it should be specified on Accept. This value is rounded up to two decimal places to ensure precision in the hedging process. For example, an input of 3052.1124 will be rounded to 3052.12.

externalTransactionId
required
string

The transaction id, as identified within your system - required when creating a new hedge.

extraFields
object (ExtraFieldsParam)

Additional fields that provide further details about the transaction. These fields should be specified as a valid JSON object.

Responses

Request samples

Content type
application/json
{
  • "hedgeProposalId": "8173b9a7-ee61-413e-b9e3-7c04b2a067c5",
  • "endAt": "2023-04-15",
  • "toCurrencyAmount": 1560,
  • "externalTransactionId": "780231b3ae0d7e9e5097nd89",
  • "extraFields": {
    }
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "transactionId": "75906707-8c31-479c-b354-aa805c4cefbc"
}

Offline Quotes

Retrieves offline hedge quote proposals for selected currency pairs. Partners can use these pre-fetched proposals - avoiding the need for a real-time quote per transaction.

Authorizations:
api-key
query Parameters
pairs
string

Optional query parameter specifying currency pairs. Multiple pairs can be provided as a comma-separated list. Please encode the query param beforehand. For example, ?pairs=EURUSD%2CGBPEUR represents ?pairs=EURUSD,GBPEUR

Responses

Response samples

Content type
application/json
{
  • "tenorCalculationDate": "2023-12-21",
  • "validUntilTs": 1703770471,
  • "rates": {
    },
  • "revision": 156
}

Offline Accept

Accepts a previously retrieved offline rate proposal and books the hedge accordingly.

Authorizations:
api-key
path Parameters
customerId
required
string

The id of the customer within the Grain platform.

header Parameters
X-Customer-IP
required
string <IPv4> (CustomerIP)

The IPv4 address of the browser from which the customer contacts your platform.
example: 192.158.1.38

Request Body schema: application/json
required

The payload required in order to accept an offline quote hedge

revision
required
number <double>

The id of the revision that defines the accepted rate for the currency-pair and tenor.

fromCurrency
required
string

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

toCurrency
required
string

the currency you want to buy.

toCurrencyAmount
required
number <double>

The amount to hedge in the toCurrency.

endAt
required
string <YYYY-MM-DD> (GrainDateFormat)

The date format accepted by Grain's API. We accept dash separated ISO-8601 date-only strings.

rate
required
number <double>

Represents the exchange rate according to the offline map of currency pairs to tenor object.

The calculation of the tenor is based on the difference in calendar days between the 'tenorCalculationDate' and the 'endAt' date:

  • If the number of calendar days from 'tenorCalculationDate' to endAt is less than or equal to 7, the tenor is 7 days.
  • If the number of calendar days from 'tenorCalculationDate' to endAt is greater than 7 and less than or equal to 14, the tenor is 14 days.
  • If the number of calendar days from 'tenorCalculationDate' to endAt is greater than 14 and less than or equal to 30, the tenor is 30 days.
  • If the number of calendar days from 'tenorCalculationDate' to endAt is greater than 30 and less than or equal to 60, the tenor is 60 days.
  • ...
  • If the number of calendar days from 'tenorCalculationDate' to endAt is greater than 330 and less than or equal to 360, the tenor is 360 days.

When counting the difference in calendar days, every day is counted as one regardless of the duration of the day. This means that the calculation includes all days: weekends, holidays, and weekdays alike.

For example, if the 'endAt' date is 2023-12-16 and the 'tenorCalculationDate' is 2024-12-15, the result is 1 calendar day.

To calculate the difference in calendar days accurately, we recommend using a date manipulation library, such as date-fns and its differenceInCalendarDays function, or a similar feature provided by other date libraries.

externalTransactionId
string

Optional The transaction id, as identified within your system.

extraFields
object (ExtraFieldsParam)

Additional fields that provide further details about the transaction. These fields should be specified as a valid JSON object.

Responses

Request samples

Content type
application/json
{
  • "revision": 156,
  • "fromCurrency": "MXN",
  • "toCurrency": "USD",
  • "toCurrencyAmount": 100000,
  • "endAt": "2023-04-15",
  • "rate": 20.616512,
  • "externalTransactionId": "780231b3ae0d7e9e5097nd89",
  • "extraFields": {
    }
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "transactionId": "75906707-8c31-479c-b354-aa805c4cefbc"
}

Get

Retrieves detailed information for a specific hedge.

Authorizations:
api-key
path Parameters
customerId
required
string

The id of the customer within the Grain platform.

hedgeId
required
string

The id of the hedge within the Grain platform.

Responses

Response samples

Content type
application/json
Example
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "customerId": "87d8e330-2878-4742-a86f-dbbb3bf522ac",
  • "status": "Active",
  • "transactionId": "75906707-8c31-479c-b354-aa805c4cefbc",
  • "fromCurrency": "MXN",
  • "toCurrency": "USD",
  • "externalCustomerId": "630231b3ae0d7e9e5097ad35",
  • "toCurrencyAmount": 1560,
  • "fromCurrencyAmount": 32161.8,
  • "quote": 20.6165,
  • "externalMarkupPct": 1,
  • "acceptedAtTs": 1659625088,
  • "issuedAt": "2023-04-15",
  • "endAt": "2023-04-15",
  • "updatedAt": "2023-04-15",
  • "cancelledAt": "2023-02-23",
  • "fundsReceivedAt": "2023-02-23",
  • "completedAt": "2023-02-23",
  • "completedAtTs": 1659625090,
  • "overdueAt": "2023-04-15",
  • "settlementAt": "2023-04-15",
  • "settlementType": "collection"
}

Cancel

Cancels an existing hedge.

Authorizations:
api-key
path Parameters
customerId
required
string

The id of the customer within the Grain platform.

hedgeId
required
string

The id of the hedge within the Grain platform.

header Parameters
X-Customer-IP
required
string <IPv4> (CustomerIP)

The IPv4 address of the browser from which the customer contacts your platform.
example: 192.158.1.38

Request Body schema: application/json
required
reason
string

Description of the reason the hedge was canceled.

Responses

Request samples

Content type
application/json
{
  • "reason": "Transaction cancelled by customer"
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "transactionId": "75906707-8c31-479c-b354-aa805c4cefbc"
}

List

Retrieves all hedges associated with the given customer.

Authorizations:
api-key
path Parameters
customerId
required
string

The id of the customer within the Grain platform.

query Parameters
page
number <double> (Page) >= 1

page number indicating which set of items to return

per_page
number <double> (PerPage) [ 1 .. 100 ]

The number of items in a page

Responses

Response samples

Content type
application/json
{
  • "hedges": [
    ],
  • "pagination": {
    }
}

Dual Hedges

A dual hedge mitigates FX risk by automatically generating two linked hedge legs - a customer leg and a supplier leg - both routed through the customer's functional currency. This structure reduces exposure to currency fluctuations for both cash flow and accounting purposes, while allowing independent tracking and reporting of each hedge leg.

Offline Quotes

Returns a full table of dual hedge rate proposals for all configured currency pairs. Each rate represents a pair of customer and supplier leg proposals routed through the functional currency. Partners can pre-fetch and cache these rates for both legs.

Authorizations:
api-key
query Parameters
pairs
string

Optional query parameter specifying currency pairs. Multiple pairs can be provided as a comma-separated list. Please encode the query param beforehand. For example, ?pairs=EURUSD%2CGBPEUR represents ?pairs=EURUSD,GBPEUR

Responses

Response samples

Content type
application/json
{
  • "functionalCurrency": "EUR",
  • "tenorCalculationDate": "2023-12-21",
  • "validUntilTs": 1703770471,
  • "rates": {
    },
  • "revision": 156
}

Offline Accept

Accepts a dual hedge rate proposal and books both customer and supplier hedge legs at their proposed rates and tenors.

Authorizations:
api-key
path Parameters
customerId
required
string

The id of the customer within the Grain platform.

header Parameters
X-Customer-IP
required
string <IPv4> (CustomerIP)

The IPv4 address of the browser from which the customer contacts your platform.
example: 192.158.1.38

Request Body schema: application/json
required

The payload required to accept an offline quote for a dual hedge

revision
required
number <double>

The id of the revision that defines the accepted rate for the currency-pair and tenor.

fromCurrency
required
string

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

toCurrency
required
string

The currency you want to buy.

customerToCurrencyAmount
required
number <double>

The amount to hedge in the toCurrency for the customer.

vendorToCurrencyAmount
required
number <double>

The amount to hedge in the toCurrency for the vendor.

customerEndAt
required
string

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

vendorEndAt
required
string

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

rate
required
number <double>

Represents the offline hedge rate determined by a two-dimensional lookup based on the vendor and customer tenors.

Calculating Tenors:

Tenors are calculated from the calendar-day difference between the tenorCalculationDate and the vendor/customer end dates, then mapped into the nearest supported tenor bucket:

  • 0 and ≤ 7 calendar days → 7-day tenor

  • 7 and ≤ 14 calendar days → 14-day tenor

  • 14 and ≤ 30 calendar days → 30-day tenor

  • 30 and ≤ 60 calendar days → 60-day tenor

  • 60 and ≤ 90 calendar days → 90-day tenor

  • … continues in similar ranges up to 720 days

Note: All calendar days count — weekends and holidays included.

Rate Lookup Example:

The rate is retrieved from a two-dimensional map using both tenors:

"USDMXN": {
  "7": { "7": 1.1 },
  "14": { "7": 1.2, "14": 1.3 },
  "30": { "7": 1.1, "14": 1.1, "30": 1.1 },
  // ... and so on
}

In this example, if the vendor tenor is 14 days and the customer tenor is 7 days, the rate would be 1.2.

To calculate the difference in calendar days accurately, we recommend using a date manipulation library, such as date-fns and its differenceInCalendarDays function, or a similar feature provided by other date libraries.

externalTransactionId
required
string

The transaction id, as identified within your system.

extraFields
object (ExtraFieldsParam)

Additional fields that provide further details about the transaction. These fields should be specified as a valid JSON object.

Responses

Request samples

Content type
application/json
{
  • "revision": 156,
  • "fromCurrency": "MXN",
  • "toCurrency": "USD",
  • "customerToCurrencyAmount": 100000,
  • "vendorToCurrencyAmount": 100000,
  • "customerEndAt": "2024-02-23",
  • "vendorEndAt": "2024-02-23",
  • "rate": 20.616512,
  • "externalTransactionId": "780231b3ae0d7e9e5097nd89",
  • "extraFields": {
    }
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "transactionId": "75906707-8c31-479c-b354-aa805c4cefbc",
  • "hedgeIds": [
    ]
}

Get

Retrieves details of a specific dual hedge, including both underlying legs and their respective proposals.

Authorizations:
api-key
path Parameters
customerId
required
string

The id of the customer within the Grain platform.

dualHedgeId
required
string

The id of the dual hedge within the Grain platform.

Responses

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "issuedAt": "2023-04-15",
  • "customerId": "87d8e330-2878-4742-a86f-dbbb3bf522ac",
  • "functionalCurrency": "EUR",
  • "fromCurrency": "MXN",
  • "toCurrency": "USD",
  • "hedges": [
    ]
}

Cancel

Cancels a dual hedge and its underlying customer and supplier legs.

Authorizations:
api-key
path Parameters
customerId
required
string

The id of the customer within the Grain platform.

dualHedgeId
required
string

The id of the dual hedge within the Grain platform.

header Parameters
X-Customer-IP
required
string <IPv4> (CustomerIP)

The IPv4 address of the browser from which the customer contacts your platform.
example: 192.158.1.38

Request Body schema: application/json
required
reason
string

The reason for cancelling the dual hedge.

Responses

Request samples

Content type
application/json
{
  • "reason": "Customer requested cancellation"
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "transactionId": "75906707-8c31-479c-b354-aa805c4cefbc",
  • "hedgeIds": [
    ]
}

List

Lists all dual hedge transactions for the partner, including both hedge legs. Supports filtering by creation or update date.

Authorizations:
api-key
path Parameters
customerId
required
string

The id of the customer within the Grain platform.

query Parameters
page
number <double> (Page) >= 1

Page number indicating which set of items to return

per_page
number <double> (PerPage) [ 1 .. 100 ]

The number of items in a page

issued_at
string

Creation date filter - only dual hedges created on this date will be returned. Format: YYYY-MM-DD

updated_at
string

Update date filter - only dual hedges updated on this date will be returned. Format: YYYY-MM-DD

Responses

Response samples

Content type
application/json
{
  • "dualHedges": [
    ],
  • "pagination": {
    }
}

Customers

Customer objects represent your end customers on the Grain platform. A customer must be created before a hedge or spot transaction can be initiated.

Create

Creates a new customer. If a customer with the same external ID already exists, the record is updated automatically.

Authorizations:
api-key
Request Body schema: application/json
required

The payload required in order to create a customer

contactEmail
string (ContactEmail)

The email address of the company's primary contact

contactFullName
string

The name of the company's primary contact

contactPhoneNumber
string

The phone number of the company's primary contact

companyName
required
string

The legal name of the customer's company

companyAddress
string

The address of the company

companyCity
string

The city of the company

companyState
string

The state the company is in (US based)

companyCountry
required
string (CountryCode)

The alpha-2 ISO 3166 country code of the entity's country.

companyTaxId
string

The tax identification or registration number of the company

externalCustomerId
required
string

The id used to identify the customer within your platform

extraFields
object (CustomersExtraFieldsParam)

Additional fields that provide further details about the company. These fields should be specified as a valid JSON object.

Responses

Request samples

Content type
application/json
{
  • "contactEmail": "[email protected]",
  • "contactFullName": "Garrick Ollivander",
  • "contactPhoneNumber": "+12125551234",
  • "companyName": "Ollivander's Wand Shop",
  • "companyAddress": "12 Diagon Alley",
  • "companyCity": "London",
  • "companyState": "London",
  • "companyCountry": "GB",
  • "companyTaxId": "123-45-6789",
  • "externalCustomerId": "630231b3ae0d7e9e5097ad35",
  • "extraFields": {
    }
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}

List

Retrieves a list of all existing customers.

Authorizations:
api-key
query Parameters
external_customer_id
string

external_customer_id is the customer id, as identified within your system

page
number <double> (Page) >= 1

page number indicating which set of items to return

per_page
number <double> (PerPage) [ 1 .. 100 ]

The number of items in a page

Responses

Response samples

Content type
application/json
{
  • "customers": [
    ],
  • "pagination": {
    }
}

Get

Retrieves a specific customer by its Grain customer ID.

Authorizations:
api-key
path Parameters
customerId
required
string <uuid> (UUID)

The UUID of the customer

Responses

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "companyName": "Ollivander's Wand Shop",
  • "companyAddress": "12 Diagon Alley",
  • "companyCity": "London",
  • "companyState": "London",
  • "companyCountry": "GB",
  • "contactEmail": "[email protected]",
  • "contactFullName": "Garrick Ollivander",
  • "contactPhoneNumber": "+12125551234",
  • "companyTaxId": "123-45-6789",
  • "externalCustomerId": "630231b3ae0d7e9e5097ad35",
  • "status": "Pending",
  • "extraFields": {
    }
}

Delete

Removes a customer by ID.

Authorizations:
api-key
path Parameters
customerId
required
string <uuid> (UUID)

The UUID of the customer

Responses

Response samples

Content type
application/json
{
  • "message": "Can't perform this action",
  • "reason": "Supplied object is in *Cancelled* state, which prevents performing this action"
}

Update

Updates an existing customer's information.

Authorizations:
api-key
path Parameters
customerId
required
string <uuid> (UUID)

The id of the customer within the Grain platform.

Request Body schema: application/json
required

The payload required in order to update a customer

contactEmail
string (ContactEmail)

The email address of the company's primary contact

contactFullName
string

The name of the company's primary contact

contactPhoneNumber
string

The phone number of the company's primary contact

companyName
string

The legal name of the customer's company

companyAddress
string

The address of the company

companyCity
string

The city of the company

companyState
string

The state the company is in (US based)

companyCountry
string (CountryCode)

The alpha-2 ISO 3166 country code of the entity's country.

companyTaxId
string

The tax identification or registration number of the company

externalCustomerId
string

The id used to identify the customer within your platform

extraFields
object (CustomersExtraFieldsParam)

Additional fields that provide further details about the company. These fields should be specified as a valid JSON object.

Responses

Request samples

Content type
application/json
{
  • "contactEmail": "[email protected]",
  • "contactFullName": "Garrick Ollivander",
  • "contactPhoneNumber": "+12125551234",
  • "companyName": "Ollivander's Wand Shop",
  • "companyAddress": "12 Diagon Alley",
  • "companyCity": "London",
  • "companyState": "London",
  • "companyCountry": "GB",
  • "companyTaxId": "123-45-6789",
  • "externalCustomerId": "630231b3ae0d7e9e5097ad35",
  • "extraFields": {
    }
}

Response samples

Content type
application/json
{
  • "message": "Can't perform this action",
  • "reason": "Supplied object is in *Cancelled* state, which prevents performing this action"
}

Pricing

Pricing endpoints provide access to FX rates for currency pairs that are not being hedged. These endpoints can be used for live rate display or bulk retrieval to support high-volume quoting workflows.

Rate

Retrieves the current FX spot rate for supported currency pairs. Use this endpoint for real-time reference rates or live rate display.

Authorizations:
api-key
query Parameters
currencies
string

(Optional) A query parameter specifying a comma-separated list of 3-letter ISO currency codes.

Responses

Response samples

Content type
application/json
{
  • "rates": {
    }
}

Spots

Spot objects represent currency conversions executed for immediate or near-term settlement.

Quote

Generates a spot rate proposal for a new currency conversion.

Authorizations:
api-key
header Parameters
X-Customer-IP
required
string <IPv4> (CustomerIP)

The IPv4 address of the browser from which the customer contacts your platform.
example: 192.158.1.38

Request Body schema: application/json
required

The payload required in order to ask for a spot quote

fromCurrency
required
string

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

toCurrency
required
string

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

toCurrencyAmount
number <double>

The amount of toCurrency to hedge, using this amount and the hedge rate will determine the fromCurrency amount of the hedge.

externalMarkupPct
number <double>

Optional external markup percentage to be applied to the hedge quote. This markup is applied on top of Grain's internal pricing and will be reflected in the final quote rate. Value must be between 0 and 100 (representing 0% to 100%). For example, 1.0 means a 1.0% markup, 0.5 means 0.5% markup, not basis points. If not provided, defaults to 0 (no external markup).

Responses

Request samples

Content type
application/json
{
  • "fromCurrency": "MXN",
  • "toCurrency": "USD",
  • "toCurrencyAmount": 1560,
  • "externalMarkupPct": 1
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "fromCurrency": "MXN",
  • "toCurrency": "USD",
  • "toCurrencyAmount": 1560,
  • "fromCurrencyAmount": 32161.8,
  • "quote": 20.6165,
  • "validUntilTs": 1659625098
}

Accept

Accepts a previously generated spot rate proposal and executes the conversion.

Authorizations:
api-key
header Parameters
X-Customer-IP
required
string <IPv4> (CustomerIP)

The IPv4 address of the browser from which the customer contacts your platform.
example: 192.158.1.38

Request Body schema: application/json
required

The payload required in order to accept a spot

spotProposalId
required
string

The id of the spot proposal to accept.

toCurrencyAmount
number <double>

the amount to transfer in the toCurrency. If amount was not specified on quote, it should be specified on Accept.

extraFields
object (ExtraFieldsParam)

Additional fields that provide further details about the transaction. These fields should be specified as a valid JSON object.

Responses

Request samples

Content type
application/json
{
  • "spotProposalId": "8173b9a7-ee61-413e-b9e3-7c04b2a067c5",
  • "toCurrencyAmount": 1560,
  • "extraFields": {
    }
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}

Get

Retrieves details of a specific spot transaction.

Authorizations:
api-key
path Parameters
spotId
required
string

The id of the spot within the Grain platform.

Responses

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "organizationId": "7bc05553-4b68-44e8-b7bc-37be63c6d9e9",
  • "fromCurrency": "MXN",
  • "toCurrency": "USD",
  • "toCurrencyAmount": 1560,
  • "fromCurrencyAmount": 32161.8,
  • "quote": 20.6165,
  • "acceptedAtTs": 1659625088,
  • "issuedAt": "2023-04-15",
  • "completedAt": "2023-02-23"
}

List

Retrieves all spot transactions for the given organization.

Authorizations:
api-key
query Parameters
page
number <double> (Page) >= 1

page number indicating which set of items to return

per_page
number <double> (PerPage) [ 1 .. 100 ]

The number of items in a page

Responses

Response samples

Content type
application/json
{
  • "spots": [
    ],
  • "pagination": {
    }
}

Wallets

List

Retrieves all wallets and their balances, per currency.

Authorizations:
api-key

Responses

Response samples

Content type
application/json
{
  • "wallets": [
    ]
}

Get

Retrieves a specific wallet by its Grain wallet ID.

Authorizations:
api-key
path Parameters
walletId
required
string <uuid> (UUID)

The id of the wallet within the Grain platform.

Responses

Response samples

Content type
application/json
{
  • "id": "1b0ada1e-fa1b-4cfe-a553-01b340c5650e",
  • "balance": 10525,
  • "currency": "EUR",
  • "depositDetails": {
    }
}

Withdraw

Withdraws funds from a wallet to a configured beneficiary. Returns the ID of the created withdrawal fund transfer.

Authorizations:
api-key
path Parameters
walletId
required
string <uuid> (UUID)

The id of the wallet within the Grain platform.

Request Body schema: application/json
required

The payload required in order to withdraw fund transfers

amount
required
number <double>

The amount of the funds requested to be withdrawn.

Responses

Request samples

Content type
application/json
{
  • "amount": 10000
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}