curl -X POST "https://immiscible.fly.dev/api/w/$IMMISCIBLE_WORKSPACE/mandates" \
-H "cookie: __Host-sid=$IMMISCIBLE_SESSION" \
-H "x-immiscible-csrf: 1" \
-H "content-type: application/json" \
-d '{
"agentId": "agt_4f2c91a7",
"kind": "payment",
"title": "Supplier invoices",
"currency": "GBP",
"perTransaction": 200000,
"perPeriod": 1000000,
"period": "month",
"merchants": {
"allow": [
"northwind.example"
],
"block": []
},
"approveAbove": 50000,
"newMerchant": "approve"
}'
const res = await fetch('https://immiscible.fly.dev/api/w/$IMMISCIBLE_WORKSPACE/mandates', {
method: 'POST',
headers: {
cookie: `__Host-sid=${process.env.IMMISCIBLE_SESSION}`,
'x-immiscible-csrf': '1',
'content-type': 'application/json',
},
body: JSON.stringify({
agentId: 'agt_4f2c91a7',
kind: 'payment',
title: 'Supplier invoices',
currency: 'GBP',
perTransaction: 200000,
perPeriod: 1000000,
period: 'month',
merchants: {
allow: ['northwind.example'],
block: [],
},
approveAbove: 50000,
newMerchant: 'approve',
}),
});
const data = await res.json();
console.log(res.status, data);
import os
import requests
res = requests.post(
"https://immiscible.fly.dev/api/w/$IMMISCIBLE_WORKSPACE/mandates",
headers={
"cookie": f"__Host-sid={os.environ['IMMISCIBLE_SESSION']}",
"x-immiscible-csrf": "1",
"content-type": "application/json",
},
json={
"agentId": "agt_4f2c91a7",
"kind": "payment",
"title": "Supplier invoices",
"currency": "GBP",
"perTransaction": 200000,
"perPeriod": 1000000,
"period": "month",
"merchants": {
"allow": ["northwind.example"],
"block": [],
},
"approveAbove": 50000,
"newMerchant": "approve",
},
)
print(res.status_code, res.json())