Get Subscription Proration Details
This API endpoint retrieves proration details for a subscription when switching between plans. The proration amount is calculated based on the remaining time on the current plan and the cost of the new plan. You must provide both the subscription ID and product ID as path parameters.

Authorization: Bearer YOUR_TOKEN


Expected Behavior:


  • On success, the system will return the proration details, including the current plan, the new plan, and the proration difference.
  • If the request fails, an appropriate error message will be returned.
Path Parameters
  • id string
    The unique subscription ID to retrieve.
  • product_id string
JavaScript
Response codes
const axios = require('axios');

const url = 'https://payment-query.api.pinghome.io/v1/subscription/{id}/proration/{product_id}';

axios.get(url, {
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN'
  }
})
.then(response => {
  console.log(response.data);
})
.catch(error => {
  console.error(error);
});
ResponseThis section is used to view the possible HTTP response codes returned by the API. These codes indicate the status of a request, such as 201 (Created), 401 (Unauthorized), 409 (Conflict), or 422 (Unprocessable Entity).