makeIapPostRequest = async (url, body, idToken, userAgent) => {
  const res = await fetch(url, {
    method: 'POST',
    headers: {
      'User-Agent': userAgent,
      Authorization: `Bearer ${idToken}`,
    },
    body: JSON.stringify(body),
  });

  if (!res.ok) {
    const err = await res.text();
    console.error('Error making IAP post request:', err.message);
    throw new Error(err);
  }
}
@param {string} url The url that the post request targets.
@param {string} body The body of the post request.
@param {string} idToken Bearer token used to authorize the iap request.
@param {string} userAgent The user agent to identify the requester.