Skip to main content
Docs

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.

  1. 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".

  2. 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.

  3. 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.

  4. 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:read and test_helpers:write. Copy it now; it is shown once.

  5. Create the parties and the mandate

    Run the calls below. Every write carries an Idempotency-Key.

Create a payer, a payee and a mandate

cURL
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" }
}'
  1. Validate and send

    POST /mandates/:id/validate reports anything that would stop the send. POST /mandates/:id/send freezes 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 with POST /mandates/:id/grants when you need them.

  2. 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 with POST /test_helpers/collections/:id/simulate and { "outcome": "succeeded" }. Submit and approve a stage with POST /test_helpers/stages/:id/submit, then /approve. See Testing.

  3. Listen for events

    Create a webhook endpoint under Developers and verify the signature of every delivery. See Webhooks.

  4. Read the result

    GET /mandates/:id?expand[]=stages&expand[]=collections returns the mandate with its schedule and next_actions, the list of what can happen next and who has to do it.

Next#