Skip to main content
Use this endpoint to retrieve all payment plans attached to a given service. The response is an array of plan objects ordered by createdAt descending, so the most recently created plan appears first. Use the plan IDs returned here when you create checkout sessions or need to audit your pricing configuration.
GET https://api.retempo.xyz/api/v1/services/:serviceId/plans

Path Parameters

serviceId
string
required
The unique identifier of the service whose plans you want to list. You can find this ID in the list services or get service response. Passing an ID that does not exist returns a 404.

Response

A successful request returns HTTP 200 OK with a plans array. If the service exists but has no plans, the array is empty.
{
  "plans": [
    {
      "id": "clz1plan567",
      "serviceId": "clz1abc2def3ghi4",
      "name": "Pro Monthly",
      "description": "Full access, billed monthly",
      "pricingType": "FIXED_RECURRING",
      "billingInterval": "MONTH",
      "amount": "49.000000",
      "currency": "USDC",
      "createdAt": "2025-06-01T10:05:00.000Z",
      "updatedAt": "2025-06-01T10:05:00.000Z"
    }
  ]
}
plans
array
An array of payment plan objects for the specified service, ordered by createdAt descending.

Error Responses

StatusMessageCondition
404 Not FoundReferenced database record was not found.No service exists for the provided serviceId.

Example

Replace clz1abc2def3ghi4 with your actual service ID:
curl https://api.retempo.xyz/api/v1/services/clz1abc2def3ghi4/plans
Example response:
{
  "plans": [
    {
      "id": "clz1plan567",
      "serviceId": "clz1abc2def3ghi4",
      "name": "Pro Monthly",
      "description": "Full access, billed monthly",
      "pricingType": "FIXED_RECURRING",
      "billingInterval": "MONTH",
      "amount": "49.000000",
      "currency": "USDC",
      "createdAt": "2025-06-01T10:05:00.000Z",
      "updatedAt": "2025-06-01T10:05:00.000Z"
    }
  ]
}
Example 404 response:
{
  "error": "Referenced database record was not found."
}
To add a new plan to a service, use the Create Plan endpoint. To inspect a service and all its plans in one call, use Get Service.