Place many orders (partial success)
curl --request POST \
--url https://api.scripxhq.com/v1/orders:batch \
--header 'Content-Type: application/json' \
--header 'X-ScripX-Key: <api-key>' \
--data '
{
"orders": [
{
"scheme": "<string>",
"amount_paise": 123,
"min_pct_bps": 123,
"max_pct_bps": 123
}
]
}
'import requests
url = "https://api.scripxhq.com/v1/orders:batch"
payload = { "orders": [
{
"scheme": "<string>",
"amount_paise": 123,
"min_pct_bps": 123,
"max_pct_bps": 123
}
] }
headers = {
"X-ScripX-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-ScripX-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
orders: [{scheme: '<string>', amount_paise: 123, min_pct_bps: 123, max_pct_bps: 123}]
})
};
fetch('https://api.scripxhq.com/v1/orders:batch', 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://api.scripxhq.com/v1/orders:batch",
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([
'orders' => [
[
'scheme' => '<string>',
'amount_paise' => 123,
'min_pct_bps' => 123,
'max_pct_bps' => 123
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-ScripX-Key: <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://api.scripxhq.com/v1/orders:batch"
payload := strings.NewReader("{\n \"orders\": [\n {\n \"scheme\": \"<string>\",\n \"amount_paise\": 123,\n \"min_pct_bps\": 123,\n \"max_pct_bps\": 123\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-ScripX-Key", "<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.post("https://api.scripxhq.com/v1/orders:batch")
.header("X-ScripX-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"orders\": [\n {\n \"scheme\": \"<string>\",\n \"amount_paise\": 123,\n \"min_pct_bps\": 123,\n \"max_pct_bps\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scripxhq.com/v1/orders:batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-ScripX-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"orders\": [\n {\n \"scheme\": \"<string>\",\n \"amount_paise\": 123,\n \"min_pct_bps\": 123,\n \"max_pct_bps\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"submitted": 123,
"rejected": 123,
"results": [
{}
]
}{
"error": "<string>",
"message": "<string>",
"detail": {}
}{
"error": "<string>",
"message": "<string>",
"detail": {}
}{
"error": "<string>",
"message": "<string>",
"detail": {}
}Quotes & orders
Place many orders
Batch order placement on ScripX: submit up to 500 duty credit scrip orders in one call with partial success semantics and per-item results.
POST
/
v1
/
orders:batch
Place many orders (partial success)
curl --request POST \
--url https://api.scripxhq.com/v1/orders:batch \
--header 'Content-Type: application/json' \
--header 'X-ScripX-Key: <api-key>' \
--data '
{
"orders": [
{
"scheme": "<string>",
"amount_paise": 123,
"min_pct_bps": 123,
"max_pct_bps": 123
}
]
}
'import requests
url = "https://api.scripxhq.com/v1/orders:batch"
payload = { "orders": [
{
"scheme": "<string>",
"amount_paise": 123,
"min_pct_bps": 123,
"max_pct_bps": 123
}
] }
headers = {
"X-ScripX-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-ScripX-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
orders: [{scheme: '<string>', amount_paise: 123, min_pct_bps: 123, max_pct_bps: 123}]
})
};
fetch('https://api.scripxhq.com/v1/orders:batch', 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://api.scripxhq.com/v1/orders:batch",
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([
'orders' => [
[
'scheme' => '<string>',
'amount_paise' => 123,
'min_pct_bps' => 123,
'max_pct_bps' => 123
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-ScripX-Key: <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://api.scripxhq.com/v1/orders:batch"
payload := strings.NewReader("{\n \"orders\": [\n {\n \"scheme\": \"<string>\",\n \"amount_paise\": 123,\n \"min_pct_bps\": 123,\n \"max_pct_bps\": 123\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-ScripX-Key", "<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.post("https://api.scripxhq.com/v1/orders:batch")
.header("X-ScripX-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"orders\": [\n {\n \"scheme\": \"<string>\",\n \"amount_paise\": 123,\n \"min_pct_bps\": 123,\n \"max_pct_bps\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scripxhq.com/v1/orders:batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-ScripX-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"orders\": [\n {\n \"scheme\": \"<string>\",\n \"amount_paise\": 123,\n \"min_pct_bps\": 123,\n \"max_pct_bps\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"submitted": 123,
"rejected": 123,
"results": [
{}
]
}{
"error": "<string>",
"message": "<string>",
"detail": {}
}{
"error": "<string>",
"message": "<string>",
"detail": {}
}{
"error": "<string>",
"message": "<string>",
"detail": {}
}Up to 500 orders in one call, with partial success: valid orders submit, invalid ones report back per item, and one bad row never sinks the batch. Requires the
Walk
orders:write scope.
Request example
curl -X POST "https://api.scripxhq.com/v1/orders:batch" \
-H "X-ScripX-Key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{"orders": [
{"side": "sell", "scheme": "RODTEP", "amount_paise": 100000000, "min_pct_bps": 9600},
{"side": "sell", "scheme": "ROSCTL", "amount_paise": 50000000}
]}'
Response example
{
"submitted": 1,
"rejected": 1,
"results": [
{"index": 0, "ok": true, "order_id": "ord_01HZX…"},
{"index": 1, "ok": false, "status": 422, "error": "amount_paise must be a positive integer"}
]
}
results by index; never assume positional success.
Errors
401/403/429, the standard auth errors.422 unprocessable, a malformed envelope (per-item problems come back inresultsinstead).
Next steps
- Positions to see the whole submitted book.
⌘I