Get a product

GET/api/public/products/{productId}

Get a product by id.

Authentication

Requires an API key, sent as Authorization: Bearer cp_live_....

API keys carry scopes. Get the catalog of scopes and webhook events lists every scope.

Path parameters

Path parameters
NameTypeDescription
productIdrequiredstring

Request examples

cURL
curl --request GET \
  --url 'https://api.coach-platform.com/api/public/products/<productId>' \
  --header 'Authorization: Bearer cp_live_...'
JavaScript (fetch)
const response = await fetch('https://api.coach-platform.com/api/public/products/<productId>', {
  method: 'GET',
  headers: {
    Authorization: 'Bearer cp_live_...',
  },
});

const data = await response.json();

Responses

200 OK

Successful response

Example body (application/json)
{
  "data": {
    "id": "<string>",
    "coachId": "<string>",
    "name": "<string>",
    "description": "<string>",
    "price": 123,
    "currency": "ILS",
    "productType": "SINGLE",
    "productCategory": "<string>",
    "credits": 123,
    "isActive": true,
    "hidePriceInApp": true,
    "membershipDetails": {
      "duration": {
        "value": 123,
        "unit": "DAY"
      },
      "recurrence": "DAILY",
      "limitations": {
        "isUnlimited": true,
        "periodicalUsage": {
          "usagesPerPeriod": 123,
          "periodType": "<string>"
        },
        "allowedHours": {
          "from": "<string>",
          "to": "<string>"
        },
        "allowedDays": [
          "<string>"
        ]
      }
    },
    "createdAt": "<date-time>",
    "updatedAt": "<date-time>"
  }
}
Response fields (28)
Response fields
NameTypeDescription
dataobject
data.idstring
data.coachIdstring
data.namestring
data.descriptionstring
data.pricenumber
data.currencystring

Allowed values: ILS USD EUR GBP

data.productTypestring

Allowed values: SINGLE PUNCH_CARD MEMBERSHIP

data.productCategorystring
data.creditsnumber | null
data.isActiveboolean
data.hidePriceInAppboolean
data.membershipDetailsobject | null
data.membershipDetails.durationobject
data.membershipDetails.duration.valuenumber
data.membershipDetails.duration.unitstring

Allowed values: DAY WEEK MONTH YEAR

data.membershipDetails.recurrencestring

Allowed values: DAILY WEEKLY MONTHLY YEARLY ONE_TIME

data.membershipDetails.limitationsobject
data.membershipDetails.limitations.isUnlimitedboolean
data.membershipDetails.limitations.periodicalUsageobject
data.membershipDetails.limitations.periodicalUsage.usagesPerPeriodnumber
data.membershipDetails.limitations.periodicalUsage.periodTypestring
data.membershipDetails.limitations.allowedHoursobject
data.membershipDetails.limitations.allowedHours.fromstring
data.membershipDetails.limitations.allowedHours.tostring
data.membershipDetails.limitations.allowedDaysstring[]
data.createdAtstring<date-time>
data.updatedAtstring<date-time>

Error responses

  • 400 Bad Request
  • 401 Unauthorized
  • 403 Forbidden
  • 404 Not Found
  • 409 Conflict
  • 429 Too Many Requests
  • 500 Internal Server Error

These statuses share the same response body.

Example body (application/json)
{
  "error": {
    "code": "<string>",
    "message": "<string>",
    "fix": "<string>",
    "details": {},
    "retryAfterMs": 123
  }
}
Error fields (6)
Error fields
NameTypeDescription
errorobject
error.codestring
error.messagestring
error.fixstring | null
error.detailsobject | null
error.retryAfterMsnumber | null

This page is also available as Markdown. Browse it in the interactive explorer or download the OpenAPI spec.