DevelopersAPI reference

Referrals API

REST endpoints for referrals in SKUFlow: 13 operations with parameters, request and response fields, permissions and curl examples.

Base URL: https://app.skuflow.ai/api. Every call needs Authorization: Bearer skf_… (Authentication); {organizationId} ($ORGANIZATION_ID in the examples) is your business's id.

OperationEndpointRisk
Get the referral programmeGET /organizations/{organizationId}/marketing/referrals/programread
Change the referral programmePATCH /organizations/{organizationId}/marketing/referrals/programwrite
List referralsGET /organizations/{organizationId}/marketing/referralsread
Record a referralPOST /organizations/{organizationId}/marketing/referralswrite
Referrals reportGET /organizations/{organizationId}/marketing/referrals/reportread
Get a referralGET /organizations/{organizationId}/marketing/referrals/{referralId}read
Link a referral to its customerPOST /organizations/{organizationId}/marketing/referrals/{referralId}/linkwrite
Reject a referralPOST /organizations/{organizationId}/marketing/referrals/{referralId}/rejectwrite
Check referral conversions nowPOST /organizations/{organizationId}/marketing/referrals/checkwrite
List referral rewardsGET /organizations/{organizationId}/marketing/referrals/rewardsread
Use a referral rewardPOST /organizations/{organizationId}/marketing/referrals/rewards/{rewardId}/applysensitive
Void a referral rewardPOST /organizations/{organizationId}/marketing/referrals/rewards/{rewardId}/voidsensitive
A customer's referral linkGET /organizations/{organizationId}/customers/{customerId}/referralread

Get the referral programme

GET /organizations/{organizationId}/marketing/referrals/program

On/off, the rewards for the referrer and the new customer, the terms, what counts as a conversion and the cap per referrer. Read-only.

Permissionmarketing.read (Owner, Admin, Staff)
Riskread, OAuth scope skuflow.read. Read: reads only.
MCP toolreferrals_program (toolset marketing)

Example

curl "https://app.skuflow.ai/api/organizations/$ORGANIZATION_ID/marketing/referrals/program" \
  -H "Authorization: Bearer $SKUFLOW_API_KEY"

Response

200: the answer's fields
FieldTypeDescription
enabledboolean
referrerRewardKindenumOne of ACCOUNT_CREDIT, DISCOUNT, GIFT_CARD, NONE.
referrerRewardCentsinteger
referrerRewardNotestring or null
friendRewardKindenumOne of ACCOUNT_CREDIT, DISCOUNT, GIFT_CARD, NONE.
friendRewardCentsinteger
friendRewardNotestring or null
headlinestring or null
termsstring or null
conversionenumOne of FIRST_PAID_INVOICE.
rewardCapinteger or null
rewardCapPeriodDaysinteger
updatedAtstring (date-time) or null

Change the referral programme

PATCH /organizations/{organizationId}/marketing/referrals/program

Changes the fields sent. Turning it on gives every customer a link (/ref/{code}, the {{links.referral}} merge field, the portal) and turns on the "Referral reward thank-you" automation the first time.

Permissionmarketing.manage (Owner, Admin)
Riskwrite, OAuth scope skuflow.write. Write: creates or changes records inside the business; nothing leaves it.
MCP toolreferrals_updateProgram (toolset marketing)
PlanMarketing campaigns: the Grow plan and up.

Request body

FieldTypeRequiredDescription
enabledbooleanNoOn: customers get a link and rewards are issued.
referrerRewardKindenumNoWhat the customer who referred gets: ACCOUNT_CREDIT (a credit line on an invoice), DISCOUNT, GIFT_CARD (sent by hand) or NONE. One of ACCOUNT_CREDIT, DISCOUNT, GIFT_CARD, NONE.
referrerRewardCentsintegerNo0–1000000.
referrerRewardNotestring or nullNoe.g. "$50 Amazon gift card". Up to 200 characters.
friendRewardKindenumNoWhat the new customer gets on their first invoice. One of ACCOUNT_CREDIT, DISCOUNT, GIFT_CARD, NONE.
friendRewardCentsintegerNo0–1000000.
friendRewardNotestring or nullNoUp to 200 characters.
headlinestring or nullNoThe landing page's headline. Up to 120 characters.
termsstring or nullNoUp to 4000 characters.
conversionenumNoWhen a referral counts: the first paid invoice. One of FIRST_PAID_INVOICE.
rewardCapinteger or nullNoAt most this many rewarded referrals per referrer per period; null = no cap. 1–1000.
rewardCapPeriodDaysintegerNo1–3650.

Example

curl -X PATCH "https://app.skuflow.ai/api/organizations/$ORGANIZATION_ID/marketing/referrals/program" \
  -H "Authorization: Bearer $SKUFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"enabled":true,"referrerRewardKind":"ACCOUNT_CREDIT","referrerRewardCents":12500}'

Response

200: the answer's fields
FieldTypeDescription
enabledboolean
referrerRewardKindenumOne of ACCOUNT_CREDIT, DISCOUNT, GIFT_CARD, NONE.
referrerRewardCentsinteger
referrerRewardNotestring or null
friendRewardKindenumOne of ACCOUNT_CREDIT, DISCOUNT, GIFT_CARD, NONE.
friendRewardCentsinteger
friendRewardNotestring or null
headlinestring or null
termsstring or null
conversionenumOne of FIRST_PAID_INVOICE.
rewardCapinteger or null
rewardCapPeriodDaysinteger
updatedAtstring (date-time) or null

List referrals

GET /organizations/{organizationId}/marketing/referrals

Who referred whom, newest first: status (PENDING, CONVERTED, REJECTED with the reason), the request it came in as, and the rewards. Read-only.

Permissionmarketing.read (Owner, Admin, Staff)
Riskread, OAuth scope skuflow.read. Read: reads only.
MCP toolreferrals_list (toolset marketing)

Parameters

NameInTypeRequiredDescription
statusqueryenumNoOne of PENDING, CONVERTED, REJECTED.
referrerCustomerIdquerystringNo
limitqueryintegerNo1–200.
offsetqueryintegerNo

Example

curl "https://app.skuflow.ai/api/organizations/$ORGANIZATION_ID/marketing/referrals" \
  -H "Authorization: Bearer $SKUFLOW_API_KEY"

Response

200: the answer's fields
FieldTypeDescription
totalinteger
itemsarray of object
items[].idstring
items[].statusenumOne of PENDING, CONVERTED, REJECTED.
items[].sourcestring
items[].rejectReasonstring or nullSELF_REFERRAL, EXISTING_CUSTOMER, DUPLICATE or STAFF.
items[].codestring or null
items[].referrerobject
items[].referrer.idstring
items[].referrer.namestring
items[].referredobject or null
items[].referred.idstring
items[].referred.namestring
items[].friendNamestring or null
items[].friendEmailstring or null
items[].friendPhonestring or null
items[].requestobject or null
items[].request.idstring
items[].request.identifierstring
items[].request.statusstring
items[].convertedAtstring (date-time) or null
items[].rewardWithheldbooleanConverted, but the referrer had reached the cap.
items[].createdAtstring (date-time)
items[].rewardsarray of object
items[].rewards[].idstring
items[].rewards[].referralIdstring
items[].rewards[].customerIdstring
items[].rewards[].partyenumOne of REFERRER, FRIEND.
items[].rewards[].kindenumOne of ACCOUNT_CREDIT, DISCOUNT, GIFT_CARD, NONE.
items[].rewards[].amountCentsinteger
items[].rewards[].notestring or null
items[].rewards[].statusenumOne of ISSUED, APPLIED, VOID.
items[].rewards[].invoiceIdstring or null
items[].rewards[].issuedAtstring (date-time)
items[].rewards[].appliedAtstring (date-time) or null
items[].rewards[].voidedAtstring (date-time) or null
items[].rewards[].descriptionstring

Record a referral

POST /organizations/{organizationId}/marketing/referrals

Staff record that one customer referred another ("referred by"). Refused for the same person or one sharing their email, phone or address (400) and for a customer already referred (409). Someone who already paid the business is recorded as REJECTED (existing customer); otherwise the new customer's reward is issued.

Permissionmarketing.manage (Owner, Admin)
Riskwrite, OAuth scope skuflow.write. Write: creates or changes records inside the business; nothing leaves it.
MCP toolreferrals_create (toolset marketing)
PlanMarketing campaigns: the Grow plan and up.

Request body

FieldTypeRequiredDescription
referrerCustomerIdstringYesThe customer who referred.
referredCustomerIdstringYesThe new customer.

Example

curl -X POST "https://app.skuflow.ai/api/organizations/$ORGANIZATION_ID/marketing/referrals" \
  -H "Authorization: Bearer $SKUFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"referrerCustomerId":"referrerCustomer_id","referredCustomerId":"referredCustomer_id"}'

Response

201: the answer's fields
FieldTypeDescription
idstring
statusenumOne of PENDING, CONVERTED, REJECTED.
sourcestring
rejectReasonstring or nullSELF_REFERRAL, EXISTING_CUSTOMER, DUPLICATE or STAFF.
codestring or null
referrerobject
referrer.idstring
referrer.namestring
referredobject or null
referred.idstring
referred.namestring
friendNamestring or null
friendEmailstring or null
friendPhonestring or null
requestobject or null
request.idstring
request.identifierstring
request.statusstring
convertedAtstring (date-time) or null
rewardWithheldbooleanConverted, but the referrer had reached the cap.
createdAtstring (date-time)
rewardsarray of object
rewards[].idstring
rewards[].referralIdstring
rewards[].customerIdstring
rewards[].partyenumOne of REFERRER, FRIEND.
rewards[].kindenumOne of ACCOUNT_CREDIT, DISCOUNT, GIFT_CARD, NONE.
rewards[].amountCentsinteger
rewards[].notestring or null
rewards[].statusenumOne of ISSUED, APPLIED, VOID.
rewards[].invoiceIdstring or null
rewards[].issuedAtstring (date-time)
rewards[].appliedAtstring (date-time) or null
rewards[].voidedAtstring (date-time) or null
rewards[].descriptionstring

Referrals report

GET /organizations/{organizationId}/marketing/referrals/report

Referrals, conversions and the conversion rate, rewards issued / applied / outstanding, and the top referrers, over the last days (default: all time). Read-only.

Permissionmarketing.read (Owner, Admin, Staff)
Riskread, OAuth scope skuflow.read. Read: reads only.
MCP toolreferrals_report (toolset marketing)

Parameters

NameInTypeRequiredDescription
daysqueryintegerNo1–3650.

Example

curl "https://app.skuflow.ai/api/organizations/$ORGANIZATION_ID/marketing/referrals/report" \
  -H "Authorization: Bearer $SKUFLOW_API_KEY"

Response

200: the answer's fields
FieldTypeDescription
totalinteger
pendinginteger
convertedinteger
rejectedinteger
conversionRatenumber
rewardsobject
rewards.issuedCentsinteger
rewards.appliedCentsinteger
rewards.outstandingCentsinteger
rewards.countinteger
topReferrersarray of object
topReferrers[].customerIdstring
topReferrers[].namestring
topReferrers[].referralsinteger
topReferrers[].convertedinteger

Get a referral

GET /organizations/{organizationId}/marketing/referrals/{referralId}

One referral with its rewards. Read-only.

Permissionmarketing.read (Owner, Admin, Staff)
Riskread, OAuth scope skuflow.read. Read: reads only.
MCP toolreferrals_get (toolset marketing)

Parameters

NameInTypeRequiredDescription
referralIdpathstringYesA referral id, from GET /marketing/referrals.

Example

curl "https://app.skuflow.ai/api/organizations/$ORGANIZATION_ID/marketing/referrals/{referralId}" \
  -H "Authorization: Bearer $SKUFLOW_API_KEY"

Response

200: the answer's fields
FieldTypeDescription
idstring
statusenumOne of PENDING, CONVERTED, REJECTED.
sourcestring
rejectReasonstring or nullSELF_REFERRAL, EXISTING_CUSTOMER, DUPLICATE or STAFF.
codestring or null
referrerobject
referrer.idstring
referrer.namestring
referredobject or null
referred.idstring
referred.namestring
friendNamestring or null
friendEmailstring or null
friendPhonestring or null
requestobject or null
request.idstring
request.identifierstring
request.statusstring
convertedAtstring (date-time) or null
rewardWithheldbooleanConverted, but the referrer had reached the cap.
createdAtstring (date-time)
rewardsarray of object
rewards[].idstring
rewards[].referralIdstring
rewards[].customerIdstring
rewards[].partyenumOne of REFERRER, FRIEND.
rewards[].kindenumOne of ACCOUNT_CREDIT, DISCOUNT, GIFT_CARD, NONE.
rewards[].amountCentsinteger
rewards[].notestring or null
rewards[].statusenumOne of ISSUED, APPLIED, VOID.
rewards[].invoiceIdstring or null
rewards[].issuedAtstring (date-time)
rewards[].appliedAtstring (date-time) or null
rewards[].voidedAtstring (date-time) or null
rewards[].descriptionstring
POST /organizations/{organizationId}/marketing/referrals/{referralId}/link

For a pending referral whose request was handled by hand: the customer it became. The fraud guards run again; the new customer's reward is issued.

Permissionmarketing.manage (Owner, Admin)
Riskwrite, OAuth scope skuflow.write. Write: creates or changes records inside the business; nothing leaves it.
MCP toolreferrals_link (toolset marketing)
PlanMarketing campaigns: the Grow plan and up.

Parameters

NameInTypeRequiredDescription
referralIdpathstringYesA referral id, from GET /marketing/referrals.

Request body

FieldTypeRequiredDescription
customerIdstringYes

Example

curl -X POST "https://app.skuflow.ai/api/organizations/$ORGANIZATION_ID/marketing/referrals/{referralId}/link" \
  -H "Authorization: Bearer $SKUFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"customerId":"customer_id"}'

Response

200: the answer's fields
FieldTypeDescription
idstring
statusenumOne of PENDING, CONVERTED, REJECTED.
sourcestring
rejectReasonstring or nullSELF_REFERRAL, EXISTING_CUSTOMER, DUPLICATE or STAFF.
codestring or null
referrerobject
referrer.idstring
referrer.namestring
referredobject or null
referred.idstring
referred.namestring
friendNamestring or null
friendEmailstring or null
friendPhonestring or null
requestobject or null
request.idstring
request.identifierstring
request.statusstring
convertedAtstring (date-time) or null
rewardWithheldbooleanConverted, but the referrer had reached the cap.
createdAtstring (date-time)
rewardsarray of object
rewards[].idstring
rewards[].referralIdstring
rewards[].customerIdstring
rewards[].partyenumOne of REFERRER, FRIEND.
rewards[].kindenumOne of ACCOUNT_CREDIT, DISCOUNT, GIFT_CARD, NONE.
rewards[].amountCentsinteger
rewards[].notestring or null
rewards[].statusenumOne of ISSUED, APPLIED, VOID.
rewards[].invoiceIdstring or null
rewards[].issuedAtstring (date-time)
rewards[].appliedAtstring (date-time) or null
rewards[].voidedAtstring (date-time) or null
rewards[].descriptionstring

Reject a referral

POST /organizations/{organizationId}/marketing/referrals/{referralId}/reject

A pending referral earns nothing; the new customer's unused reward is voided.

Permissionmarketing.manage (Owner, Admin)
Riskwrite, OAuth scope skuflow.write. Write: creates or changes records inside the business; nothing leaves it.
MCP toolreferrals_reject (toolset marketing)

Parameters

NameInTypeRequiredDescription
referralIdpathstringYesA referral id, from GET /marketing/referrals.

Example

curl -X POST "https://app.skuflow.ai/api/organizations/$ORGANIZATION_ID/marketing/referrals/{referralId}/reject" \
  -H "Authorization: Bearer $SKUFLOW_API_KEY"

Response

200: the answer's fields
FieldTypeDescription
idstring
statusenumOne of PENDING, CONVERTED, REJECTED.
sourcestring
rejectReasonstring or nullSELF_REFERRAL, EXISTING_CUSTOMER, DUPLICATE or STAFF.
codestring or null
referrerobject
referrer.idstring
referrer.namestring
referredobject or null
referred.idstring
referred.namestring
friendNamestring or null
friendEmailstring or null
friendPhonestring or null
requestobject or null
request.idstring
request.identifierstring
request.statusstring
convertedAtstring (date-time) or null
rewardWithheldbooleanConverted, but the referrer had reached the cap.
createdAtstring (date-time)
rewardsarray of object
rewards[].idstring
rewards[].referralIdstring
rewards[].customerIdstring
rewards[].partyenumOne of REFERRER, FRIEND.
rewards[].kindenumOne of ACCOUNT_CREDIT, DISCOUNT, GIFT_CARD, NONE.
rewards[].amountCentsinteger
rewards[].notestring or null
rewards[].statusenumOne of ISSUED, APPLIED, VOID.
rewards[].invoiceIdstring or null
rewards[].issuedAtstring (date-time)
rewards[].appliedAtstring (date-time) or null
rewards[].voidedAtstring (date-time) or null
rewards[].descriptionstring

Check referral conversions now

POST /organizations/{organizationId}/marketing/referrals/check

Runs what the engine does every few seconds: links referrals to the customers their requests became and converts the ones whose customer paid their first invoice, issuing rewards once.

Permissionmarketing.manage (Owner, Admin)
Riskwrite, OAuth scope skuflow.write. Write: creates or changes records inside the business; nothing leaves it.
MCP toolreferrals_check (toolset marketing)
PlanMarketing campaigns: the Grow plan and up.

Request body

FieldTypeRequiredDescription
nowstring (date-time)NoTests only: act as of this moment (ISO 8601). Refused when NODE_ENV=production.

Example

curl -X POST "https://app.skuflow.ai/api/organizations/$ORGANIZATION_ID/marketing/referrals/check" \
  -H "Authorization: Bearer $SKUFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"now":"2026-11-03T15:00:00Z"}'

Response

200: the answer's fields
FieldTypeDescription
linkedinteger
convertedinteger
rejectedinteger

List referral rewards

GET /organizations/{organizationId}/marketing/referrals/rewards

Rewards earned (ISSUED), used (APPLIED: a credit line on an invoice, or the gift card sent) and voided, newest first. Read-only.

Permissionmarketing.read (Owner, Admin, Staff)
Riskread, OAuth scope skuflow.read. Read: reads only.
MCP toolreferrals_rewards (toolset marketing)

Parameters

NameInTypeRequiredDescription
statusqueryenumNoOne of ISSUED, APPLIED, VOID.
customerIdquerystringNo

Example

curl "https://app.skuflow.ai/api/organizations/$ORGANIZATION_ID/marketing/referrals/rewards" \
  -H "Authorization: Bearer $SKUFLOW_API_KEY"

Response

200: the answer's fields

An array of objects:

FieldTypeDescription
idstring
referralIdstring
customerIdstring
partyenumOne of REFERRER, FRIEND.
kindenumOne of ACCOUNT_CREDIT, DISCOUNT, GIFT_CARD, NONE.
amountCentsinteger
notestring or null
statusenumOne of ISSUED, APPLIED, VOID.
invoiceIdstring or null
issuedAtstring (date-time)
appliedAtstring (date-time) or null
voidedAtstring (date-time) or null
descriptionstring
customerNamestring

Use a referral reward

POST /organizations/{organizationId}/marketing/referrals/rewards/{rewardId}/apply

Money: a credit or discount goes on one of the rewarded customer's DRAFT invoices without payments as a credit line (never more than the invoice), lowering what they owe; a gift card is marked as sent. Applying it again to the same invoice changes nothing; to another, 409.

Permissionmarketing.manage (Owner, Admin)
Risksensitive, OAuth scope skuflow.sensitive. Sensitive: moves money, deletes, sends or shows something to a customer, or grants or revokes access.
MCP toolreferrals_applyReward (toolset marketing)
ApprovalOver MCP, this tool asks for your OK first (in the AI app when it supports it, otherwise in SKUFlow). See Approvals.

Parameters

NameInTypeRequiredDescription
rewardIdpathstringYesA referral reward id, from GET /marketing/referrals/rewards.

Request body

FieldTypeRequiredDescription
invoiceIdstring or nullNo

Example

curl -X POST "https://app.skuflow.ai/api/organizations/$ORGANIZATION_ID/marketing/referrals/rewards/{rewardId}/apply" \
  -H "Authorization: Bearer $SKUFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"invoiceId":"invoice_id"}'

Response

200: the answer's fields
FieldTypeDescription
idstring
referralIdstring
customerIdstring
partyenumOne of REFERRER, FRIEND.
kindenumOne of ACCOUNT_CREDIT, DISCOUNT, GIFT_CARD, NONE.
amountCentsinteger
notestring or null
statusenumOne of ISSUED, APPLIED, VOID.
invoiceIdstring or null
issuedAtstring (date-time)
appliedAtstring (date-time) or null
voidedAtstring (date-time) or null
descriptionstring

Void a referral reward

POST /organizations/{organizationId}/marketing/referrals/rewards/{rewardId}/void

An unused reward is cancelled; it can no longer be applied.

Permissionmarketing.manage (Owner, Admin)
Risksensitive, OAuth scope skuflow.sensitive. Sensitive: moves money, deletes, sends or shows something to a customer, or grants or revokes access.
MCP toolreferrals_voidReward (toolset marketing)
ApprovalOver MCP, this tool asks for your OK first (in the AI app when it supports it, otherwise in SKUFlow). See Approvals.

Parameters

NameInTypeRequiredDescription
rewardIdpathstringYesA referral reward id, from GET /marketing/referrals/rewards.

Example

curl -X POST "https://app.skuflow.ai/api/organizations/$ORGANIZATION_ID/marketing/referrals/rewards/{rewardId}/void" \
  -H "Authorization: Bearer $SKUFLOW_API_KEY"

Response

200: the answer's fields
FieldTypeDescription
idstring
referralIdstring
customerIdstring
partyenumOne of REFERRER, FRIEND.
kindenumOne of ACCOUNT_CREDIT, DISCOUNT, GIFT_CARD, NONE.
amountCentsinteger
notestring or null
statusenumOne of ISSUED, APPLIED, VOID.
invoiceIdstring or null
issuedAtstring (date-time)
appliedAtstring (date-time) or null
voidedAtstring (date-time) or null
descriptionstring

A customer's referral link

GET /organizations/{organizationId}/customers/{customerId}/referral

The customer's referral code and link (/ref/{code}, made the first time it is asked for), visits, the rewards on offer, the people they referred and their rewards.

Permissionmarketing.read (Owner, Admin, Staff)
Riskread, OAuth scope skuflow.read. Read: reads only.
MCP toolreferrals_customer (toolset marketing)

Parameters

NameInTypeRequiredDescription
customerIdpathstringYes

Example

curl "https://app.skuflow.ai/api/organizations/$ORGANIZATION_ID/customers/{customerId}/referral" \
  -H "Authorization: Bearer $SKUFLOW_API_KEY"

Response

200: the answer's fields
FieldTypeDescription
enabledboolean
codestring
linkstring
visitsinteger
referrerRewardstring
friendRewardstring
referralsarray of object
referrals[].idstring
referrals[].statusstring
referrals[].namestring or null
referrals[].createdAtstring (date-time)
referrals[].convertedAtstring (date-time) or null
rewardsarray of object
rewards[].idstring
rewards[].referralIdstring
rewards[].customerIdstring
rewards[].partyenumOne of REFERRER, FRIEND.
rewards[].kindenumOne of ACCOUNT_CREDIT, DISCOUNT, GIFT_CARD, NONE.
rewards[].amountCentsinteger
rewards[].notestring or null
rewards[].statusenumOne of ISSUED, APPLIED, VOID.
rewards[].invoiceIdstring or null
rewards[].issuedAtstring (date-time)
rewards[].appliedAtstring (date-time) or null
rewards[].voidedAtstring (date-time) or null
rewards[].descriptionstring

On this page