Monthly subscription plan for API access.

0

Using API Gateway and Lambda, I have built a simple chatbot. To cover my infrastructure costs, I would like to offer my users a monthly paid subscription plan, where the API is only accessible when the user is subscribed and pays a fixed monthly amount (no usage-based billing).

Naively, this should work by integrating the API Gateway with AWS Cognito and a payment service like Stripe. But I don't know how to stitch these things together. Or maybe different services are required. I am also open to marketplace solutions.

How can I charge a fixed monthly fee for API access?

1 Answer
0

There's some very good information in this blog post about controlling access to API Gateway.

In this case, I'd look at a Lambda Authorizer for your API - something that can check the identity of the caller and whether they are authorized to use the API which in this case would be whether they are a valid subscriber or not. Note that you want the authorizer to be as low-latency as possible so it might be valuable to store a valid list of current subscribers in a key-value store like DynamoDB.

profile pictureAWS
EXPERT
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions