Skip to main content
POST
cURL

Authorizations

Authorization
string
header
required

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

Headers

X-Customer-IP
string<IPv4>
required

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

Pattern: ((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}

Body

application/json

Information required by Grain in order to generate a conversion quote proposal.

fromCurrency
string
required

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

Pattern: ^[A-Z]{3}$
Example:

"MXN"

toCurrency
string
required

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

Pattern: ^[A-Z]{3}$
Example:

"USD"

toCurrencyAmount
number<double>

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

Example:

1560

Response

Conversion Proposal Created

id
string<uuid>
required

The id of the conversion proposal 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"

fromCurrency
string
required

The original currency that will be converted into a different currency. This is the currency the user wants to exchange or convert in the transaction.

Example:

"MXN"

toCurrency
string
required

The target currency that the original currency (fromCurrency) will be converted into. This is the desired currency after the conversion process is complete.

Example:

"USD"

quote
number<double>
required

The rate locked by this conversion.

Example:

20.6165

validUntilTs
number<double>
required

The unix timestamp until which the conversion offer is valid.

Example:

1659625098

toCurrencyAmount
number<double>

The amount to transfer in the toCurrency

Example:

1560

fromCurrencyAmount
number<double>

The amount to transfer in the fromCurrency

Example:

32161.8