Skip to main content
POST
cURL

Overview

Create an invitation or referral link with an optional credit amount. Invitation links can include a fixed credit amount, while referral links always have a zero amount.

Authentication

This endpoint supports two authentication methods:
  • Session-based authentication (browser session cookie)
  • API key authentication via request headers

API Key Headers

  • x-api-key: YOUR_API_KEY or
  • Authorization: Bearer YOUR_API_KEY

Request

Headers

  • Content-Type: application/json
  • x-api-key: YOUR_API_KEY (required for API key auth)

Body

Response

Success (200 OK)

Errors

Notes

  • When amount is 0 or not provided, the currency in the response is null, allowing the recipient to choose their preferred currency upon redemption.
  • Referral links always have an amount of 0, regardless of what value is passed.
  • The redeemCode uses a URL-safe alphabet that avoids ambiguous characters (no 0, O, 1, l).
  • Ensure your account has sufficient balance before creating invitations with credit amounts.

Examples

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Invitation creation parameters

type
enum<string>

Either "invitation" or "referralLink". Defaults to "invitation".

Available options:
invitation,
referralLink
amount
number

Credit amount to include with the invitation. Must be non-negative. Ignored for referral links (always 0).

Required range: x >= 0
currency
string

Currency for the amount. Required if amount > 0.

recipientName
string

Name of the invitation recipient.

issuerName
string

Name of the person sending the invitation.

issuerNote
string

Personal note to include with the invitation.

Response

Invitation created

insertId
string
required

Database ID of the created invitation.

redeemCode
string
required

Unique code the recipient uses to redeem the invitation.

url
string<uri>
required

Full URL to share with the recipient.

type
enum<string>
required

The invitation type.

Available options:
invitation,
referralLink
amount
number
required

Credit amount attached to this invitation.

currency
string | null
required

Currency of the amount, or null if amount is 0.