How to Use Revenue API to Add Revenue for a Contact in SendX
In this tutorial, we will explore how to use the Revenue API to add revenue for a contact in SendX. We will utilize the SendX API Docs for this purpose. You can access the documentation by visiting docs.sendx.io.
Step-by-Step Guide
- Authentication:
- Navigate to the Authentication tab in the left sidebar of the SendX API Docs.
- Paste your team's API key in the provided field.
- Click on "Update" to save your API key.
- Access the Revenue API:
- Scroll down the left sidebar and find the "Events" section.
- Click on "Record a Revenue Event for a Specific Contact" to access the Revenue API.
- Understand the API Schema:
- The API requires an identifier, which can be an email address or an encrypted ID for the contact. If the contact does not exist in SendX, use the email address.
- Provide the revenue amount to be associated with the contact.
- Specify the source of the revenue, such as a website, mobile app, partner referral, etc.
- Include a Unix timestamp indicating when the revenue event occurred.
- Try the API Example:
- Enter the email address of a new contact. If the contact does not exist, it will be created automatically.
- Input the revenue amount, e.g., 123.23.
- Specify the source, e.g., "app".
- Provide the timestamp for the revenue event.
- Click on "Try" to send the request.
- Verify the API Response:
- If the API request is successful, you will receive a status code of 201 and a confirmation message.
- Check the Contact in SendX:
- Go back to SendX and click on the "Audience" tab, then select "Contacts".
- Verify that the contact has been created and the total revenue is displayed under the "Lifetime Revenue" column.
- Click on "Info" to view the contact's timeline and confirm that the revenue was added by the Revenue API, along with the amount and time.
That's it! You have successfully used the Revenue API to add revenue for a contact in SendX. Thanks for watching.