Rain-Managed
Rain-Managed statement credits use Rain’s existing collateral payment flow. You still integrate the payment-signature and onchain payment UX; Rain records the rewards redemption automatically after the collateral payment settles. Unlike travel redemptions—where the cardholder signs a withdrawal that burns points to the zero address—statement credits do not burn points. The cardholder signs a payment, and Rain callsmakePaymentFromCollateral to apply the points against the card balance, increasing spending power and lowering the amount due.
How It Works
- The cardholder chooses to apply Raindrops towards statement credit in your app.
- Your app requests a payment signature for the cardholder’s collateral contract, passing the native token amount to redeem.
- Your app creates a pending payment record with
POST /v1/issuing/users/{userId}/payments. The response returns theteamIdyou pass to the onchain call. - The wallet submits the signed
makePaymentFromCollateraltransaction onchain. - Rain’s payment event handler matches the onchain payment to the pending record, settles it, records a completed
STATEMENT_CREDITredemption, and reflects the discounted cent value in the balance response’spendingStatementCreditsfield.
Code Recipe
This recipe walks through the Rain-Managed statement-credit flow end to end. You start from the dollars the cardholder wants to redeem and apply your program’s discount rate to get the points to burn (see Rain-Managed Discounted Value). Before you begin, fetch the user’s collateral contract from the get user contracts endpoint. Your onchain points address is thetoken you pass to the signature request, and the controllerAddress is the coordinator contract you call onchain. The signature response returns the collateral proxy address and the rest of the onchain call arguments.
1
Request a payment signature
Convert the dollars the cardholder wants to redeem into points by applying your program’s discount rate, then request a payment signature for those points. Rain sets the discount per program (30% by default) and can change it without a redeploy, so read it from your program configuration rather than hardcoding it. Round the points up so the redemption fully covers the requested credit, scale them to the native token amount (EVM has 18 decimals, Solana has 6), and pass that with
isAmountNative=true. The endpoint returns status: "ready" with the signed parameters for the onchain call, or status: "failed" with an error, so check status before you use the response.2
Create a pending payment record
Create a pending payment record before you submit onchain. Rain’s payment event handler matches the settled payment to this record by wallet address, team, chain, and amount, so the credit does not settle without it. Pass the dollars the cardholder is redeeming, in cents, as
amount—the same value you converted to points in the previous step. Because you rounded the points up, this matches the cent value Rain derives from the settled onchain payment. The response returns the teamId you pass to makePaymentFromCollateral.3
Submit the collateral payment
The wallet signs and submits
makePaymentFromCollateral. Unlike travel redemptions, this does not burn points to the zero address. Instead, it applies the points against the card balance, which increases spending power and lowers the amount due. Pass the signed parameters from the signature response, then pass the teamId from the pending payment record as the final argument.4
Rain records the redemption
After the payment settles onchain, Rain records a completed
STATEMENT_CREDIT redemption and reflects the discounted cent value in the balance endpoint’s pendingStatementCredits field. Poll the balance endpoint to confirm the credit landed.Rain records the redemption idempotently against the settled payment, so a
retried or re-observed onchain payment event does not create a duplicate
STATEMENT_CREDIT redemption.Partner-Managed
How statement credits work depends on whether your points balances live onchain or in Rain’s database.Partner-Managed Onchain
You handle statement credits entirely in your own system. Because your points balances are canonical onchain, Rain neither records nor orchestrates onchain statement-credit redemptions. You debit the points and apply the cardholder-facing credit yourself.Partner-Managed Offchain
Rain keeps the canonical points ledger in its database, so you cannot debit points yourself. To redeem points for a statement credit, callPOST /v1/issuing/raindrops/statement-credit with the user and the number of points to redeem. Rain debits the cardholder’s offchain points balance and records a completed STATEMENT_CREDIT redemption, which lowers the user’s availablePoints.
You decide what a redemption is worth. Rain records the points deduction only—it does not derive a dollar value, move spending power, or touch the card balance—so you set how much statement credit each point is worth and apply the cardholder-facing credit in your own system. You can use any conversion you want. For example, you might credit 1 point as $0.01 or use a 1:1 ratio.
How It Works
- The cardholder requests a statement credit in your app.
- Call
POST /v1/issuing/raindrops/statement-creditwith the user and the point amount. - Rain debits the offchain points ledger and records a completed
STATEMENT_CREDITredemption. The response confirms the redemption and theraindropAmountdeducted. - You apply the cardholder-facing credit in your own system, using whatever value you assign to the redeemed points.
Request
Send the user and the point amount as a positive integer string. Include anidempotency-key header so that retries replay the same response.
Response
A successful request returns201 with a completed STATEMENT_CREDIT redemption. The response confirms the redemption and the raindropAmount that was deducted. Rain does not return a dollar value—you decide what the redeemed points are worth and apply the credit in your own system.
Reusing the same
idempotency-key and body replays the cached 201 response,
so a retried request never double-debits the balance. The key is limited to 64
characters.Errors
Rain-Managed Discounted Value
For Rain-Managed programs, points redeem for statement credit at a discount that Rain configures per program. You apply this discount when converting the dollars the cardholder wants to redeem into the points to burn:ceil(7000 × 100 / 70) = 10,000 points. Rain can change the discount at any time without a redeploy, so read your current rate from your program configuration rather than hardcoding it.
Log into your Rain issuing dashboard for your program’s current
statement-credit discount rate.
What You See
For Rain-Managed programs, the balance endpoint’spendingStatementCredits field shows the cent value of statement credits redeemed since the user’s last statement.
For Partner-Managed Offchain programs, GET /issuing/raindrops/balance returns only availablePoints, which drops by the redeemed point amount once Rain records the redemption.