Skip to main content
Answer

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

  • April 23, 2024
  • 2 replies
  • 151 views

Forum|alt.badge.img+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?
 

Best answer by MarcosC

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

This post has been closed for comments

2 replies

MarcosC
RevenueCat Staff
Forum|alt.badge.img+7
  • RevenueCat Staff
  • Answer
  • April 23, 2024

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


Forum|alt.badge.img+4
  • Author
  • New Member
  • April 23, 2024

@MarcosC Thank you! That did it!