Update swap by doing an action.
curl --request PATCH \
--url https://{environment}.garden.finance/v2/orders/{order} \
--header 'Content-Type: application/json' \
--header 'garden-app-id: <api-key>' \
--data '{}'import requests
url = "https://{environment}.garden.finance/v2/orders/{order}"
payload = {}
headers = {
"garden-app-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'garden-app-id': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://{environment}.garden.finance/v2/orders/{order}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{environment}.garden.finance/v2/orders/{order}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"garden-app-id: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{environment}.garden.finance/v2/orders/{order}"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("garden-app-id", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://{environment}.garden.finance/v2/orders/{order}")
.header("garden-app-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{environment}.garden.finance/v2/orders/{order}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["garden-app-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"result": "<string>",
"status": "Ok",
"error": "<string>"
}Orders
Gasless
PATCH
/
orders
/
{order}
Update swap by doing an action.
curl --request PATCH \
--url https://{environment}.garden.finance/v2/orders/{order} \
--header 'Content-Type: application/json' \
--header 'garden-app-id: <api-key>' \
--data '{}'import requests
url = "https://{environment}.garden.finance/v2/orders/{order}"
payload = {}
headers = {
"garden-app-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'garden-app-id': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://{environment}.garden.finance/v2/orders/{order}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{environment}.garden.finance/v2/orders/{order}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"garden-app-id: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{environment}.garden.finance/v2/orders/{order}"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("garden-app-id", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://{environment}.garden.finance/v2/orders/{order}")
.header("garden-app-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{environment}.garden.finance/v2/orders/{order}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["garden-app-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"result": "<string>",
"status": "Ok",
"error": "<string>"
}Execute gasless Hashed Time Lock Contract (HTLC) actions on an existing swap order, such as initiate, redeem, refund, and instant refund.
Initiate
Useaction=initiate to initiate the swap on the source chain. The create order endpoint returns chain-specific signing data — sign it and submit here. The relayer broadcasts the transaction on the user’s behalf, making the process gasless.
- EVM
- Solana
- Starknet
The create order response includes
typed_data with EIP-712 domain and message fields. Sign this using eth_signTypedData_v4.Supported on all EVM chains (Ethereum, Arbitrum, Base, etc.) and Tron.string
required
An ECDSA signature generated by the initiator over an EIP-712 typed data message containing the redeemer address, timelock, amount, and secret hash from the create order endpoint.
Example
{
"signature": "0xEIP712SignatureHex..."
}
The create order response includes
versioned_tx_gasless — a base64-encoded versioned transaction. Deserialize it, sign it with the user’s wallet, then serialize the signed transaction back to base64.string
required
The unique identifier for the order.
string
required
Base64-encoded signed Solana versioned transaction.
Example
{
"order_id": "<order_id>",
"serialized_tx": "base64EncodedSignedTransaction..."
}
The create order response includes
typed_data with Starknet domain and message fields. Sign this typed data and submit the signature felt values as a comma-separated string.string
required
A Starknet signature over the typed data message containing the HTLC initiation parameters. Felt values should be comma-separated.
Example
{
"signature": "0xfelt1,0xfelt2"
}
Want to enable gasless initiations for your users? Reach out to us on Townhall and we’ll help you get set up.
Authorizations
Path Parameters
Query Parameters
The HTLC action to execute on the order.
Available options:
initiate, redeem, refund, instant-refund Body
application/json
- Initiate
- Redeem
- Refund
- Instant Refund
Initiate the swap on the source chain. The request body is chain-specific — refer to the Initiate section above for EVM, Solana, and Starknet request formats.
Was this page helpful?