Skip to main content
cURL
curl --request POST \
  --url https://api.grainfinance.co/v1/customers/{customerId}/hedges/{hedgeId}/cancel \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --header 'X-Customer-IP: <x-customer-ip>' \
  --data '
{
  "reason": "Transaction cancelled by customer"
}
'
{
  "id": "1b0ada1e-fa1b-4cfe-a553-01b340c5650e",
  "transactionId": "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}

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
reason
string

Description of the reason the hedge was canceled.

Example:

"Transaction cancelled by customer"

Response

Hedge Cancelled

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

id
string<uuid>
required

The id of the created object.

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"

transactionId
string<uuid>

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"