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.

Webhooks

FlipGive provides a number webhooks to notify your system of or particualr events. They consists JSON format POST requestd sent to an URL of your choice, and since no PII data is included, it handles no authentication (We recomend IP greenlisting). All webhooks include the following fields:

  • Type: The type of webhook.
  • Description: A short description pof the event.
  • Data: The data of the particular webhook, which hcanges with the type.

Our available webhooks can be found bellow.

User Created

Fires when a User has been persisted on our database. The data includes the ID of the user and the time when it was created, in seconds since the Linux epoch.

  {
"type":"user_created",
"description":"A Footeam User has been created in FlipGive.",
"data":{
"user_id":"1efdff0193b8c6bbd71bd7af6c0c45e5",
"created_at":1715373194
}
}

Fundraiser Created

Fires when a Fundraiser has been persisted on our database. Because Flipgive supports multiple campaigns per user, the fundraiser is the User in the context of a Campaign The data includes the ID of the user, the campaign and the time when it was created, in seconds since the Linux epoch.

  {
"type":"user_created",
"description":"A Footeam User has been created in FlipGive.",
"data":{
"user_id":"1efdff0193b8c6bbd71bd7af6c0c45e5",
"campaign_id":"8f3f724a844c4b7f4904414e91ec4fba",
"created_at":1715373194
}
}

Full Report

The Full Report 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 Rewards 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": "1efdff0193b8c6bbd71bd7af6c0c45e5",
"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,
"campaign_amount_cents": 250
"completed_at": "2024-03-11 18:00:15 -0400",
"user_id": "1efdff0193b8c6bbd71bd7af6c0c45e5",
"campaign_id": "8f3f724a844c4b7f4904414e91ec4fba"
}
},
"campaign_data": {
"campaign_id": "8f3f724a844c4b7f4904414e91ec4fba",
"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,
"campaign_amount_cents": 250
"completed_at": "2024-03-11 18:00:15 -0400",
"user_id": "1efdff0193b8c6bbd71bd7af6c0c45e5",
"campaign_id": ""8f3f724a844c4b7f4904414e91ec4fba""
}
},
"fundraiser_data": {
"user_id": "1efdff0193b8c6bbd71bd7af6c0c45e5",
"campaign_id": ""8f3f724a844c4b7f4904414e91ec4fba"",
"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,
"campaign_amount_cents": 250
"completed_at": "2024-03-11 18:00:15 -0400",
"user_id": "1efdff0193b8c6bbd71bd7af6c0c45e5",
"campaign_id": ""8f3f724a844c4b7f4904414e91ec4fba""
}
}