Menu

Referrals

Invitations and what they give.

OperationMethod and path
The caller's gifts, referral rewards and promotional creditGET /referrals
Claim a gift with its link and passwordPOST /referrals/claim
Buy a credit giftPOST /referrals/gifts
One of the caller's giftsGET /referrals/gifts/{id}
Rotate a paid gift's claim linkPOST /referrals/gifts/{id}/regenerate
Take an unclaimed gift backPOST /referrals/gifts/{id}/revoke

The caller's gifts, referral rewards and promotional credit#

GET /referrals · operation getReferrals

promotion (id, live; null when no gift promotion runs), standard_amount (one year of a domain registration, in whole credits), gift_min / gift_max, sent (the gifts the caller gave, newest first: claim_url only while a gift is paid, the reward fields once a reward was paid, never who claimed), received (the gifts the caller claimed, never who gave), earnings (rewarded_count, total, next_reward) and promo_balance (the account's promotional credit, as GET /credits/promotional answers it; null when it cannot be read now). This call is not charged.

Credentialan API key holding the permission below, or a session (x-weird-auth: key)
Permissionreferrals:read
Chargedno

Answer 200 (ReferralStatus): the result

  • promotion, object or null, required
    • id, string
    • live, boolean
  • standard_amount, string or null
  • gift_min, string or null
  • gift_max, string or null
  • sent, array of objects, required
    • claim_url, string or null — the giver's view, only while the gift is paid
    • reward_state, string — the giver's view, only once a reward was paid
    • id, string, required
    • resolved_at, string or null
    • unlocked_at, string or null
    • invoice_id, string or null — the giver's view: the invoice of the purchase
    • amount, string, required — a decimal amount as text
    • state, string, required (one of awaiting-payment, paid, claimed, unlocked, refunded, revoked, cancelled)
    • checkout_url, string or null — the giver's view, while the payment is open
    • reward_amount, string — a decimal amount as text
    • created_at, string, required
    • reward_index, integer
    • rewarded_at, string or null
    • claimed_at, string or null
  • received, array of objects, required
    • claim_url, string or null — the giver's view, only while the gift is paid
    • reward_state, string — the giver's view, only once a reward was paid
    • id, string, required
    • resolved_at, string or null
    • unlocked_at, string or null
    • invoice_id, string or null — the giver's view: the invoice of the purchase
    • amount, string, required — a decimal amount as text
    • state, string, required (one of awaiting-payment, paid, claimed, unlocked, refunded, revoked, cancelled)
    • checkout_url, string or null — the giver's view, while the payment is open
    • reward_amount, string — a decimal amount as text
    • created_at, string, required
    • reward_index, integer
    • rewarded_at, string or null
    • claimed_at, string or null
  • earnings, object, required
    • rewarded_count, integer, required
    • total, string, required — a decimal amount as text
    • next_reward, string or null
  • promo_balance, one of
    • variant 1: object — the account's promotional credit
      • user_id, string
      • credit_type, string, required — promo
      • balance, string, required — the promotional balance
      • available, string, required — what can be spent: the balance less what is lapsing
      • lapsing, string, required — past its expiry and about to leave the balance
      • deficit, string, required — a decimal amount as text
      • grants, array of objects, required — every grant that still holds credit, in the order it is spent (soonest expiry first)
        • seq, integer, required
        • promotion, string or null
        • reference, string or null
        • amount, string, required — a decimal amount as text
        • remaining, string, required — a decimal amount as text
        • expires_at, string or null
        • created_at, string
        • lapsing, boolean, required — past its expiry: about to leave the balance
    • variant 2: null

Refusals ({"error": {"code", "message"}}; see errors):

StatusCodesWhen
401unauthorizedunauthorized
403insufficient-scope, terms-acceptance-requiredinsufficient-scope (an API key without the route's scope: required, granted); terms-acceptance-required (the current terms of service or privacy notice are not accepted yet: required lists them; read them with GET /legal/documents and accept with POST /auth/legal/accept)
429rate-limitedrate-limited

Example

curl -X GET 'https://api.weird.ro/referrals' \
  -H "Authorization: Bearer $WEIRD_API_KEY"

With the CLI (weird referrals):

$ weird referrals

MCP: weird_referrals.

Claim a gift with its link and password#

POST /referrals/claim · operation claimGift

token (from the claim link) and password. The gift becomes claimed for the calling account; its credits are added once the account's profile is complete. A wrong link or a wrong password answers 400 with reason gift-claim-failed; a giver cannot claim their own gift (reason gift-not-claimable). Attempts are limited per account and per link: past the limit, 429 rate-limited. A claim cannot be undone. This call is not charged.

Credentialan API key holding the permission below, or a session (x-weird-auth: key)
Permissionreferrals:write
Chargedno

Request body (ClaimGift):

  • token, string (password), required (a secret: shown once, never logged)
  • password, string (password), required (a secret: shown once, never logged)

Answer 200 (GiftResult): the result

  • gift, object, required
    • claim_url, string or null — the giver's view, only while the gift is paid
    • reward_state, string — the giver's view, only once a reward was paid
    • id, string, required
    • resolved_at, string or null
    • unlocked_at, string or null
    • invoice_id, string or null — the giver's view: the invoice of the purchase
    • amount, string, required — a decimal amount as text
    • state, string, required (one of awaiting-payment, paid, claimed, unlocked, refunded, revoked, cancelled)
    • checkout_url, string or null — the giver's view, while the payment is open
    • reward_amount, string — a decimal amount as text
    • created_at, string, required
    • reward_index, integer
    • rewarded_at, string or null
    • claimed_at, string or null

Refusals ({"error": {"code", "message"}}; see errors):

StatusCodesWhen
400invalid-paramsinvalid-params (reason gift-claim-failed or gift-not-claimable)
401unauthorizedunauthorized
403account-suspended, insufficient-scope, terms-acceptance-requiredinsufficient-scope (an API key without the route's scope: required, granted); account-suspended (the account is restricted while a report about it is reviewed: reading, support tickets and the copy of its data keep working; contact is the address to write to, GET /auth/account/restrictions says more); terms-acceptance-required (the current terms of service or privacy notice are not accepted yet: required lists them; read them with GET /legal/documents and accept with POST /auth/legal/accept)
429rate-limitedrate-limited

Example

curl -X POST 'https://api.weird.ro/referrals/claim' \
  -H "Authorization: Bearer $WEIRD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"token":"<token>","password":"<password>"}'

With the CLI (weird referrals claim):

$ weird referrals claim <link>

MCP: weird_gift_claim.

Buy a credit gift#

POST /referrals/gifts · operation createGift

amount (whole credits within gift_min..gift_max; omitted: the standard amount), claim_password (at least 6 characters: give it, with the claim link, to the recipient yourself) and provider (the payment method the giver chooses, one of the providers GET /credits/topup lists; default the first offered). A gift is a purchase: the giver pays the checkout at the price of one credit in force (VAT on top, invoiced like a top-up; refused 503 credits-not-on-sale while that price is not set) and the credits go to whoever claims the gift. Answers the gift (awaiting-payment), the checkout URL and the quote; the claim link exists once the gift is paid (GET /referrals/gifts/{id}). A gift never expires. Take it back with POST /referrals/gifts/{id}/revoke while it is unclaimed. This call is not charged.

Credentialan API key holding the permission below, or a session (x-weird-auth: key)
Permissionreferrals:write
Strong authenticationa session needs an authenticator enrolled and a recent proof of it (a step-up in the last 15 minutes, or totp_code / backup_code in the body); an API key is not asked — see authentication
Chargedno

Request body (CreateGift):

  • amount, integer — whole credits within gift_min..gift_max; default the standard amount
  • claim_password, string, required (length 6 to any)
  • provider, string (one of stripe, revolut)
  • totp_code, string (password) — a current authenticator code (the second factor) (a secret: shown once, never logged)
  • backup_code, string (password) — an unused backup code, instead of the authenticator code (a secret: shown once, never logged)

Answer 200 (GiftStarted): the result

  • total, string, required — a decimal amount as text
  • credit_price, string, required — the net price of one credit this gift is bought at (recorded on its order)
  • vat, string, required — a decimal amount as text
  • currency, string, required (must be "RON")
  • gift, object, required
    • claim_url, string or null — the giver's view, only while the gift is paid
    • reward_state, string — the giver's view, only once a reward was paid
    • id, string, required
    • resolved_at, string or null
    • unlocked_at, string or null
    • invoice_id, string or null — the giver's view: the invoice of the purchase
    • amount, string, required — a decimal amount as text
    • state, string, required (one of awaiting-payment, paid, claimed, unlocked, refunded, revoked, cancelled)
    • checkout_url, string or null — the giver's view, while the payment is open
    • reward_amount, string — a decimal amount as text
    • created_at, string, required
    • reward_index, integer
    • rewarded_at, string or null
    • claimed_at, string or null
  • net, string, required — the credits at that price, before VAT, rounded to the ban
  • checkout_url, string, required
  • vat_percent, string, required — a decimal amount as text
  • credits, integer, required

Refusals ({"error": {"code", "message"}}; see errors):

StatusCodesWhen
400invalid-paramsinvalid-params (field amount or claim_password; the provider)
401unauthorizedunauthorized
403account-suspended, enrolment-required, insufficient-scope, profile-incomplete, step-up-required, terms-acceptance-requiredinsufficient-scope (an API key without the route's scope: required, granted); profile-incomplete (complete the profile first: GET /auth/profile says what is missing); enrolment-required (a session caller whose account has no authenticator: enrol one first) or step-up-required (a session without a recent step-up: POST /auth/step-up, then retry); account-suspended (the account is restricted while a report about it is reviewed: reading, support tickets and the copy of its data keep working; contact is the address to write to, GET /auth/account/restrictions says more); terms-acceptance-required (the current terms of service or privacy notice are not accepted yet: required lists them; read them with GET /legal/documents and accept with POST /auth/legal/accept)
409conflictconflict (the gift promotion is not active)
422invalid-totpinvalid-totp (a wrong or replayed authenticator code)
429rate-limitedrate-limited (also: too many unpaid or unclaimed gifts: wait for them or take some back)
502provider-unavailableprovider-unavailable (the payment provider did not answer: try again)
503company-identity-incomplete, credits-not-on-sale, payments-disabled, unavailablepayments-disabled (payments are switched off now: try again later), credits-not-on-sale (credits are not on sale now: nothing was ordered), company-identity-incomplete (the company details are not complete: nothing was ordered) or unavailable (gifts cannot be sold now: try again later)

Example

curl -X POST 'https://api.weird.ro/referrals/gifts' \
  -H "Authorization: Bearer $WEIRD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"claim_password":"<claim_password>"}'

With the CLI (weird referrals gift create):

$ weird referrals gift create

MCP: weird_gift_create.

One of the caller's gifts#

GET /referrals/gifts/{id} · operation getGift

For its giver or its claimant, each in their own shape. While the gift awaits its payment the payment is checked first, so a checkout just completed shows at once: the gift is then paid and the giver's answer carries claim_url. This call is not charged.

Credentialan API key holding the permission below, or a session (x-weird-auth: key)
Permissionreferrals:read
Chargedno

Parameters

NameInTypeRequiredDescription
idpathstringyes

Answer 200 (GiftResult): the result

  • gift, object, required
    • claim_url, string or null — the giver's view, only while the gift is paid
    • reward_state, string — the giver's view, only once a reward was paid
    • id, string, required
    • resolved_at, string or null
    • unlocked_at, string or null
    • invoice_id, string or null — the giver's view: the invoice of the purchase
    • amount, string, required — a decimal amount as text
    • state, string, required (one of awaiting-payment, paid, claimed, unlocked, refunded, revoked, cancelled)
    • checkout_url, string or null — the giver's view, while the payment is open
    • reward_amount, string — a decimal amount as text
    • created_at, string, required
    • reward_index, integer
    • rewarded_at, string or null
    • claimed_at, string or null

Refusals ({"error": {"code", "message"}}; see errors):

StatusCodesWhen
401unauthorizedunauthorized
403insufficient-scope, terms-acceptance-requiredinsufficient-scope (an API key without the route's scope: required, granted); terms-acceptance-required (the current terms of service or privacy notice are not accepted yet: required lists them; read them with GET /legal/documents and accept with POST /auth/legal/accept)
404not-foundnot-found (not a gift of the caller)
429rate-limitedrate-limited

Example

curl -X GET 'https://api.weird.ro/referrals/gifts/{id}' \
  -H "Authorization: Bearer $WEIRD_API_KEY"

With the CLI (weird referrals gift show):

$ weird referrals gift show <id>

MCP: weird_gift.

Rotate a paid gift's claim link#

POST /referrals/gifts/{id}/regenerate · operation regenerateGift

A fresh claim link (the old one is dead at once) and, with new_password, a fresh claim password. Paid, unclaimed gifts only: before the payment there is no link to rotate. The old link cannot be revived. This call is not charged.

Credentialan API key holding the permission below, or a session (x-weird-auth: key)
Permissionreferrals:write
Chargedno

Parameters

NameInTypeRequiredDescription
idpathstringyes

Request body (RegenerateGift):

  • new_password, string — omitted: the claim password stays (length 6 to any)

Answer 200 (GiftRegenerated): the result

  • gift, object, required
    • claim_url, string or null — the giver's view, only while the gift is paid
    • reward_state, string — the giver's view, only once a reward was paid
    • id, string, required
    • resolved_at, string or null
    • unlocked_at, string or null
    • invoice_id, string or null — the giver's view: the invoice of the purchase
    • amount, string, required — a decimal amount as text
    • state, string, required (one of awaiting-payment, paid, claimed, unlocked, refunded, revoked, cancelled)
    • checkout_url, string or null — the giver's view, while the payment is open
    • reward_amount, string — a decimal amount as text
    • created_at, string, required
    • reward_index, integer
    • rewarded_at, string or null
    • claimed_at, string or null
  • claim_url, string, required

Refusals ({"error": {"code", "message"}}; see errors):

StatusCodesWhen
400invalid-paramsinvalid-params (field claim_password: too short)
401unauthorizedunauthorized
403account-suspended, insufficient-scope, terms-acceptance-requiredinsufficient-scope (an API key without the route's scope: required, granted); account-suspended (the account is restricted while a report about it is reviewed: reading, support tickets and the copy of its data keep working; contact is the address to write to, GET /auth/account/restrictions says more); terms-acceptance-required (the current terms of service or privacy notice are not accepted yet: required lists them; read them with GET /legal/documents and accept with POST /auth/legal/accept)
409conflictconflict (not paid yet, already claimed or resolved, or not the caller's gift)
429rate-limitedrate-limited

Example

curl -X POST 'https://api.weird.ro/referrals/gifts/{id}/regenerate' \
  -H "Authorization: Bearer $WEIRD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

With the CLI (weird referrals gift regenerate):

$ weird referrals gift regenerate <id>

MCP: weird_gift_regenerate.

Take an unclaimed gift back#

POST /referrals/gifts/{id}/revoke · operation revokeGift

No body. A gift awaiting its payment is cancelled (should its checkout still complete later, the credits go to the giver). A paid gift becomes revoked and its credits go to the giver's own account. A claimed or settled gift is refused. This call is not charged.

Credentialan API key holding the permission below, or a session (x-weird-auth: key)
Permissionreferrals:write
Strong authenticationa session needs an authenticator enrolled and a recent proof of it (a step-up in the last 15 minutes, or totp_code / backup_code in the body); an API key is not asked — see authentication
Chargedno

Parameters

NameInTypeRequiredDescription
idpathstringyes

Answer 200 (GiftResult): the result

  • gift, object, required
    • claim_url, string or null — the giver's view, only while the gift is paid
    • reward_state, string — the giver's view, only once a reward was paid
    • id, string, required
    • resolved_at, string or null
    • unlocked_at, string or null
    • invoice_id, string or null — the giver's view: the invoice of the purchase
    • amount, string, required — a decimal amount as text
    • state, string, required (one of awaiting-payment, paid, claimed, unlocked, refunded, revoked, cancelled)
    • checkout_url, string or null — the giver's view, while the payment is open
    • reward_amount, string — a decimal amount as text
    • created_at, string, required
    • reward_index, integer
    • rewarded_at, string or null
    • claimed_at, string or null

Refusals ({"error": {"code", "message"}}; see errors):

StatusCodesWhen
401unauthorizedunauthorized
403account-suspended, enrolment-required, insufficient-scope, profile-incomplete, step-up-required, terms-acceptance-requiredinsufficient-scope (an API key without the route's scope: required, granted); profile-incomplete (complete the profile first: GET /auth/profile says what is missing); enrolment-required (a session caller whose account has no authenticator: enrol one first) or step-up-required (a session without a recent step-up: POST /auth/step-up, then retry); account-suspended (the account is restricted while a report about it is reviewed: reading, support tickets and the copy of its data keep working; contact is the address to write to, GET /auth/account/restrictions says more); terms-acceptance-required (the current terms of service or privacy notice are not accepted yet: required lists them; read them with GET /legal/documents and accept with POST /auth/legal/accept)
404not-foundnot-found
409conflictconflict (already claimed or resolved)
422invalid-totpinvalid-totp (a wrong or replayed authenticator code)
429rate-limitedrate-limited
502upstream-unavailableupstream-unavailable (the gift is revoked; its credits reach the giver's account shortly)

Example

curl -X POST 'https://api.weird.ro/referrals/gifts/{id}/revoke' \
  -H "Authorization: Bearer $WEIRD_API_KEY"

With the CLI (weird referrals gift revoke):

$ weird referrals gift revoke <id>

MCP: weird_gift_revoke.

This page is generated from the API's public document; it changes when the document does.