Product

A product is any item or service that a patient can purchase. For example, you can have a '30-min consulation' product that a patient can purchase for $100. Or you could have a monthly subscription to a course that the patient could purchase for $10/month.

The product model

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the product.

  • Name
    object
    Type
    string
    Description

    Always 'product'.

  • Name
    name
    Type
    string
    Description

    Name of the product.

  • Name
    description
    Type
    string
    Description

    Description of the product.

  • Name
    category
    Type
    string
    Description

    Which product category this product belongs to.

    Possible values:
    registration
    appointment
    prescription
    lab
    course
    other
  • Name
    pricing
    Type
    object
    Description
  • Name
    quantity
    Type
    number | null
    Description

    Quantity of the product that can be sold. If an unlimited quantity is available, set as undefined.

  • Name
    created_by
    Type
    string
    Description

    Creator of the product.

  • Name
    created_at
    Type
    number
    Description

    Timestamp (in ISO 8601 format) of when the product was created.

  • Name
    last_updated_at
    Type
    number
    Description

    Timestamp (in ISO 8601 format) of when the product was last updated.

Response

{
    "id": "prod_3XxtAULYUrX7GVsTKePy",
    "object": "product",
    "patient": "user_Z1zXZKvqrpwxbznuW6lJ",

    "name": "30-min Consultation",
    "description": "30-min consultation with Dr. Smith",
    "category": "appointment",
    "pricing": {
        "is_paid": true,
        "price": 100,
        "recurring": {
            "is_recurring": false,
        },
    },
    "quantity": null,

    "created_by": "user_xeDpGyt67wTor93qKtS7",
    "created_at": 1653798303000,
    "last_updated_at": 1653798303000
}


POST/v2/products

Create a product

Creates a new product.

Required attributes

  • Name
    name
    Type
    string
    Description

    Name of the product.

  • Name
    category
    Type
    string
    Description

    Which product category this product belongs to.

    Possible values:
    registration
    appointment
    prescription
    lab
    course
    other
  • Name
    pricing
    Type
    object
    Description
  • Name
    quantity
    Type
    number | null
    Description

    Quantity of the product that can be sold. If an unlimited quantity is available, set as undefined.

  • Name
    created_by
    Type
    string
    Description

    Creator of the product.

Optional attributes

  • Name
    description
    Type
    string
    Description

    Description of the product.

Response

{
    "id": "prod_3XxtAULYUrX7GVsTKePy",
    "object": "product",
    "patient": "user_Z1zXZKvqrpwxbznuW6lJ",

    "name": "30-min Consultation",
    "description": "30-min consultation with Dr. Smith",
    "category": "appointment",
    "pricing": {
        "is_paid": true,
        "price": 100,
        "recurring": {
            "is_recurring": false,
        },
    },
    "quantity": null,

    "created_by": "user_xeDpGyt67wTor93qKtS7",
    "created_at": 1653798303000,
    "last_updated_at": 1653798303000
}


GET/v2/products/:id

Retrieve a product

Retrieves the specified product.

Response

{
   "id": "prod_3XxtAULYUrX7GVsTKePy",
   "object": "product",
   "patient": "user_Z1zXZKvqrpwxbznuW6lJ",

   "name": "30-min Consultation",
   "description": "30-min consultation with Dr. Smith",
   "category": "appointment",
   "pricing": {
       "is_paid": true,
       "price": 100,
       "recurring": {
           "is_recurring": false,
       },
   },
   "quantity": null,

   "created_by": "user_xeDpGyt67wTor93qKtS7",
   "created_at": 1653798303000,
   "last_updated_at": 1653798303000
}


POST/v2/products/:id

Update a product

Updates the specified product object by setting the values of the parameters passed. Any other parameters not provided will not be modified.

Required attributes

  • Name
    updated_by
    Type
    string
    Description

    Updates to the product made by.

Optional attributes

  • Name
    name
    Type
    string
    Description

    Name of the product.

  • Name
    description
    Type
    string
    Description

    Description of the product.

  • Name
    category
    Type
    string
    Description

    Which product category this product belongs to.

    Possible values:
    registration
    appointment
    prescription
    lab
    course
    other
  • Name
    quantity
    Type
    number | null
    Description

    Quantity of the product that can be sold. If an unlimited quantity is available, set as undefined.

Response

{
    "id": "prod_3XxtAULYUrX7GVsTKePy",
    "object": "product",
    "patient": "user_Z1zXZKvqrpwxbznuW6lJ",

    "name": "30-min Consultation",
    "description": "30-min consultation with Dr. Smith",
    "category": "appointment",
    "pricing": {
        "is_paid": true,
        "price": 100,
        "recurring": {
            "is_recurring": false,
        },
    },
    "quantity": null,

    "created_by": "user_xeDpGyt67wTor93qKtS7",
    "created_at": 1653798303000,
    "last_updated_at": 1653798303000
}

GET/v2/products

List all products

Returns a list of all products.

Response

{
  "object": "list",
  "data": [
    {
        "id": "prod_3XxtAULYUrX7GVsTKePy",
        "object": "product",
        "patient": "user_Z1zXZKvqrpwxbznuW6lJ",

        "name": "30-min Consultation",
        "description": "30-min consultation with Dr. Smith",
        "category": "appointment",
        "pricing": {
            "is_paid": true,
            "price": 100,
            "recurring": {
                "is_recurring": false,
            },
        },
        "quantity": null,

        "created_by": "user_xeDpGyt67wTor93qKtS7",
        "created_at": 1653798303000,
        "last_updated_at": 1653798303000
    },
  ]
}

DELETE/v2/products/:id

Delete a product

Deletes the specified product. Only delete a product if it has never been used in a transaction (e.g. in an invoice, in the auto-billing).

Required attributes

    Optional attributes

      Response

      {
          "id": "prod_3XxtAULYUrX7GVsTKePy",
          "object": "product",
          "delete": true
      }