Skip to main content
cURL
curl --request POST \
  --url https://api.grainfinance.co/v1/spots/accept-quote \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --header 'X-Customer-IP: <x-customer-ip>' \
  --data '
{
  "spotProposalId": "8173b9a7-ee61-413e-b9e3-7c04b2a067c5",
  "toCurrencyAmount": 1560,
  "extraFields": {
    "field_a": "value_a",
    "field_b": "value_b"
  }
}
'
{
  "id": "4d78ac65-2c3f-47e2-8bf3-3f76124e9d27"
}

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

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

The payload required in order to accept a spot

The payload required in order to accept a spot

spotProposalId
string
required

The id of the spot proposal to accept.

Example:

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

toCurrencyAmount
number<double>

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

Example:

1560

extraFields
object

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

Example:
{
"field_a": "value_a",
"field_b": "value_b"
}

Response

Spot Accepted

The response of a spot action. Includes the reference to the relevant objects.

id
string<uuid>
required

The id of the created spot

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"