Quickstart
This walks one mandate through its whole life in test mode: no real money moves and emails to people outside your team are captured, not sent. You need an account (see Request access) and a Stripe test key.
Sign in and stay in test mode
Sign in at the dashboard. Test mode is available as soon as your email is verified, while Holdyn reviews your account. The URL contains
/dashboard/test, and a strip at the top says "Test mode".Connect your Stripe test account
Open Settings, then Stripe. Paste a restricted test key (
rk_test_…) following the checklist on that page. The key is stored encrypted and is never shown again. See Connect your Stripe account.Install a template
Open Templates, then Presets, and install a preset. A template is a blueprint for a mandate: parties, collections, stages and conditions. Review and publish it. See Templates and presets.
Make a test API key
Open Developers, then API keys, and create a test key with the scopes
mandates:write,parties:write,evidence:write,events:readandtest_helpers:write. Copy it now; it is shown once.Create the parties and the mandate
Run the calls below. Every write carries an
Idempotency-Key.
Create a payer, a payee and a mandate
export HOLDYN_API_KEY=htst_your_test_key
# 1. The payer
curl https://holdyn-fb2e34c7cbae.herokuapp.com/api/v1/b2b/parties \
-H "Authorization: Bearer $HOLDYN_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"kind": "payer",
"entity_type": "individual",
"display_name": "Sam Rivera",
"contact": { "name": "Sam Rivera", "email": "sam@example.com" }
}'
# 2. The payee
curl https://holdyn-fb2e34c7cbae.herokuapp.com/api/v1/b2b/parties \
-H "Authorization: Bearer $HOLDYN_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"kind": "payee",
"entity_type": "business",
"display_name": "Ridge Services LLC",
"country": "US",
"contact": { "name": "Dana Ridge", "email": "dana@example.com" }
}'
# 3. The mandate, from your template
curl https://holdyn-fb2e34c7cbae.herokuapp.com/api/v1/b2b/mandates \
-H "Authorization: Bearer $HOLDYN_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"template_key": "milestone_project",
"title": "Kitchen fit-out, phase 2",
"amount": 2000000,
"payer": "pty_PAYER_ID",
"payee": "pty_PAYEE_ID",
"metadata": { "order_id": "ord_1001" }
}'const API = "https://holdyn-fb2e34c7cbae.herokuapp.com/api/v1/b2b";
async function call(path, body) {
const res = await fetch(API + path, {
method: "POST",
headers: {
Authorization: "Bearer " + process.env.HOLDYN_API_KEY,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify(body),
});
const json = await res.json();
if (!res.ok) throw new Error(json.error.code + ": " + json.error.message);
return json;
}
const payer = await call("/parties", {
kind: "payer",
entity_type: "individual",
display_name: "Sam Rivera",
contact: { name: "Sam Rivera", email: "sam@example.com" },
});
const payee = await call("/parties", {
kind: "payee",
entity_type: "business",
display_name: "Ridge Services LLC",
country: "US",
contact: { name: "Dana Ridge", email: "dana@example.com" },
});
const mandate = await call("/mandates", {
template_key: "milestone_project",
title: "Kitchen fit-out, phase 2",
amount: 2000000,
payer: payer.id,
payee: payee.id,
metadata: { order_id: "ord_1001" },
});
console.log(mandate.id, mandate.status); // man_… draftValidate and send
POST /mandates/:id/validatereports anything that would stop the send.POST /mandates/:id/sendfreezes version 1 of the terms and invites both parties. In test mode the emails go to your team and verified test recipients only; mint links yourself withPOST /mandates/:id/grantswhen you need them.Move it forward with the test helpers
Test helpers act as the parties and move the clock. Accept as each party with
POST /test_helpers/mandates/:id/parties/payer/accept, then/payee/accept. Simulate a collection withPOST /test_helpers/collections/:id/simulateand{ "outcome": "succeeded" }. Submit and approve a stage withPOST /test_helpers/stages/:id/submit, then/approve. See Testing.Listen for events
Create a webhook endpoint under Developers and verify the signature of every delivery. See Webhooks.
Read the result
GET /mandates/:id?expand[]=stages&expand[]=collectionsreturns the mandate with its schedule andnext_actions, the list of what can happen next and who has to do it.
Next#
- Concepts explains what you just created.
- Marketplace integration turns this into a production design.
- Going live lists what live mode needs.
