Hello,
Accessing the raw body of the request with AWS lambda can be a bit tricky/confusing. My understanding is that you need to configure a "body mapping template" in the API Gateway to map `$input.body` as expected. This is something they document here [1].
I haven't use AWS Lambda myself recently but I have an old example that might be helpful to start though things might have changed since then:
{
"method": "$context.httpMethod",
"body": $input.json('$'),
"rawBody": "$util.escapeJavaScript($input.body).replaceAll("\\'", "'")",
"headers": {
#foreach($param in $input.params().header.keySet())
"$param": "$util.escapeJavaScript($input.params().header.get($param))"
#if($foreach.hasNext),#end
#end
}
}
There's also a similar discussion in a Github issue on stripe-node that was discussed a while ago here [2] with some details too.
I hope this puts you in the right direction!
Best,
Remi