Skip to main content
Solved

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

  • Apr 23, 2024 1:51 PM UTC
  • 2 replies
  • 537 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

View original
This post has been closed for comments

2 replies

MarcosC
RevenueCat Staff
Forum|alt.badge.img+7
  • RevenueCat Staff
  • Answer
  • Apr 23, 2024 7:07 PM UTC

@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
  • Apr 23, 2024 10:00 PM UTC

@MarcosC Thank you! That did it!