Run an agent action
curl --request POST \
--url https://dash.getopenrails.com/api/agent/actions/{action} \
--header 'Content-Type: application/json' \
--data '
{
"product": "<string>",
"amount": 123,
"customer": "jsmith@example.com",
"redirectUrl": "<string>",
"metadata": {},
"environment": "sandbox",
"idempotencyKey": "<string>",
"clientReferenceId": "<string>"
}
'import requests
url = "https://dash.getopenrails.com/api/agent/actions/{action}"
payload = {
"product": "<string>",
"amount": 123,
"customer": "jsmith@example.com",
"redirectUrl": "<string>",
"metadata": {},
"environment": "sandbox",
"idempotencyKey": "<string>",
"clientReferenceId": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
product: '<string>',
amount: 123,
customer: 'jsmith@example.com',
redirectUrl: '<string>',
metadata: {},
environment: 'sandbox',
idempotencyKey: '<string>',
clientReferenceId: '<string>'
})
};
fetch('https://dash.getopenrails.com/api/agent/actions/{action}', 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://dash.getopenrails.com/api/agent/actions/{action}",
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([
'product' => '<string>',
'amount' => 123,
'customer' => 'jsmith@example.com',
'redirectUrl' => '<string>',
'metadata' => [
],
'environment' => 'sandbox',
'idempotencyKey' => '<string>',
'clientReferenceId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://dash.getopenrails.com/api/agent/actions/{action}"
payload := strings.NewReader("{\n \"product\": \"<string>\",\n \"amount\": 123,\n \"customer\": \"jsmith@example.com\",\n \"redirectUrl\": \"<string>\",\n \"metadata\": {},\n \"environment\": \"sandbox\",\n \"idempotencyKey\": \"<string>\",\n \"clientReferenceId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://dash.getopenrails.com/api/agent/actions/{action}")
.header("Content-Type", "application/json")
.body("{\n \"product\": \"<string>\",\n \"amount\": 123,\n \"customer\": \"jsmith@example.com\",\n \"redirectUrl\": \"<string>\",\n \"metadata\": {},\n \"environment\": \"sandbox\",\n \"idempotencyKey\": \"<string>\",\n \"clientReferenceId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dash.getopenrails.com/api/agent/actions/{action}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"product\": \"<string>\",\n \"amount\": 123,\n \"customer\": \"jsmith@example.com\",\n \"redirectUrl\": \"<string>\",\n \"metadata\": {},\n \"environment\": \"sandbox\",\n \"idempotencyKey\": \"<string>\",\n \"clientReferenceId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"result": {
"id": "<string>",
"merchant": "<string>",
"product": "<string>",
"amount": 123,
"customer": "jsmith@example.com",
"route": {
"id": "<string>",
"label": "<string>",
"integrationId": "<string>",
"integrationLabel": "<string>",
"network": "<string>",
"asset": "<string>",
"score": 123,
"payerLabel": "<string>",
"eta": "<string>",
"buyerFeeRate": 123,
"gatewayFeeRate": 123,
"providerCostRate": 123,
"kycPolicy": "<string>"
},
"feeSplit": {
"buyerFee": 123,
"gatewayFee": 123,
"merchantNet": 123,
"total": 123
},
"checkoutUrl": "<string>",
"redirectUrl": "<string>",
"status": "routed",
"environment": "sandbox",
"dryRun": true,
"idempotencyKey": "<string>",
"clientReferenceId": "<string>"
}
}{
"ok": false,
"action": "<string>",
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"suggestion": "<string>",
"issues": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}
}Reference
Run an agent action
Runs a typed action such as checkout creation, fee estimation, or webhook example generation.
POST
/
api
/
agent
/
actions
/
{action}
Run an agent action
curl --request POST \
--url https://dash.getopenrails.com/api/agent/actions/{action} \
--header 'Content-Type: application/json' \
--data '
{
"product": "<string>",
"amount": 123,
"customer": "jsmith@example.com",
"redirectUrl": "<string>",
"metadata": {},
"environment": "sandbox",
"idempotencyKey": "<string>",
"clientReferenceId": "<string>"
}
'import requests
url = "https://dash.getopenrails.com/api/agent/actions/{action}"
payload = {
"product": "<string>",
"amount": 123,
"customer": "jsmith@example.com",
"redirectUrl": "<string>",
"metadata": {},
"environment": "sandbox",
"idempotencyKey": "<string>",
"clientReferenceId": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
product: '<string>',
amount: 123,
customer: 'jsmith@example.com',
redirectUrl: '<string>',
metadata: {},
environment: 'sandbox',
idempotencyKey: '<string>',
clientReferenceId: '<string>'
})
};
fetch('https://dash.getopenrails.com/api/agent/actions/{action}', 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://dash.getopenrails.com/api/agent/actions/{action}",
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([
'product' => '<string>',
'amount' => 123,
'customer' => 'jsmith@example.com',
'redirectUrl' => '<string>',
'metadata' => [
],
'environment' => 'sandbox',
'idempotencyKey' => '<string>',
'clientReferenceId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://dash.getopenrails.com/api/agent/actions/{action}"
payload := strings.NewReader("{\n \"product\": \"<string>\",\n \"amount\": 123,\n \"customer\": \"jsmith@example.com\",\n \"redirectUrl\": \"<string>\",\n \"metadata\": {},\n \"environment\": \"sandbox\",\n \"idempotencyKey\": \"<string>\",\n \"clientReferenceId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://dash.getopenrails.com/api/agent/actions/{action}")
.header("Content-Type", "application/json")
.body("{\n \"product\": \"<string>\",\n \"amount\": 123,\n \"customer\": \"jsmith@example.com\",\n \"redirectUrl\": \"<string>\",\n \"metadata\": {},\n \"environment\": \"sandbox\",\n \"idempotencyKey\": \"<string>\",\n \"clientReferenceId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dash.getopenrails.com/api/agent/actions/{action}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"product\": \"<string>\",\n \"amount\": 123,\n \"customer\": \"jsmith@example.com\",\n \"redirectUrl\": \"<string>\",\n \"metadata\": {},\n \"environment\": \"sandbox\",\n \"idempotencyKey\": \"<string>\",\n \"clientReferenceId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"result": {
"id": "<string>",
"merchant": "<string>",
"product": "<string>",
"amount": 123,
"customer": "jsmith@example.com",
"route": {
"id": "<string>",
"label": "<string>",
"integrationId": "<string>",
"integrationLabel": "<string>",
"network": "<string>",
"asset": "<string>",
"score": 123,
"payerLabel": "<string>",
"eta": "<string>",
"buyerFeeRate": 123,
"gatewayFeeRate": 123,
"providerCostRate": 123,
"kycPolicy": "<string>"
},
"feeSplit": {
"buyerFee": 123,
"gatewayFee": 123,
"merchantNet": 123,
"total": 123
},
"checkoutUrl": "<string>",
"redirectUrl": "<string>",
"status": "routed",
"environment": "sandbox",
"dryRun": true,
"idempotencyKey": "<string>",
"clientReferenceId": "<string>"
}
}{
"ok": false,
"action": "<string>",
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"suggestion": "<string>",
"issues": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}
}Path Parameters
Available options:
checkout.preview, checkout.create, fees.estimate, webhook.example, webhook.verify_sample Body
application/json
- Option 1
- Option 2
- Option 3
- Option 4
Required string length:
1 - 120Required range:
x <= 10000Available options:
card, wallet, local Show child attributes
Show child attributes
Available options:
sandbox, production Required string length:
8 - 120Required string length:
3 - 120⌘I