🦢
White Swan for Partners
Go to AppGet in Touch
  • White Swan for Partners Knowledge Base
  • 💡Platform Overview
    • Introduction to White Swan for Partners
    • Platform Capabilities
      • Digital Insurance Experiences
      • Supported Product Types
      • Supported Solution Types
      • Best-Interest Philosophy
      • Client Success Managers & Advanced Planning
    • Quick Start Guide
    • Using the Platform
      • White Labeling
      • Instant vs Custom Quotes
      • Page Types Overview
      • Sharing Pages
      • Customizing Pages
      • Custom Cases
      • Tracking Cases
      • General Company Settings
      • Policy Solve For Options
    • Client Experience
      • Guided vs Quick Quote Flow
      • Policy Type Recommendation Engine
      • Sample Plan Visualizations
      • Personal Plan Requests
      • Personal Plans
      • Applications
      • Underwriting & Issuance
    • Page
    • Plans to Access Platform
      • Concierge Plan
      • Digital Agent Plan
      • Innovator Plan
    • Instantly Quotable Carriers/Policies
    • Earnings
      • Understand Life Compensation & Our Philosophy
      • Activating Earnings
      • Licensing Considerations
      • Tracking Earnings
    • Platform Roadmap
    • Submit A Feature Request
  • 💻Embedding White Swan
    • Overview of White Swan Embed
    • Quick Start Guide
    • Using Embed + API/Zapier
  • ⚡Zapier Integration
    • Overview of Zapier Integration
    • Quick Start Guide
    • Example Use Cases
      • Integrate With CRMs
      • Integrate With Accounting/Payroll Tools
      • Integrate With Marketing Platforms
      • Integrate With Business Intelligence/Analytics Tools
      • Integrate With App/Website Builders
    • Data Formatting Standards
    • Triggers
      • New Plan Request Started
      • Plan Request Finished
      • New Personal Plan
      • New Change Request
      • New Application Started
      • Application Finished
      • New Plan Offered
      • New Plan Delivered
      • New Earnings Event
    • Create Actions
      • Start Personal Plan Request
      • Submit Complete Plan Request
      • Create Pre-Fill Information
    • Search Actions
      • Plan Request(s)
      • Personal Plan(s)
      • Referred Client(s)
      • Account User(s)
      • Earnings Event(s)
    • Using ChatGPT To Create Zaps
  • ✨AI Landing Page Builder
    • Overview of AI Landing Page Builder
    • Generate Landing Pages With AI
    • Editing Landing Pages
  • ⚙️API Documentation
    • Overview of White Swan's API
    • Authentication
    • Data & API Standards
    • Webhooks
      • Creating/Managing Webhooks
      • New Plan Request Started
      • Plan Request Finished
      • New Personal Plan
      • New Change Request
      • New Application Started
      • Application Finished
      • New Plan Offered
      • New Plan Delivered
      • New Earnings Event
    • Action Calls
      • Start Personal Plan Request
      • Submit Complete Plan Request
      • Create Pre-Fill Information
    • Information Calls
      • Plan Request(s)
      • Personal Plan(s)
      • Referred Client(s)
      • Account User(s)
      • Earnings Event(s)
  • ⛳BackNine Integration
    • Overview of BackNine Integration
    • Quick Start Guide
    • Capabilities
      • Instant Quotes
      • Instant Applications
      • Case Support
  • 💹Wealthbox Integration
    • Overview of Wealthbox Integration
    • Quick Start Guide
    • Capabilities
      • Import Contact from Wealthbox
      • Search Wealthbox Contacts in White Swan
      • Start a Plan Request
    • Notification Settings
  • Other Direct Integrations
    • Paperclip
Powered by GitBook
On this page

Was this helpful?

  1. API Documentation
  2. Information Calls

Earnings Event(s)

PreviousAccount User(s)NextOverview of BackNine Integration

Last updated 1 year ago

Was this helpful?

This action retrieves information about associated with your White Swan account.

Earnings events with the Earnings Event value "Paid Compensation" signifies payments made to you and should be treated differently than events with the Earnings Event value "Closed Case" or "Referred Partner Earning". For a deeper understanding, refer to our .

API Method:

Fetch Earning Event(s)

POST https://app.whiteswan.io/api/1.1/wf/earnings_event

Returns information about earnings events associated with your White Swan account.

Headers

Name
Type
Description

Authorization*

String

Bearer <YOUR API KEY>

Content-Type*

String

application/json

Accept*

String

application/json

user-agent*

String

<YOUR APP>

Request Body

Name
Type
Description

JSON Body*

Object

See specification below

Sample Body Payload
{
"client_email": "jane@gmail.com",
"user_email": "john@acme.com",
"lookback": 30
}

Please note that the sample body payload above contains all possible parameters for your reference. In an actual call, you don't need to use all (or any) parameters.

Code Examples - Making the API Call:

curl -X POST "https://app.whiteswan.io/api/1.1/wf/earnings_event" \
     -H "Authorization: Bearer <YOUR API KEY>" \
     -H "Content-Type: application/json" \
     -H "Accept: application/json" \
     -H "User-Agent: <YOUR APP>" \
     -d '{
          "client_email": "jane@gmail.com",
          "user_email": "john@acme.com",
          "lookback": 30
          }'
import requests

url = "https://app.whiteswan.io/api/1.1/wf/earnings_event"
headers = {
    "Authorization": "Bearer <YOUR API KEY>",
    "Content-Type": "application/json",
    "Accept": "application/json",
    "User-Agent": "<YOUR APP>"
}

data = {
    "client_email": "jane@gmail.com",
    "user_email": "john@acme.com",
    "lookback": 30
}

response = requests.post(url, headers=headers, json=data)
print(response.json())
const url = "https://app.whiteswan.io/api/1.1/wf/earnings_event";
const headers = {
    "Authorization": "Bearer <YOUR API KEY>",
    "Content-Type": "application/json",
    "Accept": "application/json",
    "user-agent": "<YOUR APP>"
};
const data = {
    "client_email": "jane@gmail.com",
    "user_email": "john@acme.com",
    "lookback": 30
};

fetch(url, {
    method: "POST",
    headers: headers,
    body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error("Error:", error));
import okhttp3.*;

public class WhiteSwanApiCall {

    public static void main(String[] args) {
        OkHttpClient client = new OkHttpClient();

        MediaType mediaType = MediaType.parse("application/json");
        RequestBody body = RequestBody.create(mediaType, "{\"client_email\":\"jane@gmail.com\",\"user_email\":\"john@acme.com\",\"lookback\":30}");

        Request request = new Request.Builder()
            .url("https://app.whiteswan.io/api/1.1/wf/earnings_event")
            .post(body)
            .addHeader("Authorization", "Bearer <YOUR API KEY>")
            .addHeader("Content-Type", "application/json")
            .addHeader("Accept", "application/json")
            .addHeader("user-agent", "<YOUR APP>")
            .build();

        try {
            Response response = client.newCall(request).execute();
            System.out.println(response.body().string());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
<?php

$ch = curl_init();

$data = array(
    "user_email" => "jane@gmail.com"
);

$headers = array(
    "Authorization: Bearer <YOUR API KEY>",
    "Content-Type: application/json",
    "Accept: application/json",
    "user-agent: <YOUR APP>"
);

curl_setopt($ch, CURLOPT_URL, "https://app.whiteswan.io/api/1.1/wf/earnings_event");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($ch);

if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
} else {
    echo $response;
}

curl_close($ch);
?>
require 'net/http'
require 'json'
require 'uri'

uri = URI.parse("https://app.whiteswan.io/api/1.1/wf/earnings_event")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

headers = {
  'Authorization' => 'Bearer <YOUR API KEY>',
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'User-Agent' => '<YOUR APP>'
}

data = {
    client_email: "jane@gmail.com",
    user_email: "john@acme.com",
    lookback: 30
}

request = Net::HTTP::Post.new(uri.path, headers)
request.body = data.to_json

response = http.request(request)
puts response.body
package main

import (
	"bytes"
	"fmt"
	"net/http"
)

func main() {
	url := "https://app.whiteswan.io/api/1.1/wf/earnings_event"
	data := `{
    			"client_email": "jane@gmail.com",
    			"user_email": "john@acme.com",
    			"lookback": 30
		}`

	req, err := http.NewRequest("POST", url, bytes.NewBuffer([]byte(data)))
	if err != nil {
		panic(err)
	}

	req.Header.Set("Authorization", "Bearer <YOUR API KEY>")
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Accept", "application/json")
	req.Header.Set("User-Agent", "<YOUR APP>")

	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	fmt.Println("Response Status:", resp.Status)
}

Code examples are available in cURL, Python, Javascript, Java, PHP, Ruby, and Go, but can be constructed for other languages and tools. Some code examples include dependencies that may need to be installed in your codebase to ensure functionality. Remember to replace any values in the code that looks like <VALUE> and to adapt the parameter values passed.


Body Parameters Specification:

Field Label
Field Key
Field Type
Example Value
Description

User Email

user_email

Text

john@acme.com

This input can optionally be used to only show earnings events associated with a particular user on your account.

Client Email

client_email

Text

jane@gmail.com

This input can optionally be used to only show earnings events associated with a particular client referred from your account.

Look-back Period in Days

lookback

Number

90

This input can optionally be used to only show earnings events created after the current date minus X amount of days.


Sample Return Payload
[{
"event_name": "Case Closed",
"amount_credited": 500,
"associated_client_name": "John Doe",
"associated_client_email": "john@example.com",
"associated_request_id": "1670721321811x149164079586738180",
"referred_partner": "Acme Inc",
"credit_invoice": "https://s3.amazonaws.com/appforest_uf/f167656056312330177020/Crediting%20Invoice%20.docx",
"partner_associated_user": "Axel Doe"
}]

Returned Parameters Specification:

Field Label
Field Key
Field Type
Example Value
Description

Earnings Event Name

event_name

Text

Case Closed

The name of the earnings event.

Earnings Event Amount Credited

amount_credited

Number

500

The amount credited for the earnings event.

Earnings Event Associated Client Name

associated_client_name

Text

John Doe

The name of the client associated with the earnings event (only for Closed Case Events).

Earnings Event Associated Client Email

associated_client_email

Text

john@example.com

The email address of the client associated with the earnings event (only for Closed Case Events).

Earnings Event Associated Plan Request ID

associated_request_id

Text

1670721321811x149164079586738180

The ID of the plan request associated with the earnings event.

Earnings Event Associated Referred Partner

referred_partner

Text

Acme Inc

The name of the partner associated with the earnings event (only for Referred Partner Earning Events).

Earnings Event Credit Invoice

credit_invoice

Text

https://s3.amazonaws.com/appforest_uf/f167656056312330177020/Crediting%20Invoice%20.docx

A link to the credit invoice for the earnings event (only for Paid Compensation Events)

Earnings Event Associated Account User

partner_associated_user

Text

Axel Doe

The name of the account user associated with the earnings event.

⚙️
Earnings Event(s)
Example Use Case of Integrating With Accounting/Payroll Tools