Upsert a program by external ref
https://referalli.com /v1/programs/by-external-ref/{ref} Scope programs:writeOne idempotent call for a program you keep under your own id ref: creates it (with externalRef: ref) when no program has that ref, else updates it. The body takes the POST/PATCH /v1/programs fields with the same validation (slug is optional: when absent on create, a free slug is derived from ref; on update it is ignored), plus commissionRule (the body of PUT /v1/programs/{id}/commission-rule, { config, effectiveAt? }: a new rule version is published only when it differs from the latest) and billing: { provider: "generic" }, which makes sure the program has a generic billing connection scoped to it alone (created when missing; its signing secret is returned as secret only then). Everything happens in one transaction, so a failure leaves nothing half-built. The response is { program, billingConnectionId, changed, created, secret? }: changed names what this call changed (program fields and settings, commissionRule, billing; on create, the fields sent), so re-sending the same body returns changed: [] and publishes no new rule version. Keys: an org-wide key reaches any program; a programs:create key may create, and then reaches the programs it created; another program-limited key may only update its own (403 otherwise). A ref that is in use by a program the key cannot reach is 403. Over the plan's program limit, a create is 402.
Auth: an API key with programs:write, or a session with role owner, admin.
Scopes: programs:write, full, admin.
Parameters
refIdempotency-Keyidempotent-replayed: true) and nothing runs twice. The same key on a different request is 422 idempotency_key_reused; while the first is still running, 409 idempotency_in_progress.x-org-idreferalli-modetest runs a session request against the org's test data. With an API key it must match the key's mode (400 mode_mismatch otherwise). The header name from before the rename is still accepted.Request body
application/json
nameslugattributionModelcookieWindowDayssignupToConversionDaystermsMdstatuspublicHandlepublicPageShow child parameters
pitchautoApprovenoindexprobabilisticPolicyselfReferralPolicysplitCommissionsutmTemplateallowPaidSearchchallengeLinkssettlementcreditRateShow child parameters
amountMinorcurrencypayPerCallShow child parameters
enabledamountMinorcurrencyminDurationSecdedupeHoursforwardTocapsShow child parameters
conversionsPerDayconversionsPerMonthcommissionPerMonthMinorcurrencycountriesShow child parameters
allowblockcartWindowDaysstorefrontsShow child parameters
enabledsignupPaymentGraceMinutesriskPolicyShow child parameters
holdBotScoreholdRiskScoreholdHighRiskLevelholdDisposableEmailholdVelocityholdUnverifiedEmailholdSelfReferralminCustomerAgeDaysminCustomerAgeActionhold (default): the commission line is earned but held until you approve it. void: earns nothing.requirePriorPaymentwidgetShow child parameters
autoEnrolldestinationUrlmobileAppShow child parameters
iosShow child parameters
teamIdbundleIdandroidShow child parameters
packageNamesha256CertFingerprintshowItWorksMdbrandShow child parameters
namemerchant on the public page, the join page title, partner emails.logoUrltheme--r-accent, …) laid over the org theme.supportUrllinkDomainPUT /v1/programs/{id}/link-domain).portalDomainemailFromShow child parameters
fromNamefromAddressreplyTologoUrlprimaryColortermsUrlfaqUrlsupportUrltrackingConsentlandingParamsShow child parameters
codeclicknotificationEmailsShow child parameters
enableddisabledtrafficSourcesShow child parameters
allowednotesexclusiveWithpriorityallowedRangeShow child parameters
minBpsmaxBpsattributionScopeproductMatchpayoutTaxFormPolicyrecordCountrymerchantCreditBpsclawbackPaidReversalspayoutssettingsShow child parameters
publicHandlepublicPageShow child parameters
pitchautoApprovenoindexprobabilisticPolicyselfReferralPolicysplitCommissionsutmTemplateallowPaidSearchchallengeLinkssettlementcreditRateShow child parameters
amountMinorcurrencypayPerCallShow child parameters
enabledamountMinorcurrencyminDurationSecdedupeHoursforwardTocapsShow child parameters
conversionsPerDayconversionsPerMonthcommissionPerMonthMinorcurrencycountriesShow child parameters
allowblockcartWindowDaysstorefrontsShow child parameters
enabledsignupPaymentGraceMinutesriskPolicyShow child parameters
holdBotScoreholdRiskScoreholdHighRiskLevelholdDisposableEmailholdVelocityholdUnverifiedEmailholdSelfReferralminCustomerAgeDaysminCustomerAgeActionhold (default): the commission line is earned but held until you approve it. void: earns nothing.requirePriorPaymentwidgetShow child parameters
autoEnrolldestinationUrlmobileAppShow child parameters
iosandroidhowItWorksMdbrandShow child parameters
namemerchant on the public page, the join page title, partner emails.logoUrltheme--r-accent, …) laid over the org theme.supportUrllinkDomainPUT /v1/programs/{id}/link-domain).portalDomainemailFromtermsUrlfaqUrlsupportUrltrackingConsentlandingParamsShow child parameters
codeclicknotificationEmailsShow child parameters
enableddisabledtrafficSourcesShow child parameters
allowednotesexclusiveWithpriorityallowedRangeShow child parameters
minBpsmaxBpsattributionScopeproductMatchpayoutTaxFormPolicyrecordCountrymerchantCreditBpsclawbackPaidReversalspayoutsdestinationUrlcommissionRuleShow child parameters
configShow child parameters
baseappliesTorecurringholdDayscapPerReferralcapPerPaymentdraftroundingconditionsoverrides{
"name": "string",
"slug": "string",
"attributionModel": "last_click",
"cookieWindowDays": 0,
"signupToConversionDays": 0,
"termsMd": "string",
"status": "draft",
"publicHandle": "string",
"publicPage": {
"pitch": "string",
"autoApprove": true,
"noindex": true
},
"probabilisticPolicy": "auto",
"selfReferralPolicy": "review",
"splitCommissions": true,
"utmTemplate": {},
"allowPaidSearch": true,
"challengeLinks": true,
"settlement": "payout",
"creditRate": {
"amountMinor": 0,
"currency": "string"
},
"payPerCall": {
"enabled": true,
"amountMinor": 0,
"currency": "string",
"minDurationSec": 0,
"dedupeHours": 0,
"forwardTo": "string"
},
"caps": {
"conversionsPerDay": 0,
"conversionsPerMonth": 0,
"commissionPerMonthMinor": 0,
"currency": "string"
},
"countries": {
"allow": [
"string"
],
"block": [
"string"
]
},
"cartWindowDays": 0,
"storefronts": {
"enabled": true
},
"signupPaymentGraceMinutes": 0,
"riskPolicy": {
"holdBotScore": 0,
"holdRiskScore": 0,
"holdHighRiskLevel": true,
"holdDisposableEmail": true,
"holdVelocity": 0,
"holdUnverifiedEmail": true,
"holdSelfReferral": true,
"minCustomerAgeDays": 0,
"minCustomerAgeAction": "hold",
"requirePriorPayment": "hold"
},
"widget": {
"autoEnroll": true,
"destinationUrl": "string"
},
"mobileApp": {
"ios": {
"teamId": "string",
"bundleId": "string"
},
"android": {
"packageName": "string",
"sha256CertFingerprints": [
"string"
]
}
},
"howItWorksMd": "string",
"brand": {
"name": "string",
"logoUrl": "string",
"theme": {},
"supportUrl": "string",
"linkDomain": "string",
"portalDomain": "string",
"emailFrom": {
"fromName": "string",
"fromAddress": "string",
"replyTo": "string",
"logoUrl": "string",
"primaryColor": "string"
}
},
"termsUrl": "string",
"faqUrl": "string",
"supportUrl": "string",
"trackingConsent": "auto",
"landingParams": {
"code": "string",
"click": "string"
},
"notificationEmails": {
"enabled": true,
"disabled": [
"*"
]
},
"trafficSources": {
"allowed": [
"content"
],
"notes": "string"
},
"exclusiveWith": [
"string"
],
"priority": 0,
"allowedRange": {
"minBps": 0,
"maxBps": 0
},
"attributionScope": "customer",
"productMatch": "optional",
"payoutTaxFormPolicy": "required",
"recordCountry": true,
"merchantCreditBps": 0,
"clawbackPaidReversals": true,
"payouts": "runs",
"settings": {
"publicHandle": "string",
"publicPage": {
"pitch": "string",
"autoApprove": true,
"noindex": true
},
"probabilisticPolicy": "auto",
"selfReferralPolicy": "review",
"splitCommissions": true,
"utmTemplate": {},
"allowPaidSearch": true,
"challengeLinks": true,
"settlement": "payout",
"creditRate": {
"amountMinor": 0,
"currency": "string"
},
"payPerCall": {
"enabled": true,
"amountMinor": 0,
"currency": "string",
"minDurationSec": 0,
"dedupeHours": 0,
"forwardTo": "string"
},
"caps": {
"conversionsPerDay": 0,
"conversionsPerMonth": 0,
"commissionPerMonthMinor": 0,
"currency": "string"
},
"countries": {
"allow": [
"string"
],
"block": [
"string"
]
},
"cartWindowDays": 0,
"storefronts": {
"enabled": true
},
"signupPaymentGraceMinutes": 0,
"riskPolicy": {
"holdBotScore": 0,
"holdRiskScore": 0,
"holdHighRiskLevel": true,
"holdDisposableEmail": true,
"holdVelocity": 0,
"holdUnverifiedEmail": true,
"holdSelfReferral": true,
"minCustomerAgeDays": 0,
"minCustomerAgeAction": "hold",
"requirePriorPayment": "hold"
},
"widget": {
"autoEnroll": true,
"destinationUrl": "string"
},
"mobileApp": {
"ios": {
"teamId": "string",
"bundleId": "string"
},
"android": {
"packageName": "string",
"sha256CertFingerprints": [
"string"
]
}
},
"howItWorksMd": "string",
"brand": {
"name": "string",
"logoUrl": "string",
"theme": {},
"supportUrl": "string",
"linkDomain": "string",
"portalDomain": "string",
"emailFrom": {
"fromName": "string",
"fromAddress": "string",
"replyTo": "string",
"logoUrl": "string",
"primaryColor": "string"
}
},
"termsUrl": "string",
"faqUrl": "string",
"supportUrl": "string",
"trackingConsent": "auto",
"landingParams": {
"code": "string",
"click": "string"
},
"notificationEmails": {
"enabled": true,
"disabled": [
"*"
]
},
"trafficSources": {
"allowed": [
"content"
],
"notes": "string"
},
"exclusiveWith": [
"string"
],
"priority": 0,
"allowedRange": {
"minBps": 0,
"maxBps": 0
},
"attributionScope": "customer",
"productMatch": "optional",
"payoutTaxFormPolicy": "required",
"recordCountry": true,
"merchantCreditBps": 0,
"clawbackPaidReversals": true,
"payouts": "runs"
},
"destinationUrl": "string",
"commissionRule": {
"config": {
"base": {
"kind": "string",
"bps": 0
},
"appliesTo": "gross",
"recurring": {
"type": "lifetime"
},
"holdDays": 30,
"capPerReferral": {
"amountMinor": 0,
"currency": "string"
},
"capPerPayment": {
"amountMinor": 0,
"currency": "string"
},
"draft": true,
"rounding": "half_even",
"conditions": {
"countries": [
"string"
],
"excludeCountries": [
"string"
],
"metadata": [
{
"key": "string",
"equals": "string",
"in": [
"string"
]
}
]
},
"overrides": [],
"tiers": [
{
"minCustomers": 0,
"bps": 0
}
],
"bounties": [
{
"event": "string",
"amountMinor": 0,
"currency": "string"
}
],
"subAffiliate": {
"levels": 0,
"ratesBps": [
0
]
},
"rateCard": {
"rates": {},
"defaultBps": 0,
"exclude": [
"string"
],
"productCategories": {},
"indirectBps": 0
},
"bonuses": [
{
"thresholdMinor": 0,
"amountMinor": 0,
"currency": "string",
"period": "string"
}
],
"newVsExpansion": {
"newBps": 0,
"expansionBps": 0
}
},
"effectiveAt": "2024-01-01T00:00:00Z"
},
"billing": {
"provider": "string"
}
}Code samples
cURL
curl -X PUT "https://referalli.com/v1/programs/by-external-ref/{ref}" \
-H "Authorization: Bearer $REFERALLI_API_KEY" \
-H "Idempotency-Key: <value>" \
-H "x-org-id: <value>" \
-H "referalli-mode: <value>" \
-H "Content-Type: application/json" \
-d '{"name":"string","slug":"string","attributionModel":"last_click","cookieWindowDays":0,"signupToConversionDays":0,"termsMd":"string","status":"draft","publicHandle":"string","publicPage":{"pitch":"string","autoApprove":true,"noindex":true},"probabilisticPolicy":"auto","selfReferralPolicy":"review","splitCommissions":true,"utmTemplate":{},"allowPaidSearch":true,"challengeLinks":true,"settlement":"payout","creditRate":{"amountMinor":0,"currency":"string"},"payPerCall":{"enabled":true,"amountMinor":0,"currency":"string","minDurationSec":0,"dedupeHours":0,"forwardTo":"string"},"caps":{"conversionsPerDay":0,"conversionsPerMonth":0,"commissionPerMonthMinor":0,"currency":"string"},"countries":{"allow":["string"],"block":["string"]},"cartWindowDays":0,"storefronts":{"enabled":true},"signupPaymentGraceMinutes":0,"riskPolicy":{"holdBotScore":0,"holdRiskScore":0,"holdHighRiskLevel":true,"holdDisposableEmail":true,"holdVelocity":0,"holdUnverifiedEmail":true,"holdSelfReferral":true,"minCustomerAgeDays":0,"minCustomerAgeAction":"hold","requirePriorPayment":"hold"},"widget":{"autoEnroll":true,"destinationUrl":"string"},"mobileApp":{"ios":{"teamId":"string","bundleId":"string"},"android":{"packageName":"string","sha256CertFingerprints":["string"]}},"howItWorksMd":"string","brand":{"name":"string","logoUrl":"string","theme":{},"supportUrl":"string","linkDomain":"string","portalDomain":"string","emailFrom":{"fromName":"string","fromAddress":"string","replyTo":"string","logoUrl":"string","primaryColor":"string"}},"termsUrl":"string","faqUrl":"string","supportUrl":"string","trackingConsent":"auto","landingParams":{"code":"string","click":"string"},"notificationEmails":{"enabled":true,"disabled":["*"]},"trafficSources":{"allowed":["content"],"notes":"string"},"exclusiveWith":["string"],"priority":0,"allowedRange":{"minBps":0,"maxBps":0},"attributionScope":"customer","productMatch":"optional","payoutTaxFormPolicy":"required","recordCountry":true,"merchantCreditBps":0,"clawbackPaidReversals":true,"payouts":"runs","settings":{"publicHandle":"string","publicPage":{"pitch":"string","autoApprove":true,"noindex":true},"probabilisticPolicy":"auto","selfReferralPolicy":"review","splitCommissions":true,"utmTemplate":{},"allowPaidSearch":true,"challengeLinks":true,"settlement":"payout","creditRate":{"amountMinor":0,"currency":"string"},"payPerCall":{"enabled":true,"amountMinor":0,"currency":"string","minDurationSec":0,"dedupeHours":0,"forwardTo":"string"},"caps":{"conversionsPerDay":0,"conversionsPerMonth":0,"commissionPerMonthMinor":0,"currency":"string"},"countries":{"allow":["string"],"block":["string"]},"cartWindowDays":0,"storefronts":{"enabled":true},"signupPaymentGraceMinutes":0,"riskPolicy":{"holdBotScore":0,"holdRiskScore":0,"holdHighRiskLevel":true,"holdDisposableEmail":true,"holdVelocity":0,"holdUnverifiedEmail":true,"holdSelfReferral":true,"minCustomerAgeDays":0,"minCustomerAgeAction":"hold","requirePriorPayment":"hold"},"widget":{"autoEnroll":true,"destinationUrl":"string"},"mobileApp":{"ios":{"teamId":"string","bundleId":"string"},"android":{"packageName":"string","sha256CertFingerprints":["string"]}},"howItWorksMd":"string","brand":{"name":"string","logoUrl":"string","theme":{},"supportUrl":"string","linkDomain":"string","portalDomain":"string","emailFrom":{"fromName":"string","fromAddress":"string","replyTo":"string","logoUrl":"string","primaryColor":"string"}},"termsUrl":"string","faqUrl":"string","supportUrl":"string","trackingConsent":"auto","landingParams":{"code":"string","click":"string"},"notificationEmails":{"enabled":true,"disabled":["*"]},"trafficSources":{"allowed":["content"],"notes":"string"},"exclusiveWith":["string"],"priority":0,"allowedRange":{"minBps":0,"maxBps":0},"attributionScope":"customer","productMatch":"optional","payoutTaxFormPolicy":"required","recordCountry":true,"merchantCreditBps":0,"clawbackPaidReversals":true,"payouts":"runs"},"destinationUrl":"string","commissionRule":{"config":{"base":{"kind":"string","bps":0},"appliesTo":"gross","recurring":{"type":"lifetime"},"holdDays":30,"capPerReferral":{"amountMinor":0,"currency":"string"},"capPerPayment":{"amountMinor":0,"currency":"string"},"draft":true,"rounding":"half_even","conditions":{"countries":["string"],"excludeCountries":["string"],"metadata":[{"key":"string","equals":"string","in":["string"]}]},"overrides":[],"tiers":[{"minCustomers":0,"bps":0}],"bounties":[{"event":"string","amountMinor":0,"currency":"string"}],"subAffiliate":{"levels":0,"ratesBps":[0]},"rateCard":{"rates":{},"defaultBps":0,"exclude":["string"],"productCategories":{},"indirectBps":0},"bonuses":[{"thresholdMinor":0,"amountMinor":0,"currency":"string","period":"string"}],"newVsExpansion":{"newBps":0,"expansionBps":0}},"effectiveAt":"2024-01-01T00:00:00Z"},"billing":{"provider":"string"}}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
{
"program": {
"id": "string",
"name": "string",
"slug": "string",
"attributionModel": "last_click",
"cookieWindowDays": 0,
"signupToConversionDays": 0,
"termsMd": "string",
"status": "draft",
"publicHandle": "string",
"settings": {
"probabilisticPolicy": "string",
"selfReferralPolicy": "review",
"splitCommissions": true,
"utmTemplate": {},
"allowPaidSearch": true,
"challengeLinks": true,
"settlement": "payout",
"cartWindowDays": 0,
"caps": {
"conversionsPerDay": 0,
"conversionsPerMonth": 0,
"commissionPerMonthMinor": 0,
"currency": "string"
},
"countries": {
"allow": [
"string"
],
"block": [
"string"
]
},
"creditRate": {
"amountMinor": 0,
"currency": "string"
},
"payPerCall": {
"enabled": true,
"amountMinor": 0,
"currency": "string",
"minDurationSec": 0,
"dedupeHours": 0,
"forwardTo": "string"
},
"allowedRange": {
"minBps": 0,
"maxBps": 0
},
"trafficSources": {
"allowed": [
"string"
],
"notes": "string"
},
"exclusiveWith": [
"string"
],
"priority": 0,
"attributionScope": "customer",
"productMatch": "optional",
"payoutTaxFormPolicy": "required",
"clawbackPaidReversals": true,
"payouts": "runs",
"merchantCreditBps": 0,
"landingParams": {
"code": "string",
"click": "string"
},
"recordCountry": true,
"storefronts": {
"enabled": true
},
"signupPaymentGraceMinutes": 0,
"riskPolicy": {
"holdBotScore": 0,
"holdDisposableEmail": true,
"holdVelocity": 0,
"holdUnverifiedEmail": true,
"holdSelfReferral": true,
"holdRiskScore": 0,
"holdHighRiskLevel": true,
"minCustomerAgeDays": 0,
"minCustomerAgeAction": "hold",
"requirePriorPayment": "hold"
},
"widget": {
"autoEnroll": true,
"destinationUrl": "string"
},
"refereeReward": {},
"mobileApp": {
"ios": {
"teamId": "string",
"bundleId": "string"
},
"android": {
"packageName": "string",
"sha256CertFingerprints": [
"string"
]
}
},
"notificationEmails": {
"enabled": true,
"disabled": [
"string"
]
},
"howItWorksMd": "string"
},
"publicPage": {
"pitch": "string",
"autoApprove": true,
"noindex": true
},
"brand": {
"name": "string",
"logoUrl": "string",
"theme": {},
"supportUrl": "string",
"linkDomain": "string",
"portalDomain": "string",
"emailFrom": {
"fromName": "string",
"fromAddress": "string",
"replyTo": "string",
"logoUrl": "string",
"primaryColor": "string"
}
},
"termsUrl": "string",
"faqUrl": "string",
"supportUrl": "string",
"trackingConsent": "string",
"externalRef": "string",
"createdAt": "2024-01-01T00:00:00Z",
"destinationUrl": "string"
},
"billingConnectionId": "string",
"changed": [
"string"
],
"created": true,
"secret": "string"
}error.code is one of:Example
{
"error": {
"code": "validation_error",
"message": "the body or query failed validation, an unknown field was sent, the body is not valid json, or a session call has no `x-org-id`",
"details": [
{
"code": "invalid_format",
"path": [
"destinationUrl"
],
"message": "Invalid URL"
}
],
"docs_url": "https://referalli.com/docs/errors-and-limits#validation_error"
}
}{
"error": {
"code": "mode_mismatch",
"message": "the `referalli-mode` header disagrees with the api key's mode",
"docs_url": "https://referalli.com/docs/errors-and-limits#mode_mismatch"
}
}{
"error": {
"code": "bad_request",
"message": "rejected by the http layer before the handler",
"docs_url": "https://referalli.com/docs/errors-and-limits#bad_request"
}
}{
"error": {
"code": "invalid_handoff_token",
"message": "`handofftoken` on `associate` is malformed, expired (24 hours), signed for another org, or its signature does not verify",
"docs_url": "https://referalli.com/docs/errors-and-limits#invalid_handoff_token"
}
}x-request-idreq_…), matching the server logs. On every response.error.code is one of:Example
{
"error": {
"code": "unauthorized",
"message": "no credentials, an unknown, revoked or expired api key or session, or a signature that did not verify",
"docs_url": "https://referalli.com/docs/errors-and-limits#unauthorized"
}
}{
"error": {
"code": "step_up_required",
"message": "a partner with two-factor on must send `x-totp-code`",
"docs_url": "https://referalli.com/docs/errors-and-limits#step_up_required"
}
}{
"error": {
"code": "reauth_required",
"message": "a session that signed in too long ago changed payout details",
"docs_url": "https://referalli.com/docs/errors-and-limits#reauth_required"
}
}x-request-idreq_…), matching the server logs. On every response.error.code is one of:Example
{
"error": {
"code": "payment_required",
"message": "a plan limit or feature",
"docs_url": "https://referalli.com/docs/errors-and-limits#payment_required"
}
}x-request-idreq_…), matching the server logs. On every response.error.code is one of:Example
{
"error": {
"code": "forbidden",
"message": "the wrong role, a key without the needed scope (the message names it",
"docs_url": "https://referalli.com/docs/errors-and-limits#forbidden"
}
}{
"error": {
"code": "sso_required",
"message": "this organization requires single sign-on",
"docs_url": "https://referalli.com/docs/errors-and-limits#sso_required"
}
}{
"error": {
"code": "access_suspended",
"message": "your identity provider suspended your access and you are the last owner",
"docs_url": "https://referalli.com/docs/errors-and-limits#access_suspended"
}
}{
"error": {
"code": "unsupported_media_type",
"message": "the request body's `content-type` isn't one this endpoint reads",
"docs_url": "https://referalli.com/docs/errors-and-limits#unsupported_media_type"
}
}{
"error": {
"code": "program_scoped_key",
"message": "a key limited to some programs (`programids`) called an org-wide endpoint",
"docs_url": "https://referalli.com/docs/errors-and-limits#program_scoped_key"
}
}x-request-idreq_…), matching the server logs. On every response.error.code is one of:Example
{
"error": {
"code": "not_found",
"message": "the resource does not exist in this org (ids from other orgs look the same), a referenced id does not exist, a list cursor is not in the list, or the endpoint does not exist",
"docs_url": "https://referalli.com/docs/errors-and-limits#not_found"
}
}{
"error": {
"code": "not_enrolled",
"message": "the user is not a partner in the program (and the widget's autoenroll is off, or no verified email was given)",
"docs_url": "https://referalli.com/docs/errors-and-limits#not_enrolled"
}
}x-request-idreq_…), matching the server logs. On every response.error.code is one of:Example
{
"error": {
"code": "conflict",
"message": "a unique value is taken, or the action would break a rule (the message says which)",
"docs_url": "https://referalli.com/docs/errors-and-limits#conflict"
}
}{
"error": {
"code": "billing_connection_no_key",
"message": "the stripe billing connection keeps no key to reuse for payouts (only one connected with `stripekey` and `creditrail` does)",
"docs_url": "https://referalli.com/docs/errors-and-limits#billing_connection_no_key"
}
}{
"error": {
"code": "api_key_expired",
"message": "this key has expired, so it can no longer be rotated",
"docs_url": "https://referalli.com/docs/errors-and-limits#api_key_expired"
}
}{
"error": {
"code": "idempotency_in_progress",
"message": "a request with the same `idempotency-key` is still running",
"docs_url": "https://referalli.com/docs/errors-and-limits#idempotency_in_progress"
}
}{
"error": {
"code": "stripe_key_required",
"message": "stripe balance credits need a stripe key",
"docs_url": "https://referalli.com/docs/errors-and-limits#stripe_key_required"
}
}x-request-idreq_…), matching the server logs. On every response.error.code is one of:Example
{
"error": {
"code": "idempotency_key_reused",
"message": "the `idempotency-key` was used for a different request",
"docs_url": "https://referalli.com/docs/errors-and-limits#idempotency_key_reused"
}
}{
"error": {
"code": "validation_error",
"message": "on the signed auth-connection endpoints",
"docs_url": "https://referalli.com/docs/errors-and-limits#validation_error"
}
}{
"error": {
"code": "stripe_key_invalid",
"message": "stripe rejected the stripe balance credit key (revoked, rolled or mistyped)",
"docs_url": "https://referalli.com/docs/errors-and-limits#stripe_key_invalid"
}
}{
"error": {
"code": "stripe_key_wrong_mode",
"message": "a stripe balance credit key of the other mode",
"docs_url": "https://referalli.com/docs/errors-and-limits#stripe_key_wrong_mode"
}
}{
"error": {
"code": "stripe_key_permission",
"message": "the restricted stripe key lacks a permission the call needs (webhook endpoints write",
"docs_url": "https://referalli.com/docs/errors-and-limits#stripe_key_permission"
}
}x-request-idreq_…), matching the server logs. On every response.error.code is one of:Example
{
"error": {
"code": "rate_limited",
"message": "an endpoint limit or the per-key quota was exceeded",
"docs_url": "https://referalli.com/docs/errors-and-limits#rate_limited"
}
}x-request-idreq_…), matching the server logs. On every response.Retry-AfterRateLimit-LimitRateLimit-RemainingRateLimit-Reseterror.code is one of:Example
{
"error": {
"code": "internal_error",
"message": "retry with backoff",
"requestId": "req_8f2c1d4e5a6b7c8d",
"docs_url": "https://referalli.com/docs/errors-and-limits#internal_error"
}
}x-request-idreq_…), matching the server logs. On every response.{
"error": {
"code": "string",
"message": "string",
"details": {},
"requestId": "string",
"docs_url": "string"
}
}