Start a deal (payment link)
Starting a deal charges the brand's card, so it can't happen through the API. Returns the link where the brand starts it on yapfactory.com, and whether it can be started now.
View as Markdownhttps://yapfactory.com/api/v1/deals/{dealId}/start| Who can use it | Brands |
| Tier | money: Charges or pays, so it never runs here. You get a link to finish it on yapfactory.com. |
| Scope | deals:write, or write |
| Idempotency-Key | Optional, and recommended |
| Rate limit | Writes: 20 a minute |
| MCP tool | None. This one is REST only. |
Payment stays on yapfactory.com
This call never charges or pays anyone. It returns a handoff: the link to the deal page, where the brand finishes the step themselves. Show them the link, or open it for them.
The payment is held by Yap Factory until the brand approves the draft. Then the creator is paid in full.
Parameters
dealIdThe deal's id.
Example request
curl -X POST "https://yapfactory.com/api/v1/deals/8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f/start" \
-H "Authorization: Bearer $YAP_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"Response
200 with the handoff in data. handoff.url is the page to open, handoff.say is a sentence to show the person, and canStartNow says whether the step can happen yet.
{
"data": {
"dealId": "3b2f6c1e-7a54-4d0b-9f1a-6e5d4c3b2a19",
"status": "accepted",
"canStartNow": true,
"handoff": {
"action": "start_deal",
"url": "https://yapfactory.com/deals/3b2f6c1e-7a54-4d0b-9f1a-6e5d4c3b2a19",
"say": "Start the deal on this page: your card is charged and payment is held until you approve the video."
}
}
}An example: fields that don't apply are null, and new fields can be added at any time, so ignore ones you don't know. Every response carries Request-Id and the RateLimit-* headers.
Errors
| Code | Status | When |
|---|---|---|
invalid_request | 400 | A field failed validation (see meta.issues), or an unknown query parameter. |
unauthorized | 401 | No token, or it's wrong, expired, revoked or from the other environment. |
insufficient_scope | 403 | The token doesn't have deals:write (or write). |
forbidden | 403 | Only for brands, or the account can't do this yet (email not confirmed, paused). |
not_found | 404 | No such deal, or it isn't yours. |
conflict | 409 | Its current state doesn't allow this. message says why, in words you can show. |
idempotency_conflict | 409 | The same Idempotency-Key came with a different body. |
rate_limited | 429 | Over the limit. Wait for Retry-After seconds. |
internal | 500 | Our fault. Retry later, and send us the requestId if it keeps happening. |
Every error has the same shape. See Errors for what to do about each one.