DaffodilAPI

Sandbox

Build and test against a full copy of the API where no real money moves, Grants review themselves, and test EINs and helpers produce every outcome on demand.

The Sandbox runs the same release as production with its own data. Grants, Contributions, and Ledger entries behave as they do in production, and the same Events are sent to your webhooks, but no real money moves and nothing reaches a real nonprofit. Build your whole integration here, then switch the host and key to go live.

Hosts and keys

ProductionSandbox
APIhttps://api.getdaffodil.com/v1https://sandbox.api.getdaffodil.com/v1
Mission Controlhttps://mission.mydaffodil.apphttps://sandbox-mission.mydaffodil.app
Secret keydfl_live_…dfl_test_…

An Admin creates test keys in Mission Control in the Sandbox, under Settings → API Keys, as for live keys. A dfl_test_ key works only in the Sandbox and a dfl_live_ key only in production. Sending one to the other host returns 401 api_key_environment_mismatch.

Sandbox data is separate from production and is never copied to it. The nonprofit registry is a recent copy of production's, so search and EIN lookups return real nonprofits.

Try calls in these docs

Every endpoint in the API reference has a Try it panel that calls the Sandbox. Paste a dfl_test_… key into the Authorization field and send the request.

  • Calls go to https://sandbox.api.getdaffodil.com, never to production. A dfl_live_… key is refused before it leaves the docs.
  • The docs relay each call through our server, because browsers cannot call the API directly. The relay does not store your key or the response.
  • You need a Sandbox Account to get a key: create one in Mission Control in the Sandbox under Settings → API Keys.

Grants review themselves

In production, people at your Account and at the sponsor review each Grant, and a check or ACH payment takes days. In the Sandbox, every new Grant moves on by itself, so you can watch the whole lifecycle in a few minutes:

  1. in_review, awaiting your Account. You receive grant.created and grant.awaiting_account.
  2. Your Account's review approves it, then the sponsor's too when your sponsor decides Grants. You receive grant.approved.
  3. The payment goes out: sent, and you receive grant.sent.
  4. The nonprofit cashes it: paid, and you receive grant.paid.

Each step waits a random 2 to 15 seconds, so your integration sees the gaps that real reviews and payments leave. Nobody needs to act in Mission Control. If someone does act on a Grant there, for example denying it, the Sandbox carries on from wherever they left it.

Reviewing Grants yourself

To try your Account's own review, ask Daffodil to turn off Simulate the Account's Grant review (simulate_account_review) for your Sandbox Account. It is on by default. While it is off, a new Grant waits in in_review until your staff approve or deny it in Mission Control. After they approve, the Sandbox carries on with the sponsor's review, the payment, and paid, as above.

Test EINs

Recommend a Grant to one of these EINs to get an outcome other than paid. They exist only in the Sandbox, and no real nonprofit can have them: the IRS never issues EINs with the prefix 00.

EINNameOutcome
00-1000001Sandbox Test Nonprofit (Denied)The review denies it: denied, with grant.denied. Its Hold is released.
00-1000002Sandbox Test Nonprofit (Payout Returned)Approved and sent, then the payment comes back: returned, with grant.returned. The money is in the Fund again.
00-1000003Sandbox Test Nonprofit (Review Stays Open)Stays in_review until someone decides it in Mission Control. Use it to test a Grant that waits, or to cancel one.

Send the EIN with or without the dash:

curl https://sandbox.api.getdaffodil.com/v1/grants \
  -H "Authorization: Bearer $DAFFODIL_API_KEY" \
  -H "Idempotency-Key: 5f1c7b2e-0c3a-4f61-9d0e-7b8a2c4d6e10" \
  -H "Content-Type: application/json" \
  -d '{
    "fund_id": "fund_2JqSDJkaCfO4pnMMD5na5G",
    "donor_id": "donor_6YdL0cXzWbE6x7vH1k8Q2p",
    "ein": "001000002",
    "amount": 25000
  }'

Any other EIN behaves as an ordinary nonprofit and its Grant ends paid.

Helpers

These routes exist only on sandbox.api.getdaffodil.com. In production they answer 404 not_found, as an unknown path does. Like every write, they need a full-access key and an Idempotency-Key. They are listed under Sandbox in the API reference.

RouteWhat it does
POST /v1/sandbox/contributions/{id}/settleClears a pending Contribution, as if the payment settled.
POST /v1/sandbox/contributions/{id}/failFails a pending Contribution, as if the payment bounced.
POST /v1/sandbox/funds/{id}/ledger_entriesPosts interest or a fee to a Fund.
POST /v1/sandbox/resetEmpties your Sandbox Account.
POST /v1/sandbox/fundsOpens a Shared fund for your Campaigns.
POST /v1/sandbox/webhook_destinationsAdds a webhook Destination and returns its signing secret.
DELETE /v1/sandbox/webhook_destinations/{id}Deletes a webhook Destination.

Settle or fail a Contribution

A Contribution paid through Checkout stays pending until its money reaches the Fund. In the Sandbox, a pending card or ACH Contribution settles by itself a random 2 to 15 seconds after it is created, and you receive contribution.succeeded. To choose the outcome yourself, settle it or fail it before then; your request replaces the automatic one:

curl -X POST https://sandbox.api.getdaffodil.com/v1/sandbox/contributions/contrib_3HZxkTq1Rw8n0fYb2Lm9Pd/settle \
  -H "Authorization: Bearer $DAFFODIL_API_KEY" \
  -H "Idempotency-Key: 9a7e1d2c-4b3f-4e8a-b6c5-1d0f2e3a4b5c"

The response is 202 with the Contribution, still pending. After 2 to 15 seconds:

  • settle: it is succeeded, its Fund gets a contribution Ledger entry, and you receive contribution.succeeded and ledger_entry.posted.
  • fail: it is failed, the Fund is never credited, and you receive contribution.failed.

A Contribution that is not pending is refused with 409 contribution_not_pending.

Post interest or a fee

curl https://sandbox.api.getdaffodil.com/v1/sandbox/funds/fund_2JqSDJkaCfO4pnMMD5na5G/ledger_entries \
  -H "Authorization: Bearer $DAFFODIL_API_KEY" \
  -H "Idempotency-Key: 2c4e6a8b-1d3f-4a5c-9e7b-0f2d4b6a8c1e" \
  -H "Content-Type: application/json" \
  -d '{ "type": "interest", "amount": 1234 }'

The entry posts at once. The response is 201 with the Ledger entry, and you receive ledger_entry.posted. Send amount as a positive number for both types: an interest entry credits the Fund and a fee debits it. A fee larger than the Fund's balance is refused with 409 insufficient_funds.

Reset your Account

POST /v1/sandbox/reset deletes every Donor, Fund, Contribution, Grant, Campaign, Checkout Session, and Ledger entry on your Sandbox Account, and answers with how many of each it removed. Your API keys, webhooks, and the Events already sent are kept, so you can run your integration again from nothing without setting it up again. No Events are sent for what it deletes.

Open a Shared fund

The API opens Personal funds with each Donor, and a reset deletes every Fund, including the Shared funds your staff opened in Mission Control. POST /v1/sandbox/funds with a name opens a Shared fund again, so a test can create a Campaign on it.

Add a webhook Destination from a test

An automated test can point Events at a receiver it starts itself. POST /v1/sandbox/webhook_destinations with an https url on the public internet adds a Destination subscribed to every Event, or to the events you list. The response is the only time you see its secret; verify each delivery with it. A reset keeps Destinations, so delete yours with DELETE /v1/sandbox/webhook_destinations/{id} when the test ends.

Timing

WhatIn the Sandbox
Each review step of a Grant2–15 seconds
A Grant's payment going out, and being cashed or returned2–15 seconds each
Settling or failing a Contribution, after you call the helper2–15 seconds
Interest and fees, after you call the helperAt once

Do not depend on the exact delays. Drive your integration from webhooks, or poll the object, as you would in production.