Choose Reward Connection
Choose the billing connection of a Reward that waits for a choice of provider. A write applies at once. Needs the rewards:fulfill key permission.
Authorization
WorkspaceApiKey Workspace-owned Better Auth API key of one environment (Sandbox or Live); it authorizes the Projects of that environment in its Workspace. A Project of the other environment returns 403 ENVIRONMENT_MISMATCH. Never expose it in the browser.
In: header
Path Parameters
\S1 <= length <= 512Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/rewards/string/delivery/connection" \ -H "Content-Type: application/json" \ -d '{ "connectionId": "string", "projectId": "string" }'{ "success": true, "data": { "id": "string", "createdAt": "string", "updatedAt": "string", "projectId": "string", "evaluationId": "string", "participantId": "string", "programId": "string", "ruleId": "string", "termsVersionId": "string", "allowanceId": "string", "beneficiaryRole": "referrer", "beneficiaryParticipantId": "string", "benefitKind": "cash", "amountMinor": "string", "currency": "string", "currencyExponent": -9007199254740991, "typedBenefitSnapshot": { "property1": null, "property2": null }, "purchaseId": "string", "void": { "id": "string", "reasonCode": "fraud", "reason": "string", "actor": "string", "voidedAt": "string" }, "netAmountMinor": "string", "fulfillmentStatus": "pending", "fulfillment": { "id": "string", "externalReference": "string", "occurredAt": "string", "actor": "string" }, "revocation": { "id": "string", "externalReference": "string", "occurredAt": "string", "actor": "string" }, "delivery": { "method": "operator", "status": "pending", "reason": "awaiting_operator", "providerReference": "string", "connectionId": "string", "attemptCount": -9007199254740991, "lastError": "string", "nextAttemptAt": "string", "grantDispatchedAt": "string", "revocationDispatchedAt": "string", "deliveredAmountMinor": "string", "planUpgradeTargets": [ { "provider": "dodo", "plan": "string", "periods": -9007199254740991 } ], "targetPlan": "string", "planPeriods": -9007199254740991, "revertDueAt": "string", "revertedAt": "string", "revertOutcome": "reverted" } }}Capture Handle POST
The landing script calls this route from the browser. It exchanges the `refref_handoff` of a referral click for the handle of the browser, and keeps the handle in a first-party cookie. There is no API key: the handoff is the credential, and it is valid for 15 minutes. `handle` is the handle that the browser holds, if any; an unknown handle, or a handle of another Project, counts as absent. A click goes to one handle, once. An open handle that the browser holds takes the click; a handle that is already identified is replaced by a new handle. A retry of the same handoff without a handle returns the handle that took the click. The response is not cached (`Cache-Control: no-store`). A handoff that is not valid, or has expired, gets 400.
Create Benefit Rule POST
Next Page