Introduction
Welcome to our developer documentation! Here you will find complete reference information for each of Friendbuy’s integration methods.
You will find JSON and JavaScript code examples in the right-hand pane and explanations of parameters and data models in the center pane.
You can also visit our Help Center for end user documentation.
Platform Migration Steps
Please reach out to your Friendbuy Customer Success Manager or support@friendbuy.com for important instructions if you are migrating from Friendbuy’s legacy platform onto our newest platform. You are currently viewing documentation for our legacy platform. For our newest platform documentation, click here
Integration Methods
Friendbuy offers several integration options for your applications:
- REST API. Programmatically retrieve and create data associated with your referral program, such as shares, conversions, referral codes, and customers.
- Webhooks. Real-time notifications sent to your system after referral program events occur, such as shares, conversions, and rewards.
- Client API. Friendbuy can integrate with your system to request supplemental instructions in real-time prior to sending shares or approving rewards.
- Embedded JavaScript. Include the Friendbuy JavaScript library into your web application to load widgets, track customers and purchases, and cookie users for proper attribution.
Security
Your Friendbuy account comes with an access key and a secret key. The REST API uses Basic Authentication over HTTPS with the access key as the username and the secret key as the password. When invoking webhooks and integrating with APIs on your servers, Friendbuy will use the secret key to sign requests.
Example Python Signature Computation
from base64 import b64encode
from hashlib import sha1
import hmac
def create_signature(api_secret, data):
mac = hmac.new(api_secret.encode('utf-8'), data.encode('utf-8'), sha1)
computed = b64encode(mac.digest())
return computed.strip()
You can verify the authenticity of a webhook request or client API integration from Friendbuy by analyzing its cryptographic signature. When Friendbuy sends a request to your endpoints, a signature is placed in the X-FRIENDBUY-SIGNATURE header (X-FRIENDBUY-SIGNATURE-V2 for custom reward validation), and is computed by Base64-encoding the HMAC-SHA1 hash of the request body with your Friendbuy secret key. To verify the signature:
- Calculate an HMAC-SHA1 composition of the JSON request body:
HMAC(api_secret, json_body) - Base64 encode the resulting value.
- If the Base64 encoded hash matches the signature header, the request is valid.
To provide better flexibility for customers that have specific header signature requirements, Friendbuy can now include custom headers as an alternative to our standard signature. For example, you may wish Friendbuy to supply the access token ac33-pXAP under the header Api-Access-Token. Friendbuy will then append the header in each webhook or integration request:
Api-Access-Token=ac33-pXAP
Custom headers can also be utilized for purposes other than security. For instance, if your webhook or integration url handles posts from more than one service, a vendor identifier could be used to indicate Friendbuy is the requesting vendor, for example:
Webhook-Consumer-Id=friendbuy
This feature is supported for all webhooks and client integration callbacks. For more details about utilizing custom headers, please contact your Friendbuy Customer Success Manager.
Content Types
The content type for all requests and responses for the REST API, webhooks, and client integrations is application/json.
Response Codes
Each request to the REST API will return one or more of the following codes in the HTTP response, to indicate success or failure:
| Code | Meaning | Description |
|---|---|---|
| 200 | OK | The request was successful and the response body contains valid data |
| 201 | Created | An entity was successfully created |
| 202 | Accepted | The request for an asynchronous operation was received |
| 400 | Bad Request | The request was malformed or semantically invalid |
| 401 | Unauthorized | The request did not contain proper credentials |
| 404 | Not Found | The requested resource could not be found |
| 405 | Method Not Allowed | The endpoint does not permit access via the specified method |
| 406 | Not Acceptable | The request asked for a response in a format other than JSON |
| 409 | Conflict | The request attempted to create a resource with a key that already exits |
| 410 | Gone | The endpoint is no longer supported |
| 503 | Service Unavailable | The API is temporarily offline |
For webhooks and client integrations, the response codes expected from your servers are:
| Code | Description |
|---|---|
| 200 | The request was successful and the response body contains valid data |
| The webhook or integration request failed |
Retries
If the response from a webhook or integration call is not 200, Friendbuy will retry the same request once per hour for at most 24 hours, or until a 200 respsonse is received.
Whitelisting
Webhook and client API calls to your endpoints will originate from the following IP addresses:
- 50.18.110.159
- 50.18.183.9
- 35.153.4.211
REST API
The REST API provides the ability to programmatically retrieve and create data associated with a referral program and supports integration use cases such as:
- Integrating Friendbuy into mobile applications without the need for Friendbuy’s embedded JavaScript library
- Supporting programs with an offline or non-cookied referral workflow
- Programmatically sending program performance metrics to third party business intelligence or data warehouse tools
Each endpoint available through the REST API is documented below. For each endpoint, a complete technical specification of the data model is detailed in the Response Model found in the center pane. The right-hand pane contains an Example tab for easily viewing sample JSON responses.
Base URL
The Base URL of all REST API endpoints is https://api.friendbuy.com/v1.
The Sandbox
A Try It button is available for all endpoints. This feature simulates a working API integration where you can experiment with POST, PATCH, and GET calls, and receive associated responses. Note that the Base URL for sandbox API endpoints is https://developer-api.friendbuy.com/v1.
The Try It feature makes use of a sandboxed database that is pre-populated with sample data. Data can be added to the sandbox by using Try It for a POST or PATCH call, such as POST /purchases. The database is reset to baseline sample data every 30 minutes, so feel free to experiment.
The sandbox contains the following sample entities:
| Entity Type | Values |
|---|---|
| Campaigns | ids 1...4 |
| Customers | internal ids 1...3; account ids JAYZ, ALCP, and MNLS, respectively |
| Referral Codes | cP4...cP9, cP-, q5A...q5H, uxB...uxE, uxQ...uxS |
| Shares | ids 1..5 and 7..9 |
| Reminder emails | id 14 |
| Purchases | ids 1..6 |
| Conversions | ids 1...8 |
| Rewards | ids 1...8 |
| Coupon Codes | SPECIAL1000...SPECIAL1004 |
| Email Opt Out Addresses | 5 of them |
| Email Opt Out Job Statuses | ids 1..5 |
Once the Try it button is clicked, the response from the sandbox is displayed in the Try It tab in the right-hand pane.
Search Results
Several of the API endpoints return paginated searches. In each case, the response returns a JSON payload with the following fields:
| SearchResults | |
|---|---|
| offset integer | Zero-based index of first result on this page in the entirety of all results |
| this_page_results_count integer | Number of results on this page |
| total_results_count integer | Total number of search results across all pages |
| results array | Array of search results |
Campaigns
In the context of the REST API, a campaign refers to the the name, configuration, and design of a given widget variant. Variants may be associated with others as part of a campaign group, as listed in the Friendbuy platform under Referral & Sharing > Widgets.
GET /campaigns
- Example
- Try It
// Example Response (200 OK)
{
"offset": 20,
"this_page_results_count": 1,
"total_results_count": 21,
"results": [
{
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00",
"archived": false,
"objective": "referral",
"distribution": 50,
"is_champion": true,
"campaign_group_id": "hm-NNz"
}
]
}
// To see live output, click the Try It button
Retrieves a list of widget variants.
Query Parameters
| offset Zero-based index of the first result to appear on the results page |
| limit Maximum number of results to return for the page |
| from_date First date of range (YYYY-MM-DD, inclusive) |
| to_date Last date of range (YYYY-MM-DD, inclusive) |
Response Model
| Campaign | |||||||
|---|---|---|---|---|---|---|---|
| id integer | Friendbuy-assigned id for the campaign | ||||||
| name string | Name of the campaign | ||||||
| published boolean | Whether the campaign has been published | ||||||
| referral_incentive object | Incentive for the campaign (Expand) | ||||||
| |||||||
| created_at datetime | Creation timestamp | ||||||
| archived boolean | Whether the campaign has been archived | ||||||
| objective string | One of referral, email_capture, or influencer | ||||||
| distribution integer | Percentage chance that the campaign’s widget will be served (100 for campaigns that have no variants) | ||||||
| is_champion boolean | Whether the campaign is designated as the champion of its group | ||||||
| campaign_group_id string | Identifier denoting the group (of campaign variants) to which the campaign belongs | ||||||
Customers
For a more seamless integration of your referral program with Friendbuy, information about your logged in customers, including their account id, email address, and name, can be passed to us. This can be done at anytime through a Track Customer call via the Friendbuy JavaScript embedded on your site, or while sending purchase data via the POST /purchases endpoint. A new customer record will be created by Friendbuy each time a unique customer account id is passed to us.
Customer data can be leveraged in Friendbuy to auto-populate widget fields, as well as tie referral activity to specific users as they are defined in your system.
GET /customers
- Example
- Try It
// Example Response (200 OK)
{
"offset": 20,
"this_page_results_count": 1,
"total_results_count": 21,
"results": [
{
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
}
]
}
// To see live output, click the Try It button
Retrieves a list of customers.
Query Parameters
| offset Zero-based index of the first result to appear on the results page |
| limit Maximum number of results to return for the page |
| from_date First date of range (YYYY-MM-DD, inclusive) |
| to_date Last date of range (YYYY-MM-DD, inclusive) |
| account_id The id you assigned to your customer (not the same as the internal Friendbuy-assigned id) |
Response Model
| CustomerExcerpt | |
|---|---|
| account_id string | The id you assigned to your customer (not the same as the internal Friendbuy-assigned id) |
| id string | Copy of the account_id field |
| first_name string | Customer first name |
| last_name string | Customer last name |
| email string | Email associated with the customer |
| stripe_customer_id string | Stripe’s id for the customer |
| chargebee_customer_id string | Chargebee’s id for the customer |
| detail_uri string | URI at which complete details of the customer can be retrieved |
GET /customers/{id}
- Example
- Try It
// Example Response (200 OK)
{
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1",
"created_at": "2013-02-02T02:02:02.222220",
"recent_shares": [
{
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
],
"recent_referral_codes": [
{
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
}
]
}
// To see live output, click the Try It button
Retrieves the complete details associated to a customer based on the customer’s Friendbuy id. See the description below for instructions on retrieving this id.
Path Parameters
| id* Friendbuy-assigned internal id of the customer to lookup. This differs from the id you have assigned to the customer. Generally this endpoint is discovered by first performing a search at the /customers endpoint and then navigating via the detail_uri property of a search result. |
*Required field
Response Model
| Customer | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| account_id string | The id you assigned to your customer (not the same as the internal Friendbuy-assigned id) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id string | Copy of the account_id field | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| first_name string | Customer first name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| last_name string | Customer last name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| email string | Email associated with the customer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| stripe_customer_id string | Stripe’s id for the customer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| chargebee_customer_id string | Chargebee’s id for the customer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| detail_uri string | URI at which complete details of the customer can be retrieved | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| created_at datetime | Timestamp at which Friendbuy created the customer record (missing time zone) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| recent_shares array | Array of the customer’s recent shares (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| recent_referral_codes array | Array of the customer’s recent referral codes (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GET /customer_info
- Example
- Try It
// Example Response (200 OK)
{
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1",
"created_at": "2013-02-02T02:02:02.222220",
"recent_shares": [
{
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
],
"recent_referral_codes": [
{
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
}
]
}
// To see live output, click the Try It button
Retrieves the complete details associated to a customer based on the customer’s account_id or email.
Query Parameters
| account_id** The id you assigned to your customer (not the same as the internal Friendbuy-assigned id) |
| email** Customer email address |
** At least one of these fields is required
Response Model
| Customer | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| account_id string | The id you assigned to your customer (not the same as the internal Friendbuy-assigned id) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id string | Copy of the account_id field | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| first_name string | Customer first name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| last_name string | Customer last name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| email string | Email associated with the customer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| stripe_customer_id string | Stripe’s id for the customer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| chargebee_customer_id string | Chargebee’s id for the customer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| detail_uri string | URI at which complete details of the customer can be retrieved | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| created_at datetime | Timestamp at which Friendbuy created the customer record (missing time zone) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| recent_shares array | Array of the customer’s recent shares (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| recent_referral_codes array | Array of the customer’s recent referral codes (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Referral Codes
Referrals are tracked using a Friendbuy-generated identifier called a referral code (e.g. b7x). These short strings are bound to a particular widget variant, the advocate, and the associated referral method (widget share, reminder email, PURL). Referral codes give Friendbuy the ability to track referral link clicks, referral purchases, and establish attribution back to an advocate.
All shares directly through a widget channel (e.g. email Twitter, Facebook) are assigned a new referral code for each share and channel. A personal URL or PURL (e.g. http://fbuy.me/c8z), however, always has the same referral code.
POST /referral_codes
- Example
- Try It
// Example Request Body
{
"campaign": {
"id": 53
},
"customer": {
"id": "C9911",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW"
},
"email": "morgan@example.com",
"coupon_code": "Friend20",
"coupon_bank_id": 5870,
"parameters": {
"utm_medium": "referral",
"utm_source": "Friendbuy"
}
}
// Example Response (200 OK)
{
"type": "share",
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": false,
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1",
"created_at": "2013-02-02T02:02:02.222220",
"recent_shares": [
{
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
],
"recent_referral_codes": [
{
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
}
]
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09",
"facebook_profile": {
"facebook_id": "100001724970193",
"name": "Taylor Gomez",
"first_name": "Taylor",
"last_name": "Gomez",
"email_address": "tgo@example.net",
"gender": "female",
"locale": "es_MX",
"link": "http://www.facebook.com/100001724970193",
"timezone": -7,
"verified": true,
"birthday": "1989-11-09T00:00:00.000Z",
"picture_url": "http://pictures.example.org/8abdjw87fe677lko",
"friends_count": 75025
},
"twitter_profile": {
"twitter_id": "308061521170129",
"name": "Taylor Gomez",
"screen_name": "taygomz17711",
"time_zone": "America/Mexico_City",
"bio": "Rabblerouser, marathon runner, pole vaulter, senator",
"homepage": "senate.example.mx/taylor_gomez",
"location": "Antarctica",
"language": "es",
"utc_offset": -18000,
"statuses_count": 89,
"friends_count": 55,
"followers_count": 75025,
"favourites_count": 1597,
"listed_count": 13,
"is_translator": false,
"contributors_enabled": true,
"verified": true,
"geo_enabled": true,
"protected": false,
"picture_url": "http://pbs.twimg.com/profile_images/601898989899999900/DzBmLB0Y.png"
}
},
"purchase": {
"order_id": "PQZ-4181",
"coupon_code": "COUPON123456",
"date": "2017-04-01T11:07:40.904Z",
"total": 15.97,
"new_customer": "true",
"email": "adrian@example.fi",
"ip_address": "200.1.2.3",
"products": [
{
"sku": "99P88Q77R",
"quantity": 21,
"price": 319.99
}
],
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1",
"created_at": "2013-02-02T02:02:02.222220",
"recent_shares": [
{
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
],
"recent_referral_codes": [
{
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
}
]
}
}
},
"reminder_email": {
"id": 377,
"referral_code": "ux7Q",
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"created_at": "2017-01-13T19:18:38.239Z",
"sharer": null,
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"additional_link_parameters": "{\"utm_medium\": \"referral\", \"utm_source\": \"Friendbuy\"}",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1",
"created_at": "2013-02-02T02:02:02.222220",
"recent_shares": [
{
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
],
"recent_referral_codes": [
{
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
}
]
},
"email": "alex@example.ca",
"coupon_codes": [
"abc123"
]
}
// To see live output, click the Try It button
Generates a referral code for a specific advocate for a campaign. When specifying a campaign id (widget) and either a customer id or an email address in the request body, this endpoint first checks to see if there is an existing referral code for that advocate/campaign combination. If found, the referral code is updated with any new information specified in the body. If not found, a new referral code will be created. In each scenario, the share will be associated with the customer. This endpoint can also be used to create an association with a coupon code and an advocate. coupon code is an optional parameter to include in the request, for attribution to be made when a multi-use code is redeemed at checkout, independent of using a referral link. Similarly, coupon bank id is a mutually exclusive, optional parameter, for programmatically retrieving an available code from the bank. Both require the coupon codes/bank to be uploaded to a Friendbuy coupon bank prior to generation, and customer email is recommended for reward distribution. If customer id is provided in the request, the newly generated referral code will be typed as a customer PURL. However, if only an email address is provided as the request parameter, the new referral code will be typed as an email PURL. There is no functional difference from an advocate or friend perspective between the two types of personal URLs (PURLs).
Body Parameters
| campaign.id* The campaign id |
| customer.id** The id you assigned to your customer (not the same as the internal Friendbuy-assigned id) |
| customer.first_name Customer first name |
| customer.last_name Customer last name |
| customer.email Email associated with the customer |
| customer.stripe_customer_id Stripe’s id for the customer |
| customer.chargebee_customer_id Chargebee’s id for the customer |
| email** Email address, if creating or retrieving email purls |
| coupon_code*** Multi-use coupon code to make association with referral code |
| coupon_bank_id*** Coupon code bank with multi-use codes, to programatticaly make an association with each referral code |
| parameters Link parameters to set on the referral code (enter as JSON to try out) |
* Required field
** At least one of these fields is required
*** The fields are mutually exclusive
Response Model
| ReferralCode | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| type string | One of share, personal_url, email_personal_url, or reminder_email | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| referral_code string | Short alphanumeric code (e.g., uxC) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| trackable_link string | URI formed from the shortened domain together with the short code | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| destination_url string | URI in the merchant’s site that the trackable link redirects to | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| referral_code_blacklisted boolean | States if referral code has been invalidated from redirecting users to offer, managed within Referral Code Blacklist in the application. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| share object | If the referral code is from a share, the associated share (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reminder_email object | If the referral code is from a reminder email, the associated reminder email (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| campaign object | If the code is a personal url, the campaign to which it is bound. Otherwise, find the campaign information in the nested share or reminder email object. (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| additional_link_parameters string | Link parameters set on the referral code | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| customer object | If the code is a customer personal url, the customer to which it is assigned (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| email string | If the code is an email personal url, the email address to which it is assigned | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| coupon_codes array | The coupon code associated with the referral code generated. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GET /referral_codes/{code}
- Example
- Try It
// Example Response (200 OK)
{
"type": "share",
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": false,
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1",
"created_at": "2013-02-02T02:02:02.222220",
"recent_shares": [
{
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
],
"recent_referral_codes": [
{
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
}
]
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09",
"facebook_profile": {
"facebook_id": "100001724970193",
"name": "Taylor Gomez",
"first_name": "Taylor",
"last_name": "Gomez",
"email_address": "tgo@example.net",
"gender": "female",
"locale": "es_MX",
"link": "http://www.facebook.com/100001724970193",
"timezone": -7,
"verified": true,
"birthday": "1989-11-09T00:00:00.000Z",
"picture_url": "http://pictures.example.org/8abdjw87fe677lko",
"friends_count": 75025
},
"twitter_profile": {
"twitter_id": "308061521170129",
"name": "Taylor Gomez",
"screen_name": "taygomz17711",
"time_zone": "America/Mexico_City",
"bio": "Rabblerouser, marathon runner, pole vaulter, senator",
"homepage": "senate.example.mx/taylor_gomez",
"location": "Antarctica",
"language": "es",
"utc_offset": -18000,
"statuses_count": 89,
"friends_count": 55,
"followers_count": 75025,
"favourites_count": 1597,
"listed_count": 13,
"is_translator": false,
"contributors_enabled": true,
"verified": true,
"geo_enabled": true,
"protected": false,
"picture_url": "http://pbs.twimg.com/profile_images/601898989899999900/DzBmLB0Y.png"
}
},
"purchase": {
"order_id": "PQZ-4181",
"coupon_code": "COUPON123456",
"date": "2017-04-01T11:07:40.904Z",
"total": 15.97,
"new_customer": "true",
"email": "adrian@example.fi",
"ip_address": "200.1.2.3",
"products": [
{
"sku": "99P88Q77R",
"quantity": 21,
"price": 319.99
}
],
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1",
"created_at": "2013-02-02T02:02:02.222220",
"recent_shares": [
{
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
],
"recent_referral_codes": [
{
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
}
]
}
}
},
"reminder_email": {
"id": 377,
"referral_code": "ux7Q",
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"created_at": "2017-01-13T19:18:38.239Z",
"sharer": null,
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"additional_link_parameters": "{\"utm_medium\": \"referral\", \"utm_source\": \"Friendbuy\"}",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1",
"created_at": "2013-02-02T02:02:02.222220",
"recent_shares": [
{
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
],
"recent_referral_codes": [
{
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
}
]
},
"email": "alex@example.ca",
"coupon_codes": [
"abc123"
]
}
// To see live output, click the Try It button
Retrieves the complete details associated to a specific referral code.
Path Parameters
| code* Short alphanumeric code to be looked up |
*Required field
Response Model
| ReferralCode | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| type string | One of share, personal_url, email_personal_url, or reminder_email | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| referral_code string | Short alphanumeric code (e.g., uxC) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| trackable_link string | URI formed from the shortened domain together with the short code | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| destination_url string | URI in the merchant’s site that the trackable link redirects to | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| referral_code_blacklisted boolean | States if referral code has been invalidated from redirecting users to offer, managed within Referral Code Blacklist in the application. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| share object | If the referral code is from a share, the associated share (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reminder_email object | If the referral code is from a reminder email, the associated reminder email (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| campaign object | If the code is a personal url, the campaign to which it is bound. Otherwise, find the campaign information in the nested share or reminder email object. (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| additional_link_parameters string | Link parameters set on the referral code | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| customer object | If the code is a customer personal url, the customer to which it is assigned (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| email string | If the code is an email personal url, the email address to which it is assigned | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| coupon_codes array | The coupon code associated with the referral code generated. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PATCH /referral_codes/{code}
- Example
- Try It
// Example Request Body
{
"parameters": {
"utm_medium": "referral",
"utm_source": "Friendbuy"
}
}
// Example Response (200 OK)
{
"type": "share",
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": false,
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1",
"created_at": "2013-02-02T02:02:02.222220",
"recent_shares": [
{
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
],
"recent_referral_codes": [
{
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
}
]
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09",
"facebook_profile": {
"facebook_id": "100001724970193",
"name": "Taylor Gomez",
"first_name": "Taylor",
"last_name": "Gomez",
"email_address": "tgo@example.net",
"gender": "female",
"locale": "es_MX",
"link": "http://www.facebook.com/100001724970193",
"timezone": -7,
"verified": true,
"birthday": "1989-11-09T00:00:00.000Z",
"picture_url": "http://pictures.example.org/8abdjw87fe677lko",
"friends_count": 75025
},
"twitter_profile": {
"twitter_id": "308061521170129",
"name": "Taylor Gomez",
"screen_name": "taygomz17711",
"time_zone": "America/Mexico_City",
"bio": "Rabblerouser, marathon runner, pole vaulter, senator",
"homepage": "senate.example.mx/taylor_gomez",
"location": "Antarctica",
"language": "es",
"utc_offset": -18000,
"statuses_count": 89,
"friends_count": 55,
"followers_count": 75025,
"favourites_count": 1597,
"listed_count": 13,
"is_translator": false,
"contributors_enabled": true,
"verified": true,
"geo_enabled": true,
"protected": false,
"picture_url": "http://pbs.twimg.com/profile_images/601898989899999900/DzBmLB0Y.png"
}
},
"purchase": {
"order_id": "PQZ-4181",
"coupon_code": "COUPON123456",
"date": "2017-04-01T11:07:40.904Z",
"total": 15.97,
"new_customer": "true",
"email": "adrian@example.fi",
"ip_address": "200.1.2.3",
"products": [
{
"sku": "99P88Q77R",
"quantity": 21,
"price": 319.99
}
],
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1",
"created_at": "2013-02-02T02:02:02.222220",
"recent_shares": [
{
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
],
"recent_referral_codes": [
{
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
}
]
}
}
},
"reminder_email": {
"id": 377,
"referral_code": "ux7Q",
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"created_at": "2017-01-13T19:18:38.239Z",
"sharer": null,
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"additional_link_parameters": "{\"utm_medium\": \"referral\", \"utm_source\": \"Friendbuy\"}",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1",
"created_at": "2013-02-02T02:02:02.222220",
"recent_shares": [
{
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
],
"recent_referral_codes": [
{
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
}
]
},
"email": "alex@example.ca",
"coupon_codes": [
"abc123"
]
}
// To see live output, click the Try It button
Updates the tracking parameters associated with a specific referral link. Although the most common type of link parameter is the UTM, this endpoint allows you define any key-value pair to be appended to referral link for a PURL.
Path Parameters
| code* Short alphanumeric code of the referral code to update |
*Required field
Body Parameters
| parameters Link parameters to set on the referral code (enter as JSON to try out) |
* Required field
Response Model
| ReferralCode | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| type string | One of share, personal_url, email_personal_url, or reminder_email | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| referral_code string | Short alphanumeric code (e.g., uxC) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| trackable_link string | URI formed from the shortened domain together with the short code | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| destination_url string | URI in the merchant’s site that the trackable link redirects to | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| referral_code_blacklisted boolean | States if referral code has been invalidated from redirecting users to offer, managed within Referral Code Blacklist in the application. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| share object | If the referral code is from a share, the associated share (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reminder_email object | If the referral code is from a reminder email, the associated reminder email (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| campaign object | If the code is a personal url, the campaign to which it is bound. Otherwise, find the campaign information in the nested share or reminder email object. (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| additional_link_parameters string | Link parameters set on the referral code | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| customer object | If the code is a customer personal url, the customer to which it is assigned (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| email string | If the code is an email personal url, the email address to which it is assigned | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| coupon_codes array | The coupon code associated with the referral code generated. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GET /customers/{id}/referral_codes
- Example
- Try It
// Example Response (200 OK)
{
"offset": 20,
"this_page_results_count": 1,
"total_results_count": 21,
"results": [
{
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
}
]
}
// To see live output, click the Try It button
Retrieves a list of referral codes for a specific customer.
Path Parameters
| id* Friendbuy-assigned internal id of the customer to lookup. This differs from the id you have assigned to the customer. Generally this endpoint is discovered by first performing a search at the /customers endpoint and then navigating via the detail_uri property of a search result. |
*Required field
Query Parameters
| offset Zero-based index of the first result to appear on the results page |
| limit Maximum number of results to return for the page |
| from_date First date of range (YYYY-MM-DD, inclusive) |
| to_date Last date of range (YYYY-MM-DD, inclusive) |
Response Model
| ReferralCodeExcerpt | |
|---|---|
| referral_code string | Short alphanumeric code (e.g., uxC) |
| trackable_link string | URI formed from the shortened domain together with the short code |
| destination_url string | URI in the merchant’s site that the trackable link redirects to |
| referral_code_blacklisted boolean | States if referral code has been invalidated from redirecting users to offer, managed within Referral Code Blacklist in the application. |
Shares
A share occurs when an advocate refers a friend directly through a Friendbuy widget. The share will be associated to a specific channel, such as email, Facebook, or Twitter.
GET /shares
// Example Response (200 OK)
{
"offset": 20,
"this_page_results_count": 1,
"total_results_count": 21,
"results": [
{
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
]
}
// To see live output, click the Try It button
Retrieves a list of shares.
Query Parameters
| offset Zero-based index of the first result to appear on the results page |
| limit Maximum number of results to return for the page |
| from_date First date of range (YYYY-MM-DD, inclusive) |
| to_date Last date of range (YYYY-MM-DD, inclusive) |
| campaign Id of the campaign to be searched (can be found on the widget detail page of your Friendbuy dashboard, or via a search at the GET /campaigns endpoint) |
Response Model
| ShareExcerpt | |||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id integer | Friendbuy internal id for this share | ||||||||||||||||||||||||||||||||||
| referral_code string | Short alphanumeric code | ||||||||||||||||||||||||||||||||||
| message object | Message sent along with share (Expand) | ||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||
| campaign object | Campaign that is being shared (Expand) | ||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||
| ip_address string | IP address of the share | ||||||||||||||||||||||||||||||||||
| newsletter_opt_in boolean | Whether a newsletter opt in should take place with the share | ||||||||||||||||||||||||||||||||||
| send_reminder boolean | Whether a reminder should be sent for the share | ||||||||||||||||||||||||||||||||||
| created_at datetime | Share creation timestamp | ||||||||||||||||||||||||||||||||||
| detail_uri string | URI endpoint at which to get full details of the share | ||||||||||||||||||||||||||||||||||
| email_recipients array | JSON-formatted array of recipients for the share, present only if (1) the share is an email share and (2) the merchant is permitted to access this information (*Contact Friendbuy to inquire about the ability to access the recipient list*) | ||||||||||||||||||||||||||||||||||
| sharer object | Information for the entity making the share (Expand) | ||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||
GET /shares/{id}
// Example Response (200 OK)
{
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1",
"created_at": "2013-02-02T02:02:02.222220",
"recent_shares": [
{
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
],
"recent_referral_codes": [
{
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
}
]
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09",
"facebook_profile": {
"facebook_id": "100001724970193",
"name": "Taylor Gomez",
"first_name": "Taylor",
"last_name": "Gomez",
"email_address": "tgo@example.net",
"gender": "female",
"locale": "es_MX",
"link": "http://www.facebook.com/100001724970193",
"timezone": -7,
"verified": true,
"birthday": "1989-11-09T00:00:00.000Z",
"picture_url": "http://pictures.example.org/8abdjw87fe677lko",
"friends_count": 75025
},
"twitter_profile": {
"twitter_id": "308061521170129",
"name": "Taylor Gomez",
"screen_name": "taygomz17711",
"time_zone": "America/Mexico_City",
"bio": "Rabblerouser, marathon runner, pole vaulter, senator",
"homepage": "senate.example.mx/taylor_gomez",
"location": "Antarctica",
"language": "es",
"utc_offset": -18000,
"statuses_count": 89,
"friends_count": 55,
"followers_count": 75025,
"favourites_count": 1597,
"listed_count": 13,
"is_translator": false,
"contributors_enabled": true,
"verified": true,
"geo_enabled": true,
"protected": false,
"picture_url": "http://pbs.twimg.com/profile_images/601898989899999900/DzBmLB0Y.png"
}
},
"purchase": {
"order_id": "PQZ-4181",
"coupon_code": "COUPON123456",
"date": "2017-04-01T11:07:40.904Z",
"total": 15.97,
"new_customer": "true",
"email": "adrian@example.fi",
"ip_address": "200.1.2.3",
"products": [
{
"sku": "99P88Q77R",
"quantity": 21,
"price": 319.99
}
],
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1",
"created_at": "2013-02-02T02:02:02.222220",
"recent_shares": [
{
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
],
"recent_referral_codes": [
{
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
}
]
}
}
}
// To see live output, click the Try It button
Retrieves the complete details associated to a specific share.
Path Parameters
| id* The internal id of the share |
*Required field
Response Model
| Share | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id integer | Friendbuy internal id for this share | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| referral_code string | Short alphanumeric code | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| message object | Message sent along with share (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| campaign object | Campaign that is being shared (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ip_address string | IP address of the share | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| newsletter_opt_in boolean | Whether a newsletter opt in should take place with the share | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| send_reminder boolean | Whether a reminder should be sent for the share | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| created_at datetime | Share creation timestamp | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| detail_uri string | URI endpoint at which to get full details of the share | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| email_recipients array | JSON-formatted array of recipients for the share, present only if (1) the share is an email share and (2) the merchant is permitted to access this information (*Contact Friendbuy to inquire about the ability to access the recipient list*) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sharer object | Information for the entity making the share (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| purchase object | Purchase (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
POST /shares
// Example Request Body
{
"campaign_id": 931,
"from_email_address": "root@fifa.example.org",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"newsletter_opt_in": true,
"send_reminder": true,
"custom_message": "Good game!",
"customer": {
"account_id": "C9911",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW"
},
"parameters": {
"utm_medium": "referral",
"utm_source": "Friendbuy",
"referrer": "MDMQ4DE9"
}
}
// Example Response (201 CREATED)
{
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1",
"created_at": "2013-02-02T02:02:02.222220",
"recent_shares": [
{
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
],
"recent_referral_codes": [
{
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
}
]
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09",
"facebook_profile": {
"facebook_id": "100001724970193",
"name": "Taylor Gomez",
"first_name": "Taylor",
"last_name": "Gomez",
"email_address": "tgo@example.net",
"gender": "female",
"locale": "es_MX",
"link": "http://www.facebook.com/100001724970193",
"timezone": -7,
"verified": true,
"birthday": "1989-11-09T00:00:00.000Z",
"picture_url": "http://pictures.example.org/8abdjw87fe677lko",
"friends_count": 75025
},
"twitter_profile": {
"twitter_id": "308061521170129",
"name": "Taylor Gomez",
"screen_name": "taygomz17711",
"time_zone": "America/Mexico_City",
"bio": "Rabblerouser, marathon runner, pole vaulter, senator",
"homepage": "senate.example.mx/taylor_gomez",
"location": "Antarctica",
"language": "es",
"utc_offset": -18000,
"statuses_count": 89,
"friends_count": 55,
"followers_count": 75025,
"favourites_count": 1597,
"listed_count": 13,
"is_translator": false,
"contributors_enabled": true,
"verified": true,
"geo_enabled": true,
"protected": false,
"picture_url": "http://pbs.twimg.com/profile_images/601898989899999900/DzBmLB0Y.png"
}
},
"purchase": {
"order_id": "PQZ-4181",
"coupon_code": "COUPON123456",
"date": "2017-04-01T11:07:40.904Z",
"total": 15.97,
"new_customer": "true",
"email": "adrian@example.fi",
"ip_address": "200.1.2.3",
"products": [
{
"sku": "99P88Q77R",
"quantity": 21,
"price": 319.99
}
],
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1",
"created_at": "2013-02-02T02:02:02.222220",
"recent_shares": [
{
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
],
"recent_referral_codes": [
{
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
}
]
}
}
}
// To see live output, click the Try It button
Generates a new email share.
If providing customer id, we will check if there is an existing customer record in Friendbuy. If so, the record will be updated with any new information specified in the body parameters. If no customer record exists, a new one will be created. In each scenario, the share will be associated with the customer.
Body Parameters
| campaign_id* Id of the campaign for which the share is to be made |
| from_email_address* Email address from which the share is sent |
| email_recipients* Recipients of the share (enter as comma-separated list to try out) |
| newsletter_opt_in Whether a newsletter opt in should take place with the share |
| send_reminder Whether a reminder should be sent for the share |
| custom_message Message sent with the share |
| customer.account_id The id you assigned to your customer (not the same as the internal Friendbuy-assigned id) |
| customer.first_name Customer first name |
| customer.last_name Customer last name |
| customer.email Email associated with the customer |
| customer.stripe_customer_id Stripe’s id for the customer |
| customer.chargebee_customer_id Chargebee’s id for the customer |
| parameters Custom referral parameters, for additional details about shares |
* Required field
Response Model
| Share | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id integer | Friendbuy internal id for this share | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| referral_code string | Short alphanumeric code | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| message object | Message sent along with share (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| campaign object | Campaign that is being shared (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ip_address string | IP address of the share | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| newsletter_opt_in boolean | Whether a newsletter opt in should take place with the share | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| send_reminder boolean | Whether a reminder should be sent for the share | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| created_at datetime | Share creation timestamp | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| detail_uri string | URI endpoint at which to get full details of the share | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| email_recipients array | JSON-formatted array of recipients for the share, present only if (1) the share is an email share and (2) the merchant is permitted to access this information (*Contact Friendbuy to inquire about the ability to access the recipient list*) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sharer object | Information for the entity making the share (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| purchase object | Purchase (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GET /customers/{id}/shares
// Example Response (200 OK)
{
"offset": 20,
"this_page_results_count": 1,
"total_results_count": 21,
"results": [
{
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
]
}
// To see live output, click the Try It button
Retrieves a list of shares for a specific customer.
Path Parameters
| id* Friendbuy-assigned internal id of the customer to lookup. This differs from the id you have assigned to the customer. Generally this endpoint is discovered by first performing a search at the /customers endpoint and then navigating via the detail_uri property of a search result. |
*Required field
Response Model
| ShareExcerpt | |||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id integer | Friendbuy internal id for this share | ||||||||||||||||||||||||||||||||||
| referral_code string | Short alphanumeric code | ||||||||||||||||||||||||||||||||||
| message object | Message sent along with share (Expand) | ||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||
| campaign object | Campaign that is being shared (Expand) | ||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||
| ip_address string | IP address of the share | ||||||||||||||||||||||||||||||||||
| newsletter_opt_in boolean | Whether a newsletter opt in should take place with the share | ||||||||||||||||||||||||||||||||||
| send_reminder boolean | Whether a reminder should be sent for the share | ||||||||||||||||||||||||||||||||||
| created_at datetime | Share creation timestamp | ||||||||||||||||||||||||||||||||||
| detail_uri string | URI endpoint at which to get full details of the share | ||||||||||||||||||||||||||||||||||
| email_recipients array | JSON-formatted array of recipients for the share, present only if (1) the share is an email share and (2) the merchant is permitted to access this information (*Contact Friendbuy to inquire about the ability to access the recipient list*) | ||||||||||||||||||||||||||||||||||
| sharer object | Information for the entity making the share (Expand) | ||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||
GET /customers/{id}/email-recipients
- Example
- Try It
// Example Response (200 OK)
{
"offset": 20,
"this_page_results_count": 1,
"total_results_count": 21,
"results": [
{
"email": "messi@example.ar",
"invitation_dates": [
"2017-01-13T10:53:09.933Z",
"2017-03-30T10:11:29.105Z"
]
}
]
}
// To see live output, click the Try It button
Retrieves a list of email addresses to which a given customer has sent email shares.
Path Parameters
| id* Friendbuy-assigned internal id of the customer to lookup. This differs from the id you have assigned to the customer. Generally this endpoint is discovered by first performing a search at the /customers endpoint and then navigating via the detail_uri property of a search result. |
*Required field
Response Model
| EmailRecipient | |
|---|---|
| email string | Invited email address |
| invitation_dates array | Datetimes of invitations (missing time zone) |
Conversions
A conversion occurs when (1) Friendbuy is notified of a purchase, and (2) we are able to associate the purchase to an advocate’s referral via the referral code or coupon code provided to their friend.
You can notify Friendbuy of a purchase through a Track Order call via the Friendbuy JavaScript embedded on your site, or through the POST /purchases endpoint.
GET /conversions
- Example
- Try It
// Example Response (200 OK)
{
"offset": 20,
"this_page_results_count": 1,
"total_results_count": 21,
"results": [
{
"id": 121393,
"status": "paid",
"type": "share",
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"purchase": {
"order_id": "PQZ-4181",
"coupon_code": "COUPON123456",
"date": "2017-04-01T11:07:40.904Z",
"total": 15.97,
"new_customer": "true",
"email": "adrian@example.fi",
"ip_address": "200.1.2.3",
"products": [
{
"sku": "99P88Q77R",
"quantity": 21,
"price": 319.99
}
],
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
}
},
"detail_uri": "https://developer-api.friendbuy.com/v1/conversions/121393",
"created_at": "2016-03-01T19:12:38.239Z",
"possible_self_referral": true,
"fraud": {
"same_shopper": false,
"same_customer": false,
"same_email": false,
"same_ip_address": false,
"same_ip_and_user_agent": false,
"fuzzy_email": false,
"high_sensitivity_fuzzy_email": false
},
"reward": "null",
"personal_url": {
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
},
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
},
"reminder_email": {
"id": 377,
"referral_code": "ux7Q",
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"created_at": "2017-01-13T19:18:38.239Z",
"sharer": null,
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
},
"referrer": {
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"email": "alex@example.ca",
"name": "Taylor Gomez",
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
},
"rewards": [
{
"id": 3181,
"status": "invalid",
"type": "fixed_cash",
"amount": 10,
"rejected_reasons": {
"same_customer": "same customer ID detected",
"same_email": "same email detected",
"fuzzy_email": "similar email detected"
},
"created_at": "2017-01-13T19:18:38.239Z",
"evaluate_at": "2017-01-13T19:20:38.211Z",
"conversion": {
"id": 121393,
"status": "paid",
"type": "share",
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"purchase": {
"order_id": "PQZ-4181",
"coupon_code": "COUPON123456",
"date": "2017-04-01T11:07:40.904Z",
"total": 15.97,
"new_customer": "true",
"email": "adrian@example.fi",
"ip_address": "200.1.2.3",
"products": [
{
"sku": "99P88Q77R",
"quantity": 21,
"price": 319.99
}
],
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
}
},
"detail_uri": "https://developer-api.friendbuy.com/v1/conversions/121393",
"created_at": "2016-03-01T19:12:38.239Z",
"possible_self_referral": true,
"fraud": {
"same_shopper": false,
"same_customer": false,
"same_email": false,
"same_ip_address": false,
"same_ip_and_user_agent": false,
"fuzzy_email": false,
"high_sensitivity_fuzzy_email": false
},
"reward": "null",
"personal_url": {
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
},
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
},
"reminder_email": {
"id": 377,
"referral_code": "ux7Q",
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"created_at": "2017-01-13T19:18:38.239Z",
"sharer": null,
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
},
"referrer": {
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"email": "alex@example.ca",
"name": "Taylor Gomez",
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
}
]
}
]
}
// To see live output, click the Try It button
Retrieves a list of conversions.
Query Parameters
| offset Zero-based index of the first result to appear on the results page |
| limit Maximum number of results to return for the page |
| from_date First date of range (YYYY-MM-DD, inclusive) |
| to_date Last date of range (YYYY-MM-DD, inclusive) |
| campaign Id of the campaign to be searched (can be found on the widget detail page of your Friendbuy dashboard, or via a search at the GET /campaigns endpoint) |
Response Model
| ConversionExcerpt | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id integer | Friendbuy internal id for this conversion | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| status string | One of unmarked, paid, or rejected | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type string | One of share, customer_personal_url, email_personal_url, or reminder_email | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| campaign object | Campaign for this reward (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| purchase object | Purchase triggering the conversion if any (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| detail_uri string | Friendbuy REST API resource for the conversion | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| created_at datetime | Conversion creation timestamp | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| possible_self_referral boolean | Whether the conversion may have come from an advocate using their own referral. This is done by comparing the data collected at time of a purchase to the data collected at time the share, PURL, or reminder email is generated. Note: this calculation is dependent on which fraud check settings have been enabled in the Friendbuy platform (specifically, the browser, customer id, email address, and IP address checks) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fraud object | Brief report on the presence or absence of various fraud conditions (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reward | Deprecated, always null | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| personal_url object | Present only if conversion was triggered from a PURL (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| share object | Present only if conversion was triggered from a share (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reminder_email object | Present only if conversion was triggered from a reminder email (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| referrer object | Information about the advocate creating the conversion (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rewards array | Rewards from this conversion, only present for top-level conversion queries and webhooks and never included for conversions are embedded within reward data (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GET /conversions/{id}
- Example
- Try It
// Example Response (200 OK)
{
"id": 121393,
"status": "paid",
"type": "share",
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"purchase": {
"order_id": "PQZ-4181",
"coupon_code": "COUPON123456",
"date": "2017-04-01T11:07:40.904Z",
"total": 15.97,
"new_customer": "true",
"email": "adrian@example.fi",
"ip_address": "200.1.2.3",
"products": [
{
"sku": "99P88Q77R",
"quantity": 21,
"price": 319.99
}
],
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
}
},
"detail_uri": "https://developer-api.friendbuy.com/v1/conversions/121393",
"created_at": "2016-03-01T19:12:38.239Z",
"possible_self_referral": true,
"fraud": {
"same_shopper": false,
"same_customer": false,
"same_email": false,
"same_ip_address": false,
"same_ip_and_user_agent": false,
"fuzzy_email": false,
"high_sensitivity_fuzzy_email": false
},
"reward": "null",
"personal_url": {
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
},
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1",
"created_at": "2013-02-02T02:02:02.222220",
"recent_shares": [
{
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
],
"recent_referral_codes": [
{
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
}
]
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09",
"facebook_profile": {
"facebook_id": "100001724970193",
"name": "Taylor Gomez",
"first_name": "Taylor",
"last_name": "Gomez",
"email_address": "tgo@example.net",
"gender": "female",
"locale": "es_MX",
"link": "http://www.facebook.com/100001724970193",
"timezone": -7,
"verified": true,
"birthday": "1989-11-09T00:00:00.000Z",
"picture_url": "http://pictures.example.org/8abdjw87fe677lko",
"friends_count": 75025
},
"twitter_profile": {
"twitter_id": "308061521170129",
"name": "Taylor Gomez",
"screen_name": "taygomz17711",
"time_zone": "America/Mexico_City",
"bio": "Rabblerouser, marathon runner, pole vaulter, senator",
"homepage": "senate.example.mx/taylor_gomez",
"location": "Antarctica",
"language": "es",
"utc_offset": -18000,
"statuses_count": 89,
"friends_count": 55,
"followers_count": 75025,
"favourites_count": 1597,
"listed_count": 13,
"is_translator": false,
"contributors_enabled": true,
"verified": true,
"geo_enabled": true,
"protected": false,
"picture_url": "http://pbs.twimg.com/profile_images/601898989899999900/DzBmLB0Y.png"
}
},
"purchase": {
"order_id": "PQZ-4181",
"coupon_code": "COUPON123456",
"date": "2017-04-01T11:07:40.904Z",
"total": 15.97,
"new_customer": "true",
"email": "adrian@example.fi",
"ip_address": "200.1.2.3",
"products": [
{
"sku": "99P88Q77R",
"quantity": 21,
"price": 319.99
}
],
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1",
"created_at": "2013-02-02T02:02:02.222220",
"recent_shares": [
{
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
],
"recent_referral_codes": [
{
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
}
]
}
}
},
"reminder_email": {
"id": 377,
"referral_code": "ux7Q",
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"created_at": "2017-01-13T19:18:38.239Z",
"sharer": null,
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
},
"referrer": {
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"email": "alex@example.ca",
"name": "Taylor Gomez",
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
},
"rewards": [
{
"id": 3181,
"status": "invalid",
"type": "fixed_cash",
"amount": 10,
"rejected_reasons": {
"same_customer": "same customer ID detected",
"same_email": "same email detected",
"fuzzy_email": "similar email detected"
},
"created_at": "2017-01-13T19:18:38.239Z",
"evaluate_at": "2017-01-13T19:20:38.211Z",
"conversion": {
"id": 121393,
"status": "paid",
"type": "share",
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"purchase": {
"order_id": "PQZ-4181",
"coupon_code": "COUPON123456",
"date": "2017-04-01T11:07:40.904Z",
"total": 15.97,
"new_customer": "true",
"email": "adrian@example.fi",
"ip_address": "200.1.2.3",
"products": [
{
"sku": "99P88Q77R",
"quantity": 21,
"price": 319.99
}
],
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
}
},
"detail_uri": "https://developer-api.friendbuy.com/v1/conversions/121393",
"created_at": "2016-03-01T19:12:38.239Z",
"possible_self_referral": true,
"fraud": {
"same_shopper": false,
"same_customer": false,
"same_email": false,
"same_ip_address": false,
"same_ip_and_user_agent": false,
"fuzzy_email": false,
"high_sensitivity_fuzzy_email": false
},
"reward": "null",
"personal_url": {
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
},
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
},
"reminder_email": {
"id": 377,
"referral_code": "ux7Q",
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"created_at": "2017-01-13T19:18:38.239Z",
"sharer": null,
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
},
"referrer": {
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"email": "alex@example.ca",
"name": "Taylor Gomez",
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
}
]
}
// To see live output, click the Try It button
Retrieves the complete details associated with a specific conversion.
Path Parameters
| id* The internal id of the conversion |
*Required field
Response Model
| Conversion | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id integer | Friendbuy internal id for this conversion | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| status string | One of unmarked, paid, or rejected | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type string | One of share, customer_personal_url, email_personal_url, or reminder_email | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| campaign object | Campaign for this reward (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| purchase object | Purchase triggering the conversion if any (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| detail_uri string | Friendbuy REST API resource for the conversion | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| created_at datetime | Conversion creation timestamp | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| possible_self_referral boolean | Whether the conversion may have come from an advocate using their own referral. This is done by comparing the data collected at time of a purchase to the data collected at time the share, PURL, or reminder email is generated. Note: this calculation is dependent on which fraud check settings have been enabled in the Friendbuy platform (specifically, the browser, customer id, email address, and IP address checks) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fraud object | Brief report on the presence or absence of various fraud conditions (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reward | Deprecated, always null | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| personal_url object | Present only if conversion was triggered from a PURL (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| share object | Present only if conversion was triggered from a share (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reminder_email object | Present only if conversion was triggered from a reminder email (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| referrer object | Information about the advocate creating the conversion (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rewards array | Rewards from this conversion, only present for top-level conversion queries and webhooks and never included for conversions are embedded within reward data (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
POST /purchases
- Example
- Try It
// Example Request Body
{
"referral_code": "z7x",
"coupon_code": "COUPON98765",
"ip_address": "8.8.8.8",
"order": {
"id": "777B221-X",
"amount": 177.11,
"email": "rory@example.za",
"new_customer": true
},
"customer": {
"id": "C9911",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW"
},
"products": [
{
"sku": "99P88Q77R",
"quantity": 21,
"price": 319.99
}
]
}
// Example Response (201 CREATED)
{
"id": 121393,
"status": "paid",
"type": "share",
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"purchase": {
"order_id": "PQZ-4181",
"coupon_code": "COUPON123456",
"date": "2017-04-01T11:07:40.904Z",
"total": 15.97,
"new_customer": "true",
"email": "adrian@example.fi",
"ip_address": "200.1.2.3",
"products": [
{
"sku": "99P88Q77R",
"quantity": 21,
"price": 319.99
}
],
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
}
},
"detail_uri": "https://developer-api.friendbuy.com/v1/conversions/121393",
"created_at": "2016-03-01T19:12:38.239Z",
"possible_self_referral": true,
"fraud": {
"same_shopper": false,
"same_customer": false,
"same_email": false,
"same_ip_address": false,
"same_ip_and_user_agent": false,
"fuzzy_email": false,
"high_sensitivity_fuzzy_email": false
},
"reward": "null",
"personal_url": {
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
},
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1",
"created_at": "2013-02-02T02:02:02.222220",
"recent_shares": [
{
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
],
"recent_referral_codes": [
{
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
}
]
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09",
"facebook_profile": {
"facebook_id": "100001724970193",
"name": "Taylor Gomez",
"first_name": "Taylor",
"last_name": "Gomez",
"email_address": "tgo@example.net",
"gender": "female",
"locale": "es_MX",
"link": "http://www.facebook.com/100001724970193",
"timezone": -7,
"verified": true,
"birthday": "1989-11-09T00:00:00.000Z",
"picture_url": "http://pictures.example.org/8abdjw87fe677lko",
"friends_count": 75025
},
"twitter_profile": {
"twitter_id": "308061521170129",
"name": "Taylor Gomez",
"screen_name": "taygomz17711",
"time_zone": "America/Mexico_City",
"bio": "Rabblerouser, marathon runner, pole vaulter, senator",
"homepage": "senate.example.mx/taylor_gomez",
"location": "Antarctica",
"language": "es",
"utc_offset": -18000,
"statuses_count": 89,
"friends_count": 55,
"followers_count": 75025,
"favourites_count": 1597,
"listed_count": 13,
"is_translator": false,
"contributors_enabled": true,
"verified": true,
"geo_enabled": true,
"protected": false,
"picture_url": "http://pbs.twimg.com/profile_images/601898989899999900/DzBmLB0Y.png"
}
},
"purchase": {
"order_id": "PQZ-4181",
"coupon_code": "COUPON123456",
"date": "2017-04-01T11:07:40.904Z",
"total": 15.97,
"new_customer": "true",
"email": "adrian@example.fi",
"ip_address": "200.1.2.3",
"products": [
{
"sku": "99P88Q77R",
"quantity": 21,
"price": 319.99
}
],
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1",
"created_at": "2013-02-02T02:02:02.222220",
"recent_shares": [
{
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
],
"recent_referral_codes": [
{
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
}
]
}
}
},
"reminder_email": {
"id": 377,
"referral_code": "ux7Q",
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"created_at": "2017-01-13T19:18:38.239Z",
"sharer": null,
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
},
"referrer": {
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"email": "alex@example.ca",
"name": "Taylor Gomez",
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
},
"rewards": [
{
"id": 3181,
"status": "invalid",
"type": "fixed_cash",
"amount": 10,
"rejected_reasons": {
"same_customer": "same customer ID detected",
"same_email": "same email detected",
"fuzzy_email": "similar email detected"
},
"created_at": "2017-01-13T19:18:38.239Z",
"evaluate_at": "2017-01-13T19:20:38.211Z",
"conversion": {
"id": 121393,
"status": "paid",
"type": "share",
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"purchase": {
"order_id": "PQZ-4181",
"coupon_code": "COUPON123456",
"date": "2017-04-01T11:07:40.904Z",
"total": 15.97,
"new_customer": "true",
"email": "adrian@example.fi",
"ip_address": "200.1.2.3",
"products": [
{
"sku": "99P88Q77R",
"quantity": 21,
"price": 319.99
}
],
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
}
},
"detail_uri": "https://developer-api.friendbuy.com/v1/conversions/121393",
"created_at": "2016-03-01T19:12:38.239Z",
"possible_self_referral": true,
"fraud": {
"same_shopper": false,
"same_customer": false,
"same_email": false,
"same_ip_address": false,
"same_ip_and_user_agent": false,
"fuzzy_email": false,
"high_sensitivity_fuzzy_email": false
},
"reward": "null",
"personal_url": {
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
},
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
},
"reminder_email": {
"id": 377,
"referral_code": "ux7Q",
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"created_at": "2017-01-13T19:18:38.239Z",
"sharer": null,
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
},
"referrer": {
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"email": "alex@example.ca",
"name": "Taylor Gomez",
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
}
]
}
// To see live output, click the Try It button
Notifies Friendbuy that a purchase has occurred and is associated to a given referral code or coupon code. In addition to tracking the purchase in Friendbuy, posting to this endpoint will generate an an accompanying conversion.
Body Parameters
| referral_code** Refcode (just the string, not the entire object) that referred the friend to make the purchase. Required unless coupon_code is present. If both referral_code and coupon_code are provided, referral_code will take precedence. |
| coupon_code** Coupon code that brought the friend to the merchant to make the purchase. Required unless referral_code is present. |
| ip_address IP address of the purchaser. |
| order.id* Unique order id for the purchase. If this order id has been previously used, the request will fail with a 409 CONFLICT error and no new purchase (and no new conversion) will be created. |
| order.amount Amount of the order |
| order.email Email associated with the order |
| order.new_customer Whether or not the purchase is made by a new (first-time) customer. Used to check for reward eligibility, since Friendbuy allows merchants to state “must be a new customer” as one of the reward criteria. |
| customer.id The id you assigned to your customer (not the same as the internal Friendbuy-assigned id) |
| customer.first_name Customer first name |
| customer.last_name Customer last name |
| customer.email Email associated with the customer |
| customer.stripe_customer_id Stripe’s id for the customer |
| customer.chargebee_customer_id Chargebee’s id for the customer |
| products[0].sku Product SKU |
| products[0].quantity Number of units of the product that were purchased |
| products[0].price Amount of the order, in currency units |
* Required field
** At least one of these fields is required
Response Model
| Conversion | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id integer | Friendbuy internal id for this conversion | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| status string | One of unmarked, paid, or rejected | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type string | One of share, customer_personal_url, email_personal_url, or reminder_email | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| campaign object | Campaign for this reward (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| purchase object | Purchase triggering the conversion if any (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| detail_uri string | Friendbuy REST API resource for the conversion | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| created_at datetime | Conversion creation timestamp | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| possible_self_referral boolean | Whether the conversion may have come from an advocate using their own referral. This is done by comparing the data collected at time of a purchase to the data collected at time the share, PURL, or reminder email is generated. Note: this calculation is dependent on which fraud check settings have been enabled in the Friendbuy platform (specifically, the browser, customer id, email address, and IP address checks) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fraud object | Brief report on the presence or absence of various fraud conditions (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reward | Deprecated, always null | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| personal_url object | Present only if conversion was triggered from a PURL (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| share object | Present only if conversion was triggered from a share (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reminder_email object | Present only if conversion was triggered from a reminder email (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| referrer object | Information about the advocate creating the conversion (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rewards array | Rewards from this conversion, only present for top-level conversion queries and webhooks and never included for conversions are embedded within reward data (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GET /customers/{id}/conversions
- Example
- Try It
// Example Response (200 OK)
{
"offset": 20,
"this_page_results_count": 1,
"total_results_count": 21,
"results": [
{
"id": 121393,
"status": "paid",
"type": "share",
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"purchase": {
"order_id": "PQZ-4181",
"coupon_code": "COUPON123456",
"date": "2017-04-01T11:07:40.904Z",
"total": 15.97,
"new_customer": "true",
"email": "adrian@example.fi",
"ip_address": "200.1.2.3",
"products": [
{
"sku": "99P88Q77R",
"quantity": 21,
"price": 319.99
}
],
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
}
},
"detail_uri": "https://developer-api.friendbuy.com/v1/conversions/121393",
"created_at": "2016-03-01T19:12:38.239Z",
"possible_self_referral": true,
"fraud": {
"same_shopper": false,
"same_customer": false,
"same_email": false,
"same_ip_address": false,
"same_ip_and_user_agent": false,
"fuzzy_email": false,
"high_sensitivity_fuzzy_email": false
},
"reward": "null",
"personal_url": {
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
},
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
},
"reminder_email": {
"id": 377,
"referral_code": "ux7Q",
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"created_at": "2017-01-13T19:18:38.239Z",
"sharer": null,
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
},
"referrer": {
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"email": "alex@example.ca",
"name": "Taylor Gomez",
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
},
"rewards": [
{
"id": 3181,
"status": "invalid",
"type": "fixed_cash",
"amount": 10,
"rejected_reasons": {
"same_customer": "same customer ID detected",
"same_email": "same email detected",
"fuzzy_email": "similar email detected"
},
"created_at": "2017-01-13T19:18:38.239Z",
"evaluate_at": "2017-01-13T19:20:38.211Z",
"conversion": {
"id": 121393,
"status": "paid",
"type": "share",
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"purchase": {
"order_id": "PQZ-4181",
"coupon_code": "COUPON123456",
"date": "2017-04-01T11:07:40.904Z",
"total": 15.97,
"new_customer": "true",
"email": "adrian@example.fi",
"ip_address": "200.1.2.3",
"products": [
{
"sku": "99P88Q77R",
"quantity": 21,
"price": 319.99
}
],
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
}
},
"detail_uri": "https://developer-api.friendbuy.com/v1/conversions/121393",
"created_at": "2016-03-01T19:12:38.239Z",
"possible_self_referral": true,
"fraud": {
"same_shopper": false,
"same_customer": false,
"same_email": false,
"same_ip_address": false,
"same_ip_and_user_agent": false,
"fuzzy_email": false,
"high_sensitivity_fuzzy_email": false
},
"reward": "null",
"personal_url": {
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
},
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
},
"reminder_email": {
"id": 377,
"referral_code": "ux7Q",
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"created_at": "2017-01-13T19:18:38.239Z",
"sharer": null,
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
},
"referrer": {
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"email": "alex@example.ca",
"name": "Taylor Gomez",
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
}
]
}
]
}
// To see live output, click the Try It button
Retrieves a list of conversions for a specific customer.
Path Parameters
| id* Friendbuy-assigned internal id of the customer to lookup. This differs from the id you have assigned to the customer. Generally this endpoint is discovered by first performing a search at the /customers endpoint and then navigating via the detail_uri property of a search result. |
*Required field
Response Model
| ConversionExcerpt | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id integer | Friendbuy internal id for this conversion | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| status string | One of unmarked, paid, or rejected | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type string | One of share, customer_personal_url, email_personal_url, or reminder_email | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| campaign object | Campaign for this reward (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| purchase object | Purchase triggering the conversion if any (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| detail_uri string | Friendbuy REST API resource for the conversion | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| created_at datetime | Conversion creation timestamp | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| possible_self_referral boolean | Whether the conversion may have come from an advocate using their own referral. This is done by comparing the data collected at time of a purchase to the data collected at time the share, PURL, or reminder email is generated. Note: this calculation is dependent on which fraud check settings have been enabled in the Friendbuy platform (specifically, the browser, customer id, email address, and IP address checks) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fraud object | Brief report on the presence or absence of various fraud conditions (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reward | Deprecated, always null | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| personal_url object | Present only if conversion was triggered from a PURL (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| share object | Present only if conversion was triggered from a share (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reminder_email object | Present only if conversion was triggered from a reminder email (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| referrer object | Information about the advocate creating the conversion (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rewards array | Rewards from this conversion, only present for top-level conversion queries and webhooks and never included for conversions are embedded within reward data (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Rewards
A reward is an optional referral incentive triggered by a conversion. For each conversion occurence, Friendbuy will check whether the widget variant associated with the referral is configured with a reward. If a reward configuration was specified, Friendbuy will evaluate the conversion against the reward criteria and enabled fraud checks to determine if a reward should be approved. If the conversion passes all checks, the reward is approved. If not, the reward is marked rejected.
GET /customers/{id}/rewards
- Example
- Try It
// Example Response (200 OK)
{
"offset": 20,
"this_page_results_count": 1,
"total_results_count": 21,
"results": [
{
"id": 3181,
"status": "invalid",
"type": "fixed_cash",
"amount": 10,
"rejected_reasons": {
"same_customer": "same customer ID detected",
"same_email": "same email detected",
"fuzzy_email": "similar email detected"
},
"created_at": "2017-01-13T19:18:38.239Z",
"evaluate_at": "2017-01-13T19:20:38.211Z",
"conversion": {
"id": 121393,
"status": "paid",
"type": "share",
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"purchase": {
"order_id": "PQZ-4181",
"coupon_code": "COUPON123456",
"date": "2017-04-01T11:07:40.904Z",
"total": 15.97,
"new_customer": "true",
"email": "adrian@example.fi",
"ip_address": "200.1.2.3",
"products": [
{
"sku": "99P88Q77R",
"quantity": 21,
"price": 319.99
}
],
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
}
},
"detail_uri": "https://developer-api.friendbuy.com/v1/conversions/121393",
"created_at": "2016-03-01T19:12:38.239Z",
"possible_self_referral": true,
"fraud": {
"same_shopper": false,
"same_customer": false,
"same_email": false,
"same_ip_address": false,
"same_ip_and_user_agent": false,
"fuzzy_email": false,
"high_sensitivity_fuzzy_email": false
},
"reward": "null",
"personal_url": {
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
},
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
},
"reminder_email": {
"id": 377,
"referral_code": "ux7Q",
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"created_at": "2017-01-13T19:18:38.239Z",
"sharer": null,
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
},
"referrer": {
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"email": "alex@example.ca",
"name": "Taylor Gomez",
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
}
]
}
// To see live output, click the Try It button
Retrieves a list of rewards for a specific customer.
Path Parameters
| id* Friendbuy-assigned internal id of the customer to lookup. This differs from the id you have assigned to the customer. Generally this endpoint is discovered by first performing a search at the /customers endpoint and then navigating via the detail_uri property of a search result. |
*Required field
Response Model
| RewardExcerpt | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id integer | Friendbuy internal id for the reward | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| status string | One of pending, valid, or invalid | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type string | One of percent_discount, fixed_cash, fixed_points, stripe_credit or other | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| amount number | Amount of the reward in units of the reward type | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rejected_reasons object | object describing the self-referral and reward criteria that triggered the reward to be rejected | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| created_at datetime | Timestamp at which the reward was created | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| evaluate_at datetime | Timestamp at which the reward validity was evaluated | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| conversion object | Conversion of the reward (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Email Opt Outs
Friendbuy maintains a list of email addresses for users who have opted out of receiving referral-related email communications from Friendbuy on behalf of your company. This list is always cross-referenced prior to sending emails from our system. For information about integrating Friendbuy with your own API endpoint, please refrer to the Email Recipient Authorization.
GET /opt_outs/emails
- Example
- Try It
// Example Response (200 OK)
{
"offset": 20,
"this_page_results_count": 1,
"total_results_count": 21,
"results": [
{
"id": 19,
"email": "delia@example.net",
"ip_address": "8.8.8.8",
"source": "upload",
"created_at": "2017-01-13T12:11:45.736234-08:00"
}
]
}
// To see live output, click the Try It button
Retrieves a list of opted-out email addresses.
Query Parameters
| offset Zero-based index of the first result to appear on the results page |
| limit Maximum number of results to return for the page |
| from_date First date of range (YYYY-MM-DD, inclusive) |
| to_date Last date of range (YYYY-MM-DD, inclusive) |
Response Model
| EmailOptOut | |
|---|---|
| id integer | Id of the opt out record |
| email string | Email address on the opt out list |
| ip_address string | IP address associated with the opt out |
| source string | Source of the opt_out_list, either share if the opt out was made from a share widget, or upload if part of an uploaded opt out list |
| created_at datetime | Datetime at which the opt out was recorded |
POST /opt_outs/emails
- Example
- Try It
// Example Request Body
{
"emails": [
"pele@example.br, messi@example.ar, neuer@example.de"
]
}
// Example Response (202 ACCEPTED)
{
"message": "Processing 3 emails to the opt out list",
"update_id": 7
}
// To see live output, click the Try It button
In addition to allowing users to opt out through an unsubscribe link in email shares, you can upload a list of email addresses that is maintained by your company.
Body Parameters
| emails* Array of email addresses to opt out (enter as a comma-separated list to try out) |
* Required field
Response Model
| EmailOptOutJobSubmissionResponse | |
|---|---|
| message string | Feedback from the job submission |
| update_id integer | Id of the created job |
GET /opt_outs/email_update/{id}
- Example
- Try It
// Example Response (200 OK)
{
"id": 15,
"filename": "/tmp/907bf7ce2211aa",
"status": "Success",
"total_items_count": 89,
"updated_items_count": 55,
"failure_reason": "",
"created_at": "2017-01-13T11:58:45.467054",
"last_modified_at": "2017-01-13T11:58:45.467054"
}
// To see live output, click the Try It button
Retrieves the status of a request to the POST /opt_outs/emails endpoint.
Path Parameters
| id* Id of the email optout job to check |
*Required field
Response Model
| EmailOptOutJob | |
|---|---|
| id integer | Opt out job id |
| filename string | Filename |
| status string | One of Success, Failed, or In Progress |
| total_items_count integer | |
| updated_items_count integer | |
| failure_reason string | Failure reason |
| created_at datetime | Datetime of job creation (missing time zone) |
| last_modified_at datetime | Datetime of last modification (missing time zone) |
Newsletter Opt Ins
Selected Friendbuy widgets enable users to opt in to receiving future newsletter communications from your company.
GET /newsletter_opt_ins
- Example
- Try It
// Example Response (200 OK)
{
"offset": 20,
"this_page_results_count": 1,
"total_results_count": 21,
"results": [
"pele@example.br"
]
}
// To see live output, click the Try It button
Retrieves the list of email addresses that have opted in to receiving newsletter emails
Query Parameters
| offset Zero-based index of the first result to appear on the results page |
| limit Maximum number of results to return for the page |
| from_date First date of range (YYYY-MM-DD, inclusive) |
| to_date Last date of range (YYYY-MM-DD, inclusive) |
| campaign Id of the campaign to be searched (can be found on the widget detail page of your Friendbuy dashboard, or via a search at the GET /campaigns endpoint) |
Response Model
| NewsletterOptInSearchResults | |
|---|---|
| offset integer | Zero-based index of first result on this page in the entirety of all results |
| this_page_results_count integer | Number of results on this page |
| total_results_count integer | Total number of search results across all pages |
| results array | Array of search results |
Communication Emails
Communication emails are targeted communications to your customers which include either transactional or promotional content. The below endpoints provide a programatic way to select the appropriate content and request an email be sent.
GET /communication_email_templates
- Example
- Try It
// Example Response (200 OK)
{
"offset": 20,
"this_page_results_count": 1,
"total_results_count": 21,
"results": [
{
"id": 1,
"name": "Refer a friend promotional email template",
"email_type": "communication_promotional",
"created_at": "2017-01-13T12:11:45.736234-08:00"
}
]
}
// To see live output, click the Try It button
Retrieves a list of communication email templates.
Query Parameters
| offset Zero-based index of the first result to appear on the results page |
| limit Maximum number of results to return for the page |
Response Model
| CommunicationEmailTemplates | |
|---|---|
| id integer | Communication email template ID |
| name string | Name of the email template |
| email_type string | One of `communication_promotional` or `communication_transactional` |
| created_at datetime | Datetime at which the email template was recorded |
GET /coupon_banks
- Example
- Try It
// Example Response (200 OK)
{
"offset": 20,
"this_page_results_count": 1,
"total_results_count": 21,
"results": [
{
"id": 1,
"name": "Fall promotion",
"description": "Coupons for fall promotion",
"total_coupons": 400,
"coupons_remaining": 385
}
]
}
// To see live output, click the Try It button
Retrieves a list of coupon banks.
Query Parameters
| offset Zero-based index of the first result to appear on the results page |
| limit Maximum number of results to return for the page |
Response Model
| CouponBanks | |
|---|---|
| id integer | Coupon bank ID |
| name string | Name of the coupon bank |
| description string | Description of the coupon bank |
| total_coupons integer | Total number of coupons in the coupon bank |
| coupons_remaining integer | Total number of coupons remaining in the coupon bank |
POST /communication_emails
- Example
- Try It
// Example Request Body
{
"email_addresses": [
"alex@example.ca",
"jzheng@example.mil"
],
"email_template_id": 1,
"coupon_bank_id": 1
}
// Example Response (202 ACCEPTED)
{
"message": "processing 10 communication emails"
}
// To see live output, click the Try It button
Send a communication email to a list of recipients.
Body Parameters
| email_addresses Array of up to 10 email addresses (enter as a comma-separated list to try out) |
| email_template_id ID of communication email template to be used |
| coupon_bank_id ID of coupon bank to be used (must contain at least as many coupons remaining as email addresses specified) |
* Required field
Response Model
| CommunicationEmails | |
|---|---|
| message string | Message indicating success or failure for the request |
Webhooks
Friendbuy’s webhooks provide real-time notifications to your system based on data created by a referral program. Use webhooks to:
- Deposit credit into an advocate’s account after a successful conversion and reward evaluation
- Aggregate real-time data on referral program activity
- Perform actions in your system based on referral program activity, such as the recording of events in a CRM
Each available webhook is documented below. For each webhook, a complete technical specification of the data model is provided in the center pane. The right-hand pane contains an example of such a JSON request.
Share Webhook
Example Post Body for Webhook
{
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
A share occurs when an advocate refers a friend directly through a Friendbuy widget. The share will be associated to a specific channel, such as email, Facebook, or Twitter.
After a successful share, Friendbuy will send a POST request to your system with data about the share. Share webhooks are triggered only in response to direct shares, and not to dissemination of a Personal URL (PURL).
Request Model
| ShareExcerpt | |||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id integer | Friendbuy internal id for this share | ||||||||||||||||||||||||||||||||||
| referral_code string | Short alphanumeric code | ||||||||||||||||||||||||||||||||||
| message object | Message sent along with share (Expand) | ||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||
| campaign object | Campaign that is being shared (Expand) | ||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||
| ip_address string | IP address of the share | ||||||||||||||||||||||||||||||||||
| newsletter_opt_in boolean | Whether a newsletter opt in should take place with the share | ||||||||||||||||||||||||||||||||||
| send_reminder boolean | Whether a reminder should be sent for the share | ||||||||||||||||||||||||||||||||||
| created_at datetime | Share creation timestamp | ||||||||||||||||||||||||||||||||||
| detail_uri string | URI endpoint at which to get full details of the share | ||||||||||||||||||||||||||||||||||
| email_recipients array | JSON-formatted array of recipients for the share, present only if (1) the share is an email share and (2) the merchant is permitted to access this information (*Contact Friendbuy to inquire about the ability to access the recipient list*) | ||||||||||||||||||||||||||||||||||
| sharer object | Information for the entity making the share (Expand) | ||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||
Email Capture Webhook
Example Post Body for Webhook
{
"id": 362752,
"email_address": "jwu@gmail.com",
"coupon_code": "BOGO-8910",
"custom_properties": {
"birthdate": "1969-07-28",
"tel": "343-555-8680",
"zipcode": "45678"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"created_at": "2018-02-21T19:12:38.239Z",
"referrer": {
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"email": "alex@example.ca",
"name": "Taylor Gomez",
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
},
"referral_code": "uxC",
"newsletter_opt_in": true,
"ip_address": "8.8.8.8",
"purchase_history_validation_passed": false
}
An email capture event occurs when a referred friend or site visitor submits their email address through an email capture widget.
After a successful email capture, Friendbuy will send a POST request to your system with data about the email capture, the visitor, and offer (if applicable). If the visitor is a referred friend, details about the referring advocate will also be included.
Request Model
| EmailCaptureExcerpt | |||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id integer | Friendbuy internal id for this email capture | ||||||||||||||||||||||||||||||||||
| email_address string | The email address that was captured | ||||||||||||||||||||||||||||||||||
| coupon_code string | The coupon code that was provided after email capture, if given | ||||||||||||||||||||||||||||||||||
| custom_properties object | Additional data collected by the email capture widget | ||||||||||||||||||||||||||||||||||
| campaign object | Campaign for this email capture (Expand) | ||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||
| created_at datetime | Email capture creation timestamp | ||||||||||||||||||||||||||||||||||
| referrer object | Information about the advocate who referred the email capture (Expand) | ||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||
| referral_code string | Short alphanumeric code (e.g., uxC) | ||||||||||||||||||||||||||||||||||
| newsletter_opt_in boolean | Whether a newsletter opt in should take place with the email capture | ||||||||||||||||||||||||||||||||||
| ip_address string | IP address associated with the email capture | ||||||||||||||||||||||||||||||||||
| purchase_history_validation_passed boolean | Indicates if Friendbuy has already recorded a purchase associated with the email address provided by the visitor. This property is only included in the payload for email capture widgets that have this validation check enabled. | ||||||||||||||||||||||||||||||||||
Conversion Webhook
Example Post Body for Webhook
{
"id": 121393,
"status": "paid",
"type": "share",
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"purchase": {
"order_id": "PQZ-4181",
"coupon_code": "COUPON123456",
"date": "2017-04-01T11:07:40.904Z",
"total": 15.97,
"new_customer": "true",
"email": "adrian@example.fi",
"ip_address": "200.1.2.3",
"products": [
{
"sku": "99P88Q77R",
"quantity": 21,
"price": 319.99
}
],
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
}
},
"detail_uri": "https://developer-api.friendbuy.com/v1/conversions/121393",
"created_at": "2016-03-01T19:12:38.239Z",
"possible_self_referral": true,
"fraud": {
"same_shopper": false,
"same_customer": false,
"same_email": false,
"same_ip_address": false,
"same_ip_and_user_agent": false,
"fuzzy_email": false,
"high_sensitivity_fuzzy_email": false
},
"reward": "null",
"personal_url": {
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
},
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
},
"reminder_email": {
"id": 377,
"referral_code": "ux7Q",
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"created_at": "2017-01-13T19:18:38.239Z",
"sharer": null,
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
},
"referrer": {
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"email": "alex@example.ca",
"name": "Taylor Gomez",
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
},
"rewards": [
{
"id": 3181,
"status": "invalid",
"type": "fixed_cash",
"amount": 10,
"rejected_reasons": {
"same_customer": "same customer ID detected",
"same_email": "same email detected",
"fuzzy_email": "similar email detected"
},
"created_at": "2017-01-13T19:18:38.239Z",
"evaluate_at": "2017-01-13T19:20:38.211Z",
"conversion": {
"id": 121393,
"status": "paid",
"type": "share",
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"purchase": {
"order_id": "PQZ-4181",
"coupon_code": "COUPON123456",
"date": "2017-04-01T11:07:40.904Z",
"total": 15.97,
"new_customer": "true",
"email": "adrian@example.fi",
"ip_address": "200.1.2.3",
"products": [
{
"sku": "99P88Q77R",
"quantity": 21,
"price": 319.99
}
],
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
}
},
"detail_uri": "https://developer-api.friendbuy.com/v1/conversions/121393",
"created_at": "2016-03-01T19:12:38.239Z",
"possible_self_referral": true,
"fraud": {
"same_shopper": false,
"same_customer": false,
"same_email": false,
"same_ip_address": false,
"same_ip_and_user_agent": false,
"fuzzy_email": false,
"high_sensitivity_fuzzy_email": false
},
"reward": "null",
"personal_url": {
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
},
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
},
"reminder_email": {
"id": 377,
"referral_code": "ux7Q",
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"created_at": "2017-01-13T19:18:38.239Z",
"sharer": null,
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
},
"referrer": {
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"email": "alex@example.ca",
"name": "Taylor Gomez",
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
}
]
}
A conversion occurs when (1) Friendbuy is notified of a purchase and (2) we are able to associate to that purchase to an advocate’s referral via the referral code or coupon code provided to their friend.
You can notify Friendbuy of a purchase through a Track Order call via the Friendbuy JavaScript embedded on your site, or through the POST /purchases endpoint.
After a successful conversion, Friendbuy will send a POST request to your system containing data about the conversion.
Request Model
| ConversionExcerpt | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id integer | Friendbuy internal id for this conversion | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| status string | One of unmarked, paid, or rejected | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type string | One of share, customer_personal_url, email_personal_url, or reminder_email | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| campaign object | Campaign for this reward (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| purchase object | Purchase triggering the conversion if any (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| detail_uri string | Friendbuy REST API resource for the conversion | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| created_at datetime | Conversion creation timestamp | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| possible_self_referral boolean | Whether the conversion may have come from an advocate using their own referral. This is done by comparing the data collected at time of a purchase to the data collected at time the share, PURL, or reminder email is generated. Note: this calculation is dependent on which fraud check settings have been enabled in the Friendbuy platform (specifically, the browser, customer id, email address, and IP address checks) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fraud object | Brief report on the presence or absence of various fraud conditions (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reward | Deprecated, always null | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| personal_url object | Present only if conversion was triggered from a PURL (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| share object | Present only if conversion was triggered from a share (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reminder_email object | Present only if conversion was triggered from a reminder email (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| referrer object | Information about the advocate creating the conversion (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rewards array | Rewards from this conversion, only present for top-level conversion queries and webhooks and never included for conversions are embedded within reward data (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Reward Webhook
Example Post Body for Webhook
{
"id": 3181,
"status": "invalid",
"type": "fixed_cash",
"amount": 10,
"rejected_reasons": {
"same_customer": "same customer ID detected",
"same_email": "same email detected",
"fuzzy_email": "similar email detected"
},
"created_at": "2017-01-13T19:18:38.239Z",
"evaluate_at": "2017-01-13T19:20:38.211Z",
"conversion": {
"id": 121393,
"status": "paid",
"type": "share",
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"purchase": {
"order_id": "PQZ-4181",
"coupon_code": "COUPON123456",
"date": "2017-04-01T11:07:40.904Z",
"total": 15.97,
"new_customer": "true",
"email": "adrian@example.fi",
"ip_address": "200.1.2.3",
"products": [
{
"sku": "99P88Q77R",
"quantity": 21,
"price": 319.99
}
],
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
}
},
"detail_uri": "https://developer-api.friendbuy.com/v1/conversions/121393",
"created_at": "2016-03-01T19:12:38.239Z",
"possible_self_referral": true,
"fraud": {
"same_shopper": false,
"same_customer": false,
"same_email": false,
"same_ip_address": false,
"same_ip_and_user_agent": false,
"fuzzy_email": false,
"high_sensitivity_fuzzy_email": false
},
"reward": "null",
"personal_url": {
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
},
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
},
"reminder_email": {
"id": 377,
"referral_code": "ux7Q",
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"created_at": "2017-01-13T19:18:38.239Z",
"sharer": null,
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
},
"referrer": {
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"email": "alex@example.ca",
"name": "Taylor Gomez",
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
}
A reward is an optional referral incentive that is triggered by a conversion. For each conversion that occurs, Friendbuy will check whether the widget variant associated to the referral is configured with a reward. If a reward configuration was specified, Friendbuy will then evaluate the conversion against the reward criteria and enabled fraud checks to determine if a reward should be approved. If the conversion passes all checks, the reward is approved. If not, the reward is considered to be rejected.
The reward webhook is the preferred method for depositing credit or points into an advocate’s account in your system.
After a reward is evaluated, Friendbuy will send a POST request to your system with data about the reward and associated conversion.
Request Model
| RewardExcerpt | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id integer | Friendbuy internal id for the reward | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| status string | One of pending, valid, or invalid | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type string | One of percent_discount, fixed_cash, fixed_points, stripe_credit or other | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| amount number | Amount of the reward in units of the reward type | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rejected_reasons object | object describing the self-referral and reward criteria that triggered the reward to be rejected | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| created_at datetime | Timestamp at which the reward was created | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| evaluate_at datetime | Timestamp at which the reward validity was evaluated | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| conversion object | Conversion of the reward (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Unsubscribe Webhook
Example Post Body for Webhook
{
"id": 14232,
"email": "rapinoe@example.us",
"source": "share",
"ip_address": "8.8.8.8",
"created_at": "2019-01-13T19:18:38.239Z",
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1",
"created_at": "2013-02-02T02:02:02.222220",
"recent_shares": [
{
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
],
"recent_referral_codes": [
{
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
}
]
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09",
"facebook_profile": {
"facebook_id": "100001724970193",
"name": "Taylor Gomez",
"first_name": "Taylor",
"last_name": "Gomez",
"email_address": "tgo@example.net",
"gender": "female",
"locale": "es_MX",
"link": "http://www.facebook.com/100001724970193",
"timezone": -7,
"verified": true,
"birthday": "1989-11-09T00:00:00.000Z",
"picture_url": "http://pictures.example.org/8abdjw87fe677lko",
"friends_count": 75025
},
"twitter_profile": {
"twitter_id": "308061521170129",
"name": "Taylor Gomez",
"screen_name": "taygomz17711",
"time_zone": "America/Mexico_City",
"bio": "Rabblerouser, marathon runner, pole vaulter, senator",
"homepage": "senate.example.mx/taylor_gomez",
"location": "Antarctica",
"language": "es",
"utc_offset": -18000,
"statuses_count": 89,
"friends_count": 55,
"followers_count": 75025,
"favourites_count": 1597,
"listed_count": 13,
"is_translator": false,
"contributors_enabled": true,
"verified": true,
"geo_enabled": true,
"protected": false,
"picture_url": "http://pbs.twimg.com/profile_images/601898989899999900/DzBmLB0Y.png"
}
},
"purchase": {
"order_id": "PQZ-4181",
"coupon_code": "COUPON123456",
"date": "2017-04-01T11:07:40.904Z",
"total": 15.97,
"new_customer": "true",
"email": "adrian@example.fi",
"ip_address": "200.1.2.3",
"products": [
{
"sku": "99P88Q77R",
"quantity": 21,
"price": 319.99
}
],
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1",
"created_at": "2013-02-02T02:02:02.222220",
"recent_shares": [
{
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
],
"recent_referral_codes": [
{
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
}
]
}
}
}
}
An unsubscrive occurs when (1) a user clicks on the unsubscribe link included in all share emails, (2) an email is included in an opt-out file uploaded to the Friendbuy platform or through the REST API, or (3) a user clicks on the unsubscribe link contained in all promotional communication emails.
The unsubscribe webhook can be used to update your master opt-out list with all users who unsubscribe from friendbuy emails.
After a successful unsubscribe, Friendbuy will send a POST request to your system containing data about the unsubscribe.
Request Model
| UnsubscribeExcerpt | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id integer | Friendbuy internal id for the unsubscribe event | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| email string | The email address that has unsubscribed | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| source string | The source of the unsubscribe. One of 'share', 'upload', or 'communication_promotional' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ip_address string | IP address associated with the unsubscribe | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| created_at datetime | Timestamp at which the unsubscribe was created | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| campaign object | The campaign associated with the unsubscribe. Only present if the source is 'share' (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| share object | The share associated with the unsubscrib, if any. Only present if the source is 'share' (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Client API Integrations
Friendbuy can integrate with your system to request supplemental instructions in real time prior to sending shares or approving rewards.
Email Recipient Authorization
Example Request
[
"messi@example.ar",
"pele@example.br",
"zico@example.br",
"maradonna@example.ar"
]
Example Response
[
"pele@example.br",
"maradonna@example.ar"
]
Before sending a email share, Friendbuy can check your system to see if the email addresses listed in the share are authorized to receive emails from your company. This can be used to supplement the Friendbuy-maintained opt-out list. Friendbuy’s list contains email addresses that have opted out through a previous shared email, through an upload of email addresses in the Friendbuy platform, or via the REST API.
To enable this feature, provide the URL of your HTTPS POST endpoint to your Friendbuy Customer Success Manager.
If enabled, the integration works as follows:
- Using your provided endpoint, Friendbuy will request real-time authorization to share with the addresses entered by an advocate into a Referral and Sharing widget. The intended recipient email addresses are contained in the HTTPS POST body as a JSON string array.
- Your API will repsond with the email addresses that are authorized to receive emails. In the case of an opt-out list, your API should return the email addresses that are not in the opt-out list.
- Friendbuy will send share emails to all addresses returned in your response. Addresses in the request that are not included in the response will be excluded from the share.
- A response with status code 200 containing a JSON array of acceptable addresses is expected. Retries will be made according to the Friendbuy retry protocol.
Request Headers
| Header | Description |
|---|---|
| X-FRIENDBUY-SIGNATURE | Request body signature |
Custom Reward Validation
Example Post Body
{
"id": 121393,
"status": "paid",
"type": "share",
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"purchase": {
"order_id": "PQZ-4181",
"coupon_code": "COUPON123456",
"date": "2017-04-01T11:07:40.904Z",
"total": 15.97,
"new_customer": "true",
"email": "adrian@example.fi",
"ip_address": "200.1.2.3",
"products": [
{
"sku": "99P88Q77R",
"quantity": 21,
"price": 319.99
}
],
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
}
},
"detail_uri": "https://developer-api.friendbuy.com/v1/conversions/121393",
"created_at": "2016-03-01T19:12:38.239Z",
"possible_self_referral": true,
"fraud": {
"same_shopper": false,
"same_customer": false,
"same_email": false,
"same_ip_address": false,
"same_ip_and_user_agent": false,
"fuzzy_email": false,
"high_sensitivity_fuzzy_email": false
},
"reward": "null",
"personal_url": {
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
},
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1",
"created_at": "2013-02-02T02:02:02.222220",
"recent_shares": [
{
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
],
"recent_referral_codes": [
{
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
}
]
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09",
"facebook_profile": {
"facebook_id": "100001724970193",
"name": "Taylor Gomez",
"first_name": "Taylor",
"last_name": "Gomez",
"email_address": "tgo@example.net",
"gender": "female",
"locale": "es_MX",
"link": "http://www.facebook.com/100001724970193",
"timezone": -7,
"verified": true,
"birthday": "1989-11-09T00:00:00.000Z",
"picture_url": "http://pictures.example.org/8abdjw87fe677lko",
"friends_count": 75025
},
"twitter_profile": {
"twitter_id": "308061521170129",
"name": "Taylor Gomez",
"screen_name": "taygomz17711",
"time_zone": "America/Mexico_City",
"bio": "Rabblerouser, marathon runner, pole vaulter, senator",
"homepage": "senate.example.mx/taylor_gomez",
"location": "Antarctica",
"language": "es",
"utc_offset": -18000,
"statuses_count": 89,
"friends_count": 55,
"followers_count": 75025,
"favourites_count": 1597,
"listed_count": 13,
"is_translator": false,
"contributors_enabled": true,
"verified": true,
"geo_enabled": true,
"protected": false,
"picture_url": "http://pbs.twimg.com/profile_images/601898989899999900/DzBmLB0Y.png"
}
},
"purchase": {
"order_id": "PQZ-4181",
"coupon_code": "COUPON123456",
"date": "2017-04-01T11:07:40.904Z",
"total": 15.97,
"new_customer": "true",
"email": "adrian@example.fi",
"ip_address": "200.1.2.3",
"products": [
{
"sku": "99P88Q77R",
"quantity": 21,
"price": 319.99
}
],
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1",
"created_at": "2013-02-02T02:02:02.222220",
"recent_shares": [
{
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
],
"recent_referral_codes": [
{
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
}
]
}
}
},
"reminder_email": {
"id": 377,
"referral_code": "ux7Q",
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"created_at": "2017-01-13T19:18:38.239Z",
"sharer": null,
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
},
"referrer": {
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"email": "alex@example.ca",
"name": "Taylor Gomez",
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
},
"rewards": [
{
"id": 3181,
"status": "invalid",
"type": "fixed_cash",
"amount": 10,
"rejected_reasons": {
"same_customer": "same customer ID detected",
"same_email": "same email detected",
"fuzzy_email": "similar email detected"
},
"created_at": "2017-01-13T19:18:38.239Z",
"evaluate_at": "2017-01-13T19:20:38.211Z",
"conversion": {
"id": 121393,
"status": "paid",
"type": "share",
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"purchase": {
"order_id": "PQZ-4181",
"coupon_code": "COUPON123456",
"date": "2017-04-01T11:07:40.904Z",
"total": 15.97,
"new_customer": "true",
"email": "adrian@example.fi",
"ip_address": "200.1.2.3",
"products": [
{
"sku": "99P88Q77R",
"quantity": 21,
"price": 319.99
}
],
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
}
},
"detail_uri": "https://developer-api.friendbuy.com/v1/conversions/121393",
"created_at": "2016-03-01T19:12:38.239Z",
"possible_self_referral": true,
"fraud": {
"same_shopper": false,
"same_customer": false,
"same_email": false,
"same_ip_address": false,
"same_ip_and_user_agent": false,
"fuzzy_email": false,
"high_sensitivity_fuzzy_email": false
},
"reward": "null",
"personal_url": {
"referral_code": "uxC",
"trackable_link": "http://fbuy.me/uxC",
"destination_url": "http://mycompany.example.com/rewards/908",
"referral_code_blacklisted": true
},
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
},
"reminder_email": {
"id": 377,
"referral_code": "ux7Q",
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"created_at": "2017-01-13T19:18:38.239Z",
"sharer": null,
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
},
"referrer": {
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"email": "alex@example.ca",
"name": "Taylor Gomez",
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
}
}
]
}
The custom reward validation integration allows you to add custom criteria to determine whether or not Friendbuy should fulfill a reward to an advocate. Example use cases for this integration include checking for returns or cancellations, checking that a referred friend has remained a customer after a trial period, or performing additional fraud checks. It is best used with a reward delay, which is configured for a Referral and Sharing widget. The reward delay will postpone the processing of a reward until a set number of days has passed, at which point the reward will be evaluated against criteria set in the Referral and Sharing widget.
To enable the feature, enter the validation URL in the Reward Criteria section of the appropriate Referral and Sharing widgets.
When enabled, the integration works as follows:
- After Friendbuy has evaluated the reward against the preconfigured reward criteria and fraud checks, and the specified reward delay period has passed, we will request validation for a pending reward with a signed HTTPS POST request to your designated endpoint.
- The request body will include details about the conversion event, such as the referrer, purchase date, order id, and more.
- An HTTP response code between 200 and 299 inclusive will validate the reward and instruct Friendbuy to issue the reward. Any other status code will indicate the reward is invalid. Retries are made according to the Friendbuy retry protocol. If no successful response is received within the 24-hour retry period, the reward will be considered invalid.
Request Headers
| Header | Description |
|---|---|
| X-FRIENDBUY-SIGNATURE-V2 | Request body signature |
Request Model
| Conversion | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id integer | Friendbuy internal id for this conversion | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| status string | One of unmarked, paid, or rejected | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type string | One of share, customer_personal_url, email_personal_url, or reminder_email | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| campaign object | Campaign for this reward (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| purchase object | Purchase triggering the conversion if any (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| detail_uri string | Friendbuy REST API resource for the conversion | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| created_at datetime | Conversion creation timestamp | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| possible_self_referral boolean | Whether the conversion may have come from an advocate using their own referral. This is done by comparing the data collected at time of a purchase to the data collected at time the share, PURL, or reminder email is generated. Note: this calculation is dependent on which fraud check settings have been enabled in the Friendbuy platform (specifically, the browser, customer id, email address, and IP address checks) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fraud object | Brief report on the presence or absence of various fraud conditions (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reward | Deprecated, always null | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| personal_url object | Present only if conversion was triggered from a PURL (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| share object | Present only if conversion was triggered from a share (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reminder_email object | Present only if conversion was triggered from a reminder email (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| referrer object | Information about the advocate creating the conversion (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rewards array | Rewards from this conversion, only present for top-level conversion queries and webhooks and never included for conversions are embedded within reward data (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Embedded JavaScript
Friendbuy supports web application integration through JavaScript embedded on your website. This JavaScript enables functionality such as loading widgets, tracking customers, tracking products, tracking purchases, checking the status of a user visiting your site, and more.
Required Code
At a minimum, there are three JavaScript snippets that must be included on your site to enable Friendbuy’s referral functionality. These three snippets are Friendbuy’s JavaScript Library import code, Site Identification code, and Command Queue code.
To grab these three snippets with your specific site id and include them on your website, please follow these steps.
- Log into to Friendbuy.
- Navigate to Settings > Integration Code.
- Add the code on every page of your website. For most web sites, this is accomplished by pasting the snippet once, immediately after your opening <head> tag, which should then make integration with Friendbuy available across all pages, secure and non-secure.
Beyond the required code, the next three most important snippets to include on your website so that your referral program runs smoothly are Customer Tracking, Order Tracking and Widget Installation. You will find further integration instructions in each respective section below.
Although not required, we strongly recommend that you include the Customer Tracking code snippet on all pages along with the above three mandatory snippets.
Library
(function (f, r, n, d, b, y) {
b = f.createElement(r), y = f.getElementsByTagName(r)[0];b.async = 1;b.src = n;y.parentNode.insertBefore(b, y);
})(document, 'script', '//djnf6e5yyirys.cloudfront.net/js/friendbuy.min.js');
The library is the file with the implementation that executes the commands pushed into the Command Queue. This code is injected into the page asynchronously so that it doesn't block other page elements hosted on your website such as images, JavaScript, or CSS.
Additionally, the library enables Friendbuy to cookie users for referral tracking and pooling for widget A/B testing.
Command Queue
Interaction with the library takes place through a JavaScript array assigned to the top-level namespace (i.e., window), which serves as a queue for your commands — an approach similar to that of Google Analytics. You can add commands to the array by calling the push() method with an “instruction” as its sole argument.
window['friendbuy'] = window['friendbuy'] || [];
window['friendbuy'].push([command, target, ...additional_arguments]);
Five commands are supported:
| Command | Purpose | Description |
|---|---|---|
site |
Account Identification | Identify your account with your site key. |
track |
Data Tracking | Provide information about users, purchases, and products that will be available to widgets on the page, giving you control over what the widgets display or share. |
widget |
Widget Configuration | Add a widget to a page and specify its placement and other settings. |
subscribe |
Event Handling | Register callbacks for actions performed by a user on a widget, such as opening or closing a widget, or completing a share. |
invoke |
Command Invocation | Invoke additional Friendbuy services. |
Site Identification, which includes the site key, must precede all other Friendbuy direction. The order in which you specify additional commands is somewhat flexible, though you do need to push subscribe commands after all widgets have been placed and configured.
Each command that can be added to the array is described in the sections below.
Site Identification
window['friendbuy'].push(['site', 'site-d2a64238-www.example.com']);
The ['site', siteKey] command is used to identify your account in our platform so we can properly attribute referral data. You can find your site key in the in Friendbuy web application at Settings > Integration Code.
Tracking
The track command is used to send customer, order, and product data to Friendbuy.
Customer Tracking
window['friendbuy'].push(['track', 'customer', {
"id": "C-7896751",
"email": "alexc@example.org",
"first_name": "Alex",
"last_name": "Chu",
"stripe_customer_id": "cus_8QEiAlcRfEPMOh",
"chargebee_customer_id": "djkl23jfdkslf"
}]);
You can pass Friendbuy unique information about a customer such as id, email address, and name. This information enables a more seamless integration with your referral program, allowing Friendbuy to auto-populate widget fields, as well as tie referral activity to specific customers as they are defined in your system.
The ['track', 'customer', customerDetail] command instructs Friendbuy to track a customer in this session. The customer detail is an object with the following properties:
| Property | Type | Required | Description |
|---|---|---|---|
| id | string | Y | Your identifier for associating a user with a share or a purchase |
| string | N | Email address of the customer. Widgets will automatically populate the from field when sharing through email when email is present. This value is stored for use in fraud checking. The stored value will be updated if a new email address is included for a known customer id | |
| first_name | string | N | First name of the customer. This value will be stored and used in the future to facilitate personalization of widgets and communication. The stored value will be updated if a new value is included for a known customer id |
| last_name | string | N | Last name of the customer. This value will be stored and used in the future to facilitate personalization of widgets and communication. The stored value will be updated if a new value is included for a known customer id |
| stripe_customer_id | string | N | The id of the customer within Stripe, if known |
| chargebee_customer_id | string | N | The id of the customer within Chargebee, if known |
If providing a customer id, we will check if there is an existing customer record in Friendbuy. If so, the record will be updated with any new information specified in the request body. If no customer record exists, a new one will be created.
Order Tracking
window['friendbuy'].push(['track', 'order', {
"id": "0382138317",
"amount": "325.94",
"coupon_code": "C3333",
"new_customer": false,
"email": "sam@example.org"
}]);
When notifying Friendbuy of an order, we will automatically use the cookie (if present) or coupon code (if provided in the order tracking call) to establish attribution back to a referral. If attribution is established, a conversion will be generated in Friendbuy’s system. The attribution ties both the advocate and friend to the order.
To grab the order tracking snippet and it include it on your website, please follow these steps: 1. Log into to Friendbuy. 1. Navigate to Settings > Integration Code. 1. Add the code on your conversion event page (most commonly, the Order Confirmation page) by pasting the snippet in your document <head>, just under the Site Identification code.
The ['track', 'order', orderDetail] command instructs Friendbuy to track an order in this session. The order detail parameter is an object with the following properties:
| Property | Type | Required | Description |
|---|---|---|---|
| id | string | Y | Configure this property so that a unique value is provided to Friendbuy for every order. A common example of this is an Order Number or Transaction ID. If your conversion event is something other than a purchase (e.g., signups, registrations), you can pass a variable that provides us with a unique value for that event, such as a Sign Up ID. |
| amount | string | N | The amount in currency units of the order |
| coupon_code | string | N | A coupon code used with the order. This can allow us to track a purchase back to a referral if purchaser does not have our tracking cookie present |
| new_customer | boolean | N | Whether the order was made by a new customer (true) or an existing customer (false) |
| string | N | The email address of the person making the order. Used by Friendbuy for fraud detection |
Product Tracking
window['friendbuy'].push(['track', 'products', [
{
"sku": "Z-4083",
"price": "28.00",
"quantity": "2"
}
]]);
In addition to notifying Friendbuy that an order has taken place, you can also let us know what products were included. The product properties can even be used to indicate other details about an order, for example, the product may be an introductory sign up.
The ['track', 'products', listOfProducts] command instructs Friendbuy to track a list of products in this session. Each product in the listOfProducts array parameter is an object with the following properties:
| Property | Type | Required | Description |
|---|---|---|---|
| sku | string | Y | An identifier for a purchased product |
| price | string | N | The price of the product |
| quantity | string | N | Number of units of the product that were purchased |
Widget Management
Use the widget command to place widgets on your web page and control configuration, and include additional options. You may issue the widget command multiple times, once for each Friendbuy widget that you would like to add to your web page. The widget command has the following form:
['widget', widget_id, selector?, options?]
where widget_id is the required id of the widget (found in the Widget Installation Code of the Friendbuy application), selector is an optional string identifying the HTML element where the widget is to be placed, and options is an optional object with configuration details.
The three parameters are discussed in the following sections.
Identification
Example
// Place the widget with id a0-Ybn into its default location
// on the page: the HTML element with id "friendbuy-a0-Ybn"
window['friendbuy'].push(['widget', 'aO-Ybn']);
The widget_id parameter determines which widget to add to the page. The widget_id is the only required component of the widget command. You can find the widget ID in the Friendbuy platform by following steps:
- Login to Friendbuy.
- Navigate to Referral & Sharing > Widgets and select the desired widget from the list.
- Click on the Widget Installation Code tab.
Selector
Example
// Explicit specification of widget placement. Place widget
// with id a0-Ybn into HTML divs with the class "widget"
window['friendbuy'].push(['widget', 'aO-Ybn', 'div.widget']);
Use the optional selector argument to identify the HTML element in which the widget will appear. If this argument is not provided, a default selector, a class formed by prefixing friendbuy- to the widget id, will be used.
Widget Options
Example
// Place widget a0-Ybn into its default selector with a wide
// range of options
window['friendbuy'].push(['widget', 'aO-Ybn', {
configuration: {
// Waits five seconds after loading to display
auto_delay: 5000,
// Does not require a button to show the widget
share_button: false
},
criteria: {
// Widget will appear only for VIP customers
// and if loaded within a pre-configured time
// period
limitedTime: true,
customerType: 'VIP'
},
content: {
// Places values into a the widget template for
// a personalized greeting
firstname: "Jordan",
city: "Cybertown"
},
parameters: {
survey: '<?php echo $order->isSurvey() ?>'
}
}]);
Example
// URL generated when a referral link is clicked and the survey was completed
'http://yoursite.com?survey=true'
The options argument to the widget command can take many forms. Add as many or as few options as you would like during widget placement. Four options (configuration, criteria, content, and parameters) are supported and are described below.
Configuration
The display configuration options control how and when a widget is invoked.
- The
auto_delayproperty determines the auto-popup behavior of a widget. It is specified as an integer with the number of milliseconds to wait before the widget appears automatically. A value of 0 indicates manual widget invocation. - The
share_buttonproperty indicates whether a widget should be triggered by a share button. When false, the widget will appear automatically.
Criteria
The criteria option is a collection of key-value pairs, used to conditionally display the widget. This allows you to target specific customers rather than all visitors to your site. For example, you may want to run a campaign just for existing customers, or a subset of existing customers.
Content
The content option is a collection of key-value pairs. These values are used to dynamically display text in a widget. An example use case is personalizing a widget to display the name of the logged in customer.
To take advantage of this functionality, the template applied to your widget must be customized by Friendbuy. The code added to the template can be set up so that the content values are either required or optional. If optional, the content placeholder in the widget will be hidden if no value is passed.
Parameters
The parameters option is a collection of key-value pairs. These values are added to referral links for the associated widget to facilitate tracking and reporting on referral traffic.
When you provide custom parameters with a widget, Friendbuy will include them in the referral URLs that are created from that widget. When someone clicks on a shared link, a query string parameter will be added for each of the custom parameters provided.
Event Listeners
You can subscribe to client-side widget events to ensure widgets are properly being served and tailor the website experience for users after they successfully share.
The events you can subscribe to along with their accompanying event handlers are described below.
Window Open Event
Example Subscription Call
window['friendbuy'].push(['subscribe', 'widget.open',
function (widget) {
// Handler code
}
]);
The ['subscribe', 'widget.open', callback] command registers a callback for the widget.open event, which fires when a Friendbuy widget has been opened by the user. When called, the subscribed event handler function is passed the opened widget as its sole argument.
Window Close Event
Example Subscription Call
window['friendbuy'].push(['subscribe', 'widget.close',
function (widget) {
// Handler code
}
]);
The ['subscribe', 'widget.close', callback] command registers a callback for the widget.close event, which fires when a Friendbuy widget has been closed by the user. When called, the subscribed event handler function is passed the closed widget as its sole argument.
Share Success Event
Example Subscription Call
window['friendbuy'].push(['subscribe', 'share.success',
function (share) {
// Handler code
}
]);
Example Callback Argument
{
"id": "2789",
"network": "facebook",
"message": "Such an amazing product"
}
The ['subscribe', 'share.success', callback] command registers a callback for the share.success event, which fires when a user successfully completes a share using a Friendbuy widget. Subscribing to this event allows you to trigger activity on your website based on shares by your customers. You can surface a “thank you” popup, send the visitor to a special page intended solely foryour advocates, or customize your page depending on the social network destination or the shared message.
The object passed to the handler has the following properties:
| Property | Type | Description |
|---|---|---|
| id | string | A unique identifier for the share |
| network | string | The destination of the share (e.g., "facebook", "twitter", etc.) |
| message | string | The message that accompanied the share |
Services
Visitor Status Service
Example Invocation
window['friendbuy'].push(['invoke', 'visitor_status',
function (response) {
// Handler code
}
]);
Example Callback Object
{
"friendbuy_click": "share",
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"name": "Taylor Gomez",
"email": "tgo@example.net",
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"facebook_friends_count": 987,
"twitter_followers_count": 121393,
"birthdate": "1989-11-09"
}
},
"purl": {
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00",
"archived": false,
"objective": "referral",
"distribution": 50,
"is_champion": true,
"campaign_group_id": "hm-NNz"
},
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"destination_url": "http://mycompany.example.com/rewards/908",
"email": "jzheng@example.mil",
"id": "100",
"referral_code": "uxC"
},
"reminder_email": {
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00",
"archived": false,
"objective": "referral",
"distribution": 50,
"is_champion": true,
"campaign_group_id": "hm-NNz"
},
"id": "100001965159666_428859647189537",
"created_at": "2015-08-09T03:20:11.098230-07:00",
"referral_code": "uxC",
"sharer": {
"customer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
},
"email": "jzheng@example.mil"
},
"share": {
"id": 196418,
"referral_code": "uxC",
"message": {
"id": "100001965159666_428859647189537",
"content": "This is my favorite tennis racket ever",
"network": "facebook"
},
"campaign": {
"id": 233,
"name": "Fall Shoe Sale",
"published": true,
"referral_incentive": {
"type": "fixed_cash",
"value": 25
},
"created_at": "2015-08-09T03:20:11.098230-07:00"
},
"ip_address": "8.8.8.8",
"newsletter_opt_in": true,
"send_reminder": true,
"created_at": "2017-01-13T19:18:38.239Z",
"detail_uri": "https://developer-api.friendbuy.com/v1/shares/196418",
"email_recipients": [
"pele@example.br",
"messi@example.ar"
],
"sharer": {
"account_id": "JAYZ",
"id": "JAYZ",
"first_name": "Jaylene",
"last_name": "Zheng",
"email": "jzheng@example.mil",
"stripe_customer_id": "cus_Agg4bCEhno7A1E",
"chargebee_customer_id": "4gkYnd21ouvW",
"detail_uri": "https://developer-api.friendbuy.com/v1/customers/1"
}
}
},
"self_referred": false,
"timestamp": "2015-08-09T03:20:11.098230-07:00",
"signature": "bGaQzRncJifoE9PgtGdz99l8ffY="
}
The ['invoke', 'visitor_status', callback] command allows Friendbuy to pass details about a user visiting your website to a callback function. This data includes whether the visitor has clicked on a Friendbuy referral link into the site within the last hour, and if so, the source of the click, and whether or not the click indicates a self-referral.
Common use cases for visitor status include:
- Depositing a session-based credit into a referred user’s shopping cart
- Determining if a friend offer email capture widget should be shown
- Obtaining and storing the referral code for for future use, such as in a call to the POST /purchases API endpoint.
Signature
You can verify the authenticity of the Visitor Status from Friendbuy by analyzing its cryptographic signature. Friendbuy signs the response using the following technique:
- Sort the attributes of the status object, excluding
signature, alphabetically, using Unix-style case-sensitive sort order. Concatenate the attribute names and values with no delimiters. If the value is itself an object, concatenate only its
id. For example:{ purl: { customer: "1234", id: "456" }, friendbuy_click: "purl", self_referred: "true" }becomes:
friendbuy_clickpurlpurl456self_referredtrueThe signature is placed in the X-FRIENDBUY-SIGNATURE header, and is computed by Base64-encoding the HMAC-SHA1 hash of the request body with your Friendbuy secret key.
Response Model
| VisitorStatus | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| friendbuy_click | One of 'share', 'purl', 'reminder_email', or 'none'. If 'none', the current user has not clicked a Friendbuy link into your site in the past hour. If 'share', the share property will have information about the clicked share. If 'purl', the purl property will have information about the clicked personal URL. If 'reminder_email', the 'reminder_email' property will have information about the clicked reminder email | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| share | Information about the share, if friendbuy_click === 'share' (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| purl | Information about the personal url, if friendbuy_click === 'purl' (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reminder_email | Information about the reminder email, if friendbuy_click === 'reminder_email' (Expand) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self_referred | Indicates whether the visitor is an advocate clicking on their own referral link. Note, this calculation is dependent on which fraud check settings have been enabled in the Friendbuy platform, specifically the Browser and/or IP Address checks. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| timestamp | When this response was formed | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| signature | Friendbuy’s signature for this message, computed as described above | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||