How to setup a redeem option

Scrimmage supports a couple of redeem options including coupons, limited goods, and original app balance.

Redeem to coupons (Prizeout)

If you wanna give your users the ability to redeem rewards on coupons the simplest way is to use existing integration with Prizeout. They are aggregating thousands of coupons from all over the world and making them available to your users.

To start you have to sign up on their website and then create a Prizeout type redeem option on our admin panel.

Redeem back to balance

If you have a wallet inside of your app you can configure the ability to exchange reward tokens for money in your wallet. The conversion to USD will be done via the current rate of the SCRIM.

To do that you would need to implement a webhook which we will call every time someone wants to redeem money. For security reasons, we do not request access to your wallet management, it is the responsibility of your backend to give money to the user.

From the webhook, you have to reply 200 and then the transaction will be marked as succeeded and the user will lose his tokens. If you throw an error transaction will be canceled and the user will get tokens back into the wallet. You can also reply to 200 and the transaction will be marked as postponed.

If you postponed the transaction, you will have 2 days to confirm or cancel it. After 2 days transaction will be automatically canceled and the user will get tokens back.

Inside the body of the transaction, you will find such data:

{  
  "event": "redeem.static",  
  "transactionId": "f76d8d2a-cad9-436a-8778-ab6d01a54e3e",  
  "userId": "vpolishchuk",  
  "amount": 1200  
}

We also have retries in case your server is unavailable for some time, so ideally, please utilize transactionId to make sure you don’t reward the user 2 times. Also please note, the amount is in cents. UserID is the userID you send to us together with rewardables.

Authorization

To make sure that it is us who is calling Webhook you have to confirm that the Authorization header has the correct value which you specify from the admin panel.

Postponed transactions

To authorize your request to us you have to specify secretKey which you can get from the API Secret Key field in your redeem configuration o the admin panel.

To confirm the postponed transaction send a POST request to "/fed/providers/%redeem option name%/events/redeem.static.success":

{
  "secretKey": "secret key from admin dashboard",
  "transactionId": "transaction id from initial request"
}

To cancel the postponed transaction send a POST request to "/fed/providers/%redeem option name%/events/redeem.static.failure":

{
  "secretKey": "secret key from admin dashboard",
  "transactionId": "transaction id from initial request"
}

Redeem to limited goods

Work in progress...