Solved

I'm getting a 400 Error "Invalid Platform" when updating Stripe tokens to RevenueCat

  • 23 April 2024
  • 2 replies
  • 14 views

Userlevel 1
Badge +4
When calling the  https://api.revenuecat.com/v1/receipts endpoint I’m getting a 400 error as if I’m not sending the X-Platform header 

 

const revenueCatBaseUrl = 'https://api.revenuecat.com/v1/';

const url = `${revenueCatBaseUrl}receipts`;
const headers = {
'Authorization': `Bearer ${revenueCatApiKey}`,
'X-Platform': 'stripe',
'Content-Type': 'application/json'
};
const data = {app_user_id: uid, fetch_token: subscription}
const response = await axios.post(url, data, {headers: headers});
return response.status === 200;

{code: 7000, message: "Invalid Platform."}

Is anyone else experiencing similar issues?
 

icon

Best answer by MarcosC 23 April 2024, 21:07

View original

This post has been closed for comments

2 replies

Userlevel 3
Badge +6

@Paulo Taylor are you using the correct API key? you should be using the stripe application public key

Userlevel 1
Badge +4

@MarcosC Thank you! That did it!