I am working on a node.js back-end for an application where customers make requests for a certain service. Once they make a request, the payment amount get held on Stripe, then get captured once the service is delivered. But if the service was not delivered within a certain number of days, the request get canceled (on database) and the payment get released.
For that, I needed an external service which allows me to schedule a call (once) to an API (of mine) programmatically for each customer request.
This way I can schedule a call for each customer request to run on the final date of that request while holding its info. My API can then use that info to check the status of the request and make the required changes to the database as well as payment release in case the service was not delivered.
I Knew that I can do this by scheduling a rule (problematically via the put-rule command using the aws-sdk) that triggers a lambda function which execute against my API, but I need an example on how to do this Knowing that I'll be passing an API parameter (which is the request_id) from the cloudwatch event to the lambda function.