> For the complete documentation index, see [llms.txt](https://glu.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://glu.gitbook.io/docs/api-reference/organisation-api/referral-programs.md).

# Referral Programs

A referral program defines the rules and rewards for customers referring others to purchase a product. Each referral program is associated with a specific product and can have its own unique terms, incentives, and sharing content.

## List referral programs

> List referral programs

```json
{"openapi":"3.1.0","info":{"title":"Glu","version":"1.0.0"},"tags":[{"name":"Referral programs","description":"A referral program defines the rules and rewards for customers referring others to purchase a product. Each referral program is associated with a specific product and can have its own unique terms, incentives, and sharing content."}],"servers":[{"url":"https://api.glu.io","description":"Production API"}],"security":[{"x_api_key":[]}],"components":{"securitySchemes":{"x_api_key":{"type":"apiKey","description":"Value for the x-api-key header parameter.","name":"x-api-key","in":"header"}},"schemas":{"Referral.programs.ReferralProgramOutput-referral.read":{"type":"object","description":"A referral program defines the rules and rewards for customers referring others to purchase a product. Each referral program is associated with a specific product and can have its own unique terms, incentives, and sharing content.","properties":{"id":{"type":["integer","null"]},"product":{"anyOf":[{"$ref":"#/components/schemas/ReferralProgramProductOutput-referral.read"},{"type":"null"}]},"terms":{"type":["string","null"]},"incentiveDiscountAmount":{"type":["integer","null"]},"incentiveDiscountType":{"type":["string","null"],"enum":["FixedAmount","Percentage",null]},"shareTitle":{"type":["string","null"]},"shareText":{"type":["string","null"]},"shareUrl":{"type":["string","null"]},"tags":{"type":"array","items":{"$ref":"#/components/schemas/Tag-referral.read"}},"inviteEmailSubject":{"type":["string","null"]},"inviteEmailContent":{"type":["string","null"]},"inviteEmailDelay":{"type":["integer","null"]},"newContactsOnly":{"type":["boolean","null"]},"sendInviteEmail":{"type":["boolean","null"]}}},"ReferralProgramProductOutput-referral.read":{"type":"object","properties":{"id":{"type":["integer","null"]},"name":{"type":["string","null"]},"status":{"type":["string","null"],"enum":["Draft","Active","Scheduled","Expired","Deleted",null]}}},"Tag-referral.read":{"type":"object"},"Error.jsonld":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["integer","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"},"description":{"readOnly":true,"type":["string","null"]}}},"Error":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["integer","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"}}}}},"paths":{"/referral_programs":{"get":{"operationId":"api_referral_programs_get_collection","tags":["Referral programs"],"responses":{"200":{"description":"Referral programs collection","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Referral.programs.ReferralProgramOutput-referral.read"}}}}},"403":{"description":"Forbidden","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/Error.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"links":{}}},"summary":"List referral programs","description":"List referral programs","parameters":[{"name":"page","in":"query","description":"The collection page number","required":false,"deprecated":false,"schema":{"type":"integer","default":1},"style":"form","explode":true}]}}}}
```

## Retrieve a referral program

> Retrieve a referral program

```json
{"openapi":"3.1.0","info":{"title":"Glu","version":"1.0.0"},"tags":[{"name":"Referral programs","description":"A referral program defines the rules and rewards for customers referring others to purchase a product. Each referral program is associated with a specific product and can have its own unique terms, incentives, and sharing content."}],"servers":[{"url":"https://api.glu.io","description":"Production API"}],"security":[{"x_api_key":[]}],"components":{"securitySchemes":{"x_api_key":{"type":"apiKey","description":"Value for the x-api-key header parameter.","name":"x-api-key","in":"header"}},"schemas":{"Referral.programs.ReferralProgramOutput-referral.read":{"type":"object","description":"A referral program defines the rules and rewards for customers referring others to purchase a product. Each referral program is associated with a specific product and can have its own unique terms, incentives, and sharing content.","properties":{"id":{"type":["integer","null"]},"product":{"anyOf":[{"$ref":"#/components/schemas/ReferralProgramProductOutput-referral.read"},{"type":"null"}]},"terms":{"type":["string","null"]},"incentiveDiscountAmount":{"type":["integer","null"]},"incentiveDiscountType":{"type":["string","null"],"enum":["FixedAmount","Percentage",null]},"shareTitle":{"type":["string","null"]},"shareText":{"type":["string","null"]},"shareUrl":{"type":["string","null"]},"tags":{"type":"array","items":{"$ref":"#/components/schemas/Tag-referral.read"}},"inviteEmailSubject":{"type":["string","null"]},"inviteEmailContent":{"type":["string","null"]},"inviteEmailDelay":{"type":["integer","null"]},"newContactsOnly":{"type":["boolean","null"]},"sendInviteEmail":{"type":["boolean","null"]}}},"ReferralProgramProductOutput-referral.read":{"type":"object","properties":{"id":{"type":["integer","null"]},"name":{"type":["string","null"]},"status":{"type":["string","null"],"enum":["Draft","Active","Scheduled","Expired","Deleted",null]}}},"Tag-referral.read":{"type":"object"},"Error.jsonld":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["integer","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"},"description":{"readOnly":true,"type":["string","null"]}}},"Error":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["integer","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"}}}}},"paths":{"/referral_programs/{id}":{"get":{"operationId":"api_referral_programs_id_get","tags":["Referral programs"],"responses":{"200":{"description":"Referral programs resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Referral.programs.ReferralProgramOutput-referral.read"}}}},"403":{"description":"Forbidden","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/Error.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"links":{}},"404":{"description":"Not found","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/Error.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"links":{}}},"summary":"Retrieve a referral program","description":"Retrieve a referral program","parameters":[{"name":"id","in":"path","description":"Referral programs identifier","required":true,"deprecated":false,"schema":{"type":"string"},"style":"simple","explode":false}]}}}}
```

## Create a referral invite for a referral program

> Create a referral invite for a referral program

```json
{"openapi":"3.1.0","info":{"title":"Glu","version":"1.0.0"},"tags":[{"name":"Referral programs","description":"A referral program defines the rules and rewards for customers referring others to purchase a product. Each referral program is associated with a specific product and can have its own unique terms, incentives, and sharing content."}],"servers":[{"url":"https://api.glu.io","description":"Production API"}],"security":[{"x_api_key":[]}],"components":{"securitySchemes":{"x_api_key":{"type":"apiKey","description":"Value for the x-api-key header parameter.","name":"x-api-key","in":"header"}},"schemas":{"Referral.programs.ReferralInvite-referral_invite.read":{"type":"object","description":"A referral program defines the rules and rewards for customers referring others to purchase a product. Each referral program is associated with a specific product and can have its own unique terms, incentives, and sharing content.","properties":{"id":{"readOnly":true,"type":"integer"},"name":{"type":"string"},"code":{"type":"string"},"contact":{"type":"integer"},"referralProgram":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"status":{"default":"Pending","type":"string","enum":["Pending","Completed"]},"referee":{"type":["string","null"],"format":"iri-reference"},"updatedAt":{"type":"string","format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"}}},"Error.jsonld":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["integer","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"},"description":{"readOnly":true,"type":["string","null"]}}},"Error":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["integer","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"}}},"ConstraintViolation.jsonld":{"type":"object","description":"Unprocessable entity","properties":{"status":{"default":422,"type":"integer"},"violations":{"type":"array","items":{"type":"object","properties":{"propertyPath":{"type":"string","description":"The property path of the violation"},"message":{"type":"string","description":"The message associated with the violation"},"code":{"type":"string","description":"The code of the violation"},"hint":{"type":"string","description":"An extra hint to understand the violation"},"payload":{"type":"object","additionalProperties":true,"description":"The serialized payload of the violation"}},"required":["propertyPath","message"]}},"detail":{"readOnly":true,"type":"string"},"description":{"readOnly":true,"type":"string"},"type":{"readOnly":true,"type":"string"},"title":{"readOnly":true,"type":["string","null"]},"instance":{"readOnly":true,"type":["string","null"]}}},"ConstraintViolation":{"type":"object","description":"Unprocessable entity","properties":{"status":{"default":422,"type":"integer"},"violations":{"type":"array","items":{"type":"object","properties":{"propertyPath":{"type":"string","description":"The property path of the violation"},"message":{"type":"string","description":"The message associated with the violation"},"code":{"type":"string","description":"The code of the violation"},"hint":{"type":"string","description":"An extra hint to understand the violation"},"payload":{"type":"object","additionalProperties":true,"description":"The serialized payload of the violation"}},"required":["propertyPath","message"]}},"detail":{"readOnly":true,"type":"string"},"type":{"readOnly":true,"type":"string"},"title":{"readOnly":true,"type":["string","null"]},"instance":{"readOnly":true,"type":["string","null"]}}},"Referral.programs.CreateReferralInviteInput-referral_invite.create":{"type":"object","description":"A referral program defines the rules and rewards for customers referring others to purchase a product. Each referral program is associated with a specific product and can have its own unique terms, incentives, and sharing content.","required":["contact","name"],"properties":{"contact":{"type":["integer","null"]},"name":{"type":["string","null"]},"code":{"maxLength":255,"type":["string","null"]}}}}},"paths":{"/referral_programs/{id}/invites":{"post":{"operationId":"api_referral_programs_idinvites_post","tags":["Referral programs"],"responses":{"201":{"description":"Referral programs resource created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Referral.programs.ReferralInvite-referral_invite.read"}}},"links":{}},"400":{"description":"Invalid input","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/Error.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"links":{}},"403":{"description":"Forbidden","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/Error.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"links":{}},"422":{"description":"An error occurred","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/ConstraintViolation.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/ConstraintViolation"}},"application/json":{"schema":{"$ref":"#/components/schemas/ConstraintViolation"}}},"links":{}}},"summary":"Create a referral invite for a referral program","description":"Create a referral invite for a referral program","parameters":[{"name":"id","in":"path","description":"Referral programs identifier","required":true,"deprecated":false,"schema":{"type":"string"},"style":"simple","explode":false}],"requestBody":{"description":"The new Referral programs resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Referral.programs.CreateReferralInviteInput-referral_invite.create"}}},"required":true}}}}}
```
