Convert to Credit Backend Integration

In order to facilitate the ability for your system to grant users "credits" when doing a Convert to Credit withdrawal we have implemented a backend webhook subscription.

Technical documentation

Convert to Credit Webhookschevron-right

Convert to Credit Withdrawal: C2CWithdrawal

The C2CWithdrawal webhook event fires when a user has requested a Convert to Credit transaction. The dollar amount in the payload will be temporarily held by Lucra and decremented from the user's balance until we receive a success or error response from your webhook endpoint.

{
  "intentId": "5a31e00a-a2b8-4cdc-80cb-3ce3312f8023",  // UUID passed in via SDK
  "userId": "<USER_ID>", // Lucra canonical user identifier (UUID)
  "amount": 100, // dollar amount to be deducted from user's Lucra balance
  "convertedAmount": 120, // credit amount to be awared to the user after multiplier
  
  // optional custom JSON data passed from SDK through webhook (null by default)
  "conversionMetadata": { "customKey1": "customValue1", "customKey2": "customValue2" } 
}

A response from this webhook is expected to be synchronous so the end user has a smooth experience with the conversion process and receives immediate feedback. Your endpoint should return a 200 response code along with the following response payload.

{
  "status": "COMPLETED", // "COMPLETED" | "FAILED" | "PENDING" (case sensitive)
  "responseText": "<ANY_USER_READABLE_STRING>",  // displayed directly to end user
  
  // optional transaction details, helpful for customer support inquiries
  "responseDetails": "<ANY_VALID_JSON_TYPE>"
}
Convert to Credit Confirmation

The value of responseText will be shown in the end user interface. If you return a status of FAILED then the amount from the webhook payload will be returned to the end user's Lucra balance. If you return a status of COMPLETED or PENDING the user's balance remains decremented. Lucra will also store the contents of responseDetails which we encourage passing along to help with troubleshooting efforts and customer support inquiries.

Last updated