API Migration - For event/record
Migration guidance for changes needed if you are using API: event/record to create commissions in Ambassador.
Current Setup - API: event/record
Used for a variety of use-cases:
- Create a commission for the referrer
- Enroll the referred friend and create a welcome bonus for the referred friend
- Override the commission or welcome bonus amount
Ambassador 3 Migration Changes Needed
In Ambassador 3, you will no longer use the API to directly create commissions/rewards in Ambassador. Instead, you will use the order/record endpoint to create Orders for the referred customer, which will trigger Automations in Ambassador that hold the logic and outcomes, such as creating rewards, enrolling the referred customer, sending emails, and more.
More about this change
API: order/record - If the referred customer and referral attribution is not yet created, this will create the referred customer as a contact. It will also create an Order record for the referred customer, and an active Referral Attribution between the referred customer and the advocate.
Common event/record parameters to replace in order/record
- 'email' (customer email) → Replaced with: 'customer_email'
- 'uid' (customer uid) → Replaced with: 'customer_uid'
- 'commission_amount' (commission amount) →Do not include. Commission/reward amounts are no longer passed in an API call, as it is replaced with an Automation/Reward Calculation object in Ambassador.
- 'revenue' (transaction revenue) →Replaced with 'revenue_amount'
- 'transaction_uid' (transaction id) → Replaced with 'order_id'
- 'event_data1' (custom transaction data) → Replace with custom Order properties (configured in Ambassador settings)
- 'event_data2' (custom transaction data) → Replace with custom Order properties (configured in Ambassador settings)
- 'event_data3' (custom transaction data) → Replace with custom Order properties (configured in Ambassador settings)
- 'is_approved' (status to create commission in) → Do not include. Now configured in Automation.
- 'auto_create' (controls if referred customer is enrolled with this api call) → Do not include. Now configured in Automation
- 'email_new_ambassador' (controls if an email is sent to the referred customer upon enrollment with this API call) → Do not include. Now configured in Automation.
- 'welcome_bonus_amount' (controls the amount a commission is created for the referred customer) → Do not include. Now configured in Automation.
Note:
- event_data fields are replaced by Order Custom Properties (order meta data) fields that you can configure in Ambassador settings to now pass more than just 3 points of data with each Order to Ambassador. This data can then be used as filter logic with Ambassador automations.
- If it is necessary for your use-case to maintain control over the logic that is now managed in Ambassador automations, you can do so by creating custom order properties in Ambassador settings and configure in applicable Automations. Consult with your Ambassador team about your use case for accurate configuration.