Skip to main content

Backend Customizations

To setup FlipGive Rewards via an embedded or API integration you will need to install and configure the authentication token SDK which will setup an account when users decide to shop. The SDK should be initialized with a secret token that a FlipGive account manager will provide for you. Additional services such as an earnings notification webhook to notify you when a user has earned cashback is also provided below.

Authentication Token SDK

The SDK can receive the following data - either user_data or campaign_data objects must be required, but everything else is optional. Plesae note that the more information that is provided the more detailed API reports will be.

payload = {
user_data: user_data,
campaign_data: campaign_data,
group_data: group_data,
organization_data: organization_data
}

FlipgiveSDK::ShopCloud.identified_token(payload)
=> "eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4R0NNIn0..demoToken.g8PZPWb1KDFcAkTsufZq0w@A2DE537C"

For more details, please look at the SDK readme files in github. Languages supported are listed below, with languages made available on request.

Earnings Notification Webhook

FlipGive provides an optional webhook option to notify your system of any supported intents (completed shopping trips) shortly after they happen, usually within seconds. It consists a JSON format POST request sent to an URL of your choice, and as there is no PII data included in the webhook, it handles no authentication (We recomend IP greenlisting). Currently the webhook only delivers the Full Report, which includes a summary of the User data across all (fundraising) Campaigns, the (fundraiser) Campaign data which includes all users in the Campaign, and the Fundraiser data, which is the User summary within the context of a Campaign. An example can be seen bellow. All reports are constructed using the IDs provided by your system via ShopCloud token.

{
"type": "full_report",
"description": "The Full report contains all 3 individual reports: User report, Campaign report and Fundraiser report (the user report scoped to the campaign).\nReports contain the object's ID, the amount raised in cents, the completed transaction count, and information about the last transaction, if any.",
"data": {
"user_data": {
"user_id": "1710186453",
"amount_raised_cents": 300,
"transaction_count": 2,
"last_completed_transaction": {
"id": "8b53c3aedff211ee85014e34bab5c0b1",
"intent_type": "Buy",
"brand_name": "Jabba's Palace Bar & Grill",
"total_amount_cents": 5000,
"completed_at": "2024-03-11 18:00:15 -0400",
"user_id": "1710186453",
"campaign_id": "1710186453"
}
},
"campaign_data": {
"campaign_id": "1710186453",
"amount_raised_cents": 5650,
"transaction_count": 4,
"available_amounts_cents": 5610,
"last_completed_transaction": {
"id": "8b53c3aedff211ee85014e34bab5c0b1",
"intent_type": "Buy",
"brand_name": "Jabba's Palace Bar & Grill",
"total_amount_cents": 5000,
"completed_at": "2024-03-11 18:00:15 -0400",
"user_id": "1710186453",
"campaign_id": "1710186453"
}
},
"fundraiser_data": {
"user_id": "1710186453",
"campaign_id": "1710186453",
"amount_raised_cents": 300,
"transaction_count": 2,
"last_completed_transaction": {
"id": "8b53c3aedff211ee85014e34bab5c0b1",
"intent_type": "Buy",
"brand_name": "Jabba's Palace Bar & Grill",
"total_amount_cents": 5000,
"completed_at": "2024-03-11 18:00:15 -0400",
"user_id": "1710186453",
"campaign_id": "1710186453"
}
}