Create a payment intent
curl --request POST \
--url https://grid.squads.xyz/api/grid/v1/accounts/{address}/payment-intent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": "<string>",
"destination": {
"currency": "<string>",
"details": "<unknown>",
"payment_rail": "<string>"
},
"source": {
"currency": "<string>",
"details": "<unknown>",
"payment_rail": "<string>"
},
"fee_config": {
"payer_address": "<string>",
"self_managed_fees": true
}
}
'import requests
url = "https://grid.squads.xyz/api/grid/v1/accounts/{address}/payment-intent"
payload = {
"amount": "<string>",
"destination": {
"currency": "<string>",
"details": "<unknown>",
"payment_rail": "<string>"
},
"source": {
"currency": "<string>",
"details": "<unknown>",
"payment_rail": "<string>"
},
"fee_config": {
"payer_address": "<string>",
"self_managed_fees": True
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: '<string>',
destination: {currency: '<string>', details: '<unknown>', payment_rail: '<string>'},
source: {currency: '<string>', details: '<unknown>', payment_rail: '<string>'},
fee_config: {payer_address: '<string>', self_managed_fees: true}
})
};
fetch('https://grid.squads.xyz/api/grid/v1/accounts/{address}/payment-intent', 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://grid.squads.xyz/api/grid/v1/accounts/{address}/payment-intent",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => '<string>',
'destination' => [
'currency' => '<string>',
'details' => '<unknown>',
'payment_rail' => '<string>'
],
'source' => [
'currency' => '<string>',
'details' => '<unknown>',
'payment_rail' => '<string>'
],
'fee_config' => [
'payer_address' => '<string>',
'self_managed_fees' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://grid.squads.xyz/api/grid/v1/accounts/{address}/payment-intent"
payload := strings.NewReader("{\n \"amount\": \"<string>\",\n \"destination\": {\n \"currency\": \"<string>\",\n \"details\": \"<unknown>\",\n \"payment_rail\": \"<string>\"\n },\n \"source\": {\n \"currency\": \"<string>\",\n \"details\": \"<unknown>\",\n \"payment_rail\": \"<string>\"\n },\n \"fee_config\": {\n \"payer_address\": \"<string>\",\n \"self_managed_fees\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.post("https://grid.squads.xyz/api/grid/v1/accounts/{address}/payment-intent")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"<string>\",\n \"destination\": {\n \"currency\": \"<string>\",\n \"details\": \"<unknown>\",\n \"payment_rail\": \"<string>\"\n },\n \"source\": {\n \"currency\": \"<string>\",\n \"details\": \"<unknown>\",\n \"payment_rail\": \"<string>\"\n },\n \"fee_config\": {\n \"payer_address\": \"<string>\",\n \"self_managed_fees\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://grid.squads.xyz/api/grid/v1/accounts/{address}/payment-intent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": \"<string>\",\n \"destination\": {\n \"currency\": \"<string>\",\n \"details\": \"<unknown>\",\n \"payment_rail\": \"<string>\"\n },\n \"source\": {\n \"currency\": \"<string>\",\n \"details\": \"<unknown>\",\n \"payment_rail\": \"<string>\"\n },\n \"fee_config\": {\n \"payer_address\": \"<string>\",\n \"self_managed_fees\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"amount": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"currency": "<string>",
"destination": "<unknown>",
"id": "<string>",
"payment_rail": "<string>",
"source": "<unknown>",
"status": "<string>",
"transaction_signers": [
"<string>"
],
"valid_until": "2023-11-07T05:31:56Z",
"fee": {
"amount": "<string>",
"amount_decimal": "<string>",
"sol_equivalent": {
"amount": "<string>",
"amount_decimal": "<string>"
}
},
"kms_payloads": [
{
"address": "<string>",
"payload": "<string>"
}
],
"source_deposit_instructions": "<unknown>",
"threshold": 123,
"transaction": "<string>"
}Payment Intents
Create Payment Intent
Create a payment intent for various transfer types
POST
/
api
/
grid
/
v1
/
accounts
/
{address}
/
payment-intent
Create a payment intent
curl --request POST \
--url https://grid.squads.xyz/api/grid/v1/accounts/{address}/payment-intent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": "<string>",
"destination": {
"currency": "<string>",
"details": "<unknown>",
"payment_rail": "<string>"
},
"source": {
"currency": "<string>",
"details": "<unknown>",
"payment_rail": "<string>"
},
"fee_config": {
"payer_address": "<string>",
"self_managed_fees": true
}
}
'import requests
url = "https://grid.squads.xyz/api/grid/v1/accounts/{address}/payment-intent"
payload = {
"amount": "<string>",
"destination": {
"currency": "<string>",
"details": "<unknown>",
"payment_rail": "<string>"
},
"source": {
"currency": "<string>",
"details": "<unknown>",
"payment_rail": "<string>"
},
"fee_config": {
"payer_address": "<string>",
"self_managed_fees": True
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: '<string>',
destination: {currency: '<string>', details: '<unknown>', payment_rail: '<string>'},
source: {currency: '<string>', details: '<unknown>', payment_rail: '<string>'},
fee_config: {payer_address: '<string>', self_managed_fees: true}
})
};
fetch('https://grid.squads.xyz/api/grid/v1/accounts/{address}/payment-intent', 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://grid.squads.xyz/api/grid/v1/accounts/{address}/payment-intent",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => '<string>',
'destination' => [
'currency' => '<string>',
'details' => '<unknown>',
'payment_rail' => '<string>'
],
'source' => [
'currency' => '<string>',
'details' => '<unknown>',
'payment_rail' => '<string>'
],
'fee_config' => [
'payer_address' => '<string>',
'self_managed_fees' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://grid.squads.xyz/api/grid/v1/accounts/{address}/payment-intent"
payload := strings.NewReader("{\n \"amount\": \"<string>\",\n \"destination\": {\n \"currency\": \"<string>\",\n \"details\": \"<unknown>\",\n \"payment_rail\": \"<string>\"\n },\n \"source\": {\n \"currency\": \"<string>\",\n \"details\": \"<unknown>\",\n \"payment_rail\": \"<string>\"\n },\n \"fee_config\": {\n \"payer_address\": \"<string>\",\n \"self_managed_fees\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.post("https://grid.squads.xyz/api/grid/v1/accounts/{address}/payment-intent")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"<string>\",\n \"destination\": {\n \"currency\": \"<string>\",\n \"details\": \"<unknown>\",\n \"payment_rail\": \"<string>\"\n },\n \"source\": {\n \"currency\": \"<string>\",\n \"details\": \"<unknown>\",\n \"payment_rail\": \"<string>\"\n },\n \"fee_config\": {\n \"payer_address\": \"<string>\",\n \"self_managed_fees\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://grid.squads.xyz/api/grid/v1/accounts/{address}/payment-intent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": \"<string>\",\n \"destination\": {\n \"currency\": \"<string>\",\n \"details\": \"<unknown>\",\n \"payment_rail\": \"<string>\"\n },\n \"source\": {\n \"currency\": \"<string>\",\n \"details\": \"<unknown>\",\n \"payment_rail\": \"<string>\"\n },\n \"fee_config\": {\n \"payer_address\": \"<string>\",\n \"self_managed_fees\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"amount": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"currency": "<string>",
"destination": "<unknown>",
"id": "<string>",
"payment_rail": "<string>",
"source": "<unknown>",
"status": "<string>",
"transaction_signers": [
"<string>"
],
"valid_until": "2023-11-07T05:31:56Z",
"fee": {
"amount": "<string>",
"amount_decimal": "<string>",
"sol_equivalent": {
"amount": "<string>",
"amount_decimal": "<string>"
}
},
"kms_payloads": [
{
"address": "<string>",
"payload": "<string>"
}
],
"source_deposit_instructions": "<unknown>",
"threshold": 123,
"transaction": "<string>"
}Fee Config Breaking Change
The
fee_config field is required for non-enterprise tier customers. Requests without it return a missing_fee_config error.Migration
Addfee_config to your create_payment_intent request body:
{
"source": { "type": "smart_account" },
"destination": { "address": "<DESTINATION>", "network": "solana" },
"amount": "1000000",
"currency": "usdc",
"fee_config": {
"currency": "sol",
"payer_address": "<PUBKEY_THAT_WILL_PAY_THE_FEE>"
}
}
How Fees Work
- You submit a payment intent with
fee_config. - The API builds the transaction and calculates the fee (compute, signatures, and ATA rent if needed).
- A repayment instruction is appended that transfers the fee from
payer_addressto the paymaster. - The response includes a
feeobject with the exact amount charged.
Fee Payer Signing
Thepayer_address must sign the transaction. The API automatically adds it as a required signer.
- SOL fees: The payer needs enough SOL to cover the fee.
- USDC fees: The payer needs enough USDC in their associated token account.
Response
Whenfee_config is provided, the response includes a fee field:
Breakdown of the transaction fee charged.
Show fee properties
Show fee properties
Fee amount in the smallest unit of the fee currency.
Human-readable fee amount.
Fee currency (
sol or usdc).Errors
missing_fee_config — Request has no fee_config (required for non-enterprise tier).Authorizations
Your Grid API key from the Grid Dashboard
Path Parameters
Smart account address
Body
application/json
Response
Payment intent created successfully
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?
⌘I