const { result, error } = await unprice.customers.getActivePhase("cus_1234567890");
if (error) {
// handle potential network or bad request error
// a link to our docs will be in the `error.docs` field
console.error(error.message);
return;
}
console.log(result);
{
"phase": {
"id": "phase_1234567890",
"startDate": 1678900000,
"endDate": 1681492000,
"planVersionId": "pv_1234567890",
"status": "active"
}
}
Request
The ID of the customer to get active phase for
Response
The active phase information
The start timestamp of the phase
The end timestamp of the phase
The ID of the plan version for this phase
The status of the phase (active, upcoming, etc.)