Skip to content

Customize your referral code or enable agency rev-share mode

POST/api/v1/referrals/code

Create or customize the business's referral code.

Operation ID: create_or_update_referral_code·View as markdown·OpenAPI slice

Authentication

Bearer token authentication. Pass your DayZero API token in the Authorization header and the target business UUID in x-business-id.

Request body

custom_codestring
program_typestring

One of: founder_two_sided, agency_rev_share

partner_namestring

Responses

201Successful Response

codestringrequired
referral_urlstringrequired
program_typestringrequired
referee_free_monthsintegerrequired
referrer_credit_monthsintegerrequired
rev_share_bpsintegerrequired
click_countintegerrequired
uses_countintegerrequired
total_credits_earned_centsintegerrequired
total_rev_share_earned_centsintegerrequired
conversionsarray · ReferralConversionItemrequiredReferralConversionItem
10 fields
idstringrequired
code_usedstringrequired
referred_emailstring
statusstringrequired
referee_discount_centsintegerrequired
referrer_credit_centsintegerrequired
rev_share_earned_centsintegerrequired
stripe_customer_balance_txn_idstring
attributed_atstring · date-time
rewarded_atstring · date-time

401Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

403Forbidden - Insufficient permissions

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

422Validation Error

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.