Catalog searching for Service Pricing Option is very similar to the ‘generic’ catalog searching for items, with the difference being that you will either pass in an AppointmentSearchDefiniton, or a specific Instance ID of a Class or Enrollment and a type to find the Service Pricing Option that can pay for them.
See Searchable Service Category Types for a complete list.
New endpoints had to be built to be able to search for Service Pricing Option, as the previous catalog searching endpoints uses OData queries and not predefined search definitions.
Other than that, it works very similarly to Catalog Search in that the search results are built asynchronously and you would first post your search request, then get your results via another API call.
While the results are being built, any validation, masking, or filtering of items due to user permissions and such will be taken into account.
Catalog searching for Service Pricing Options that can pay for an appointment is done by passing a search definition into the Appointment search, or the specific ID and Type to the instance search endpoint.
For example, to find service pricing options that can pay for appointments, I would pass an AppointmentSearchDefinition object into the Sales/{subscriberId}/Catalog/Search/Services/Appointments/PaymentMethods endpoint.
If I wanted to find service pricing options that could pay for specific class or enrollment, I would pass the service type (class or enrollment) along with the specific instance of that service to the Sales/{subscriberId}/Catalog/Search/Services/{ServiceCategoryType}/{InstanceId}/PaymentMethods endpoint.
{ "Start": "2015-01-29T15:29:26.7080553-08:00", "End": "2018-01-29T15:29:26.7080553-08:00", "StaffId": 100000007, "LocationId": 1, "SessionTypeId": 34 }
{ "RequestId": "deafc970-db4c-4378-adf8-f2d9c9efe885", "ExpiresIn": 900 }
{ "Items": [ { "Id": "3097", "Name": "Appt - used at", "Description": null, "Image": null, "Type": "ServicePricingOption", "Links": [], "Templates": [ { "Id": null, "Name": "Pricing", "TemplateType": "Pricing", "Metadata": [ { "Key": "Retail", "Value": "80.0000", "Type": "Decimal", "Label": "Retail", "Rules": [ { "Rule": "Required", "Value": "False" }, { "Rule": "Editable", "Value": "False" } ] }, { "Key": "Online", "Value": "80.0000", "Type": "Decimal", "Label": "Online", "Rules": [ { "Rule": "Required", "Value": "False" }, { "Rule": "Editable", "Value": "False" } ] } ] }, { "Id": null, "Name": "Taxes", "TemplateType": "Taxes", "Metadata": [] }, { "Id": null, "Name": "Series", "TemplateType": "Series", "Metadata": [ { "Key": "ExpirationDate", "Value": null, "Type": "DateTime", "Label": "Expiration Date", "Rules": [] }, { "Key": "FixedActivationDate", "Value": null, "Type": "DateTime", "Label": "FixedActivationDate", "Rules": [] }, { "Key": "DurationValue", "Value": "365", "Type": "Number", "Label": "DurationValue", "Rules": [] }, { "Key": "DurationType", "Value": "Days", "Type": "String", "Label": "DurationType", "Rules": [] }, { "Key": "ActivationType", "Value": "PurchaseDate", "Type": "String", "Label": "ActivationType", "Rules": [] }, { "Key": "SessionCount", "Value": "1", "Type": "Number", "Label": "SessionCount", "Rules": [] }, { "Key": "ConfiguredSessionTypeId", "Value": null, "Type": "Number", "Label": "ConfiguredSessionTypeId", "Rules": [] }, { "Key": "ConfiguredStaffId", "Value": null, "Type": "Number", "Label": "ConfiguredStaffId", "Rules": [] } ] } ], "Options": [], "Rules": [] } ], "NextPageLink": null, "Count": 1 }
{ "RequestId": "6cc11525-2b98-413c-96c5-a2b6e5c62857", "ExpiresIn": 900 }
{ "Items": [ { "Id": "3070", "Name": "Class - No sessions", "Description": null, "Image": null, "Type": "ServicePricingOption", "Links": [], "Templates": [ { "Id": null, "Name": "Pricing", "TemplateType": "Pricing", "Metadata": [ { "Key": "Retail", "Value": "10.0000", "Type": "Decimal", "Label": "Retail", "Rules": [ { "Rule": "Required", "Value": "False" }, { "Rule": "Editable", "Value": "False" } ] }, { "Key": "Online", "Value": "10.0000", "Type": "Decimal", "Label": "Online", "Rules": [ { "Rule": "Required", "Value": "False" }, { "Rule": "Editable", "Value": "False" } ] } ] }, { "Id": null, "Name": "Taxes", "TemplateType": "Taxes", "Metadata": [ { "Key": "1", "Value": "True", "Type": "Bool", "Label": "1", "Rules": [ { "Rule": "Required", "Value": "False" }, { "Rule": "Editable", "Value": "False" } ] } ] }, { "Id": null, "Name": "Series", "TemplateType": "Series", "Metadata": [ { "Key": "ExpirationDate", "Value": null, "Type": "DateTime", "Label": "Expiration Date", "Rules": [] }, { "Key": "FixedActivationDate", "Value": null, "Type": "DateTime", "Label": "FixedActivationDate", "Rules": [] }, { "Key": "DurationValue", "Value": "12", "Type": "Number", "Label": "DurationValue", "Rules": [] }, { "Key": "DurationType", "Value": "Months", "Type": "String", "Label": "DurationType", "Rules": [] }, { "Key": "ActivationType", "Value": "PurchaseDate", "Type": "String", "Label": "ActivationType", "Rules": [] }, { "Key": "SessionCount", "Value": "0", "Type": "Number", "Label": "SessionCount", "Rules": [] }, { "Key": "ConfiguredSessionTypeId", "Value": null, "Type": "Number", "Label": "ConfiguredSessionTypeId", "Rules": [] }, { "Key": "ConfiguredStaffId", "Value": null, "Type": "Number", "Label": "ConfiguredStaffId", "Rules": [] } ] } ], "Options": [], "Rules": [] }, { "Id": "3071", "Name": "Class - Introductory Offer No", "Description": null, "Image": null, "Type": "ServicePricingOption", "Links": [], "Templates": [ { "Id": null, "Name": "Pricing", "TemplateType": "Pricing", "Metadata": [ { "Key": "Retail", "Value": "25.0000", "Type": "Decimal", "Label": "Retail", "Rules": [ { "Rule": "Required", "Value": "False" }, { "Rule": "Editable", "Value": "False" } ] }, { "Key": "Online", "Value": "25.0000", "Type": "Decimal", "Label": "Online", "Rules": [ { "Rule": "Required", "Value": "False" }, { "Rule": "Editable", "Value": "False" } ] } ] }, { "Id": null, "Name": "Taxes", "TemplateType": "Taxes", "Metadata": [ { "Key": "1", "Value": "True", "Type": "Bool", "Label": "1", "Rules": [ { "Rule": "Required", "Value": "False" }, { "Rule": "Editable", "Value": "False" } ] } ] }, { "Id": null, "Name": "Series", "TemplateType": "Series", "Metadata": [ { "Key": "ExpirationDate", "Value": null, "Type": "DateTime", "Label": "Expiration Date", "Rules": [] }, { "Key": "FixedActivationDate", "Value": null, "Type": "DateTime", "Label": "FixedActivationDate", "Rules": [] }, { "Key": "DurationValue", "Value": "36", "Type": "Number", "Label": "DurationValue", "Rules": [] }, { "Key": "DurationType", "Value": "Months", "Type": "String", "Label": "DurationType", "Rules": [] }, { "Key": "ActivationType", "Value": "PurchaseDate", "Type": "String", "Label": "ActivationType", "Rules": [] }, { "Key": "SessionCount", "Value": "1", "Type": "Number", "Label": "SessionCount", "Rules": [] }, { "Key": "ConfiguredSessionTypeId", "Value": null, "Type": "Number", "Label": "ConfiguredSessionTypeId", "Rules": [] }, { "Key": "ConfiguredStaffId", "Value": null, "Type": "Number", "Label": "ConfiguredStaffId", "Rules": [] } ] } ], "Options": [], "Rules": [] }, { "Id": "3072", "Name": "Class - Introductory Offer New clients Only", "Description": null, "Image": null, "Type": "ServicePricingOption", "Links": [], "Templates": [ { "Id": null, "Name": "Pricing", "TemplateType": "Pricing", "Metadata": [ { "Key": "Retail", "Value": "50.0000", "Type": "Decimal", "Label": "Retail", "Rules": [ { "Rule": "Required", "Value": "False" }, { "Rule": "Editable", "Value": "False" } ] }, { "Key": "Online", "Value": "50.0000", "Type": "Decimal", "Label": "Online", "Rules": [ { "Rule": "Required", "Value": "False" }, { "Rule": "Editable", "Value": "False" } ] } ] }, { "Id": null, "Name": "Taxes", "TemplateType": "Taxes", "Metadata": [ { "Key": "1", "Value": "True", "Type": "Bool", "Label": "1", "Rules": [ { "Rule": "Required", "Value": "False" }, { "Rule": "Editable", "Value": "False" } ] } ] }, { "Id": null, "Name": "Series", "TemplateType": "Series", "Metadata": [ { "Key": "ExpirationDate", "Value": null, "Type": "DateTime", "Label": "Expiration Date", "Rules": [] }, { "Key": "FixedActivationDate", "Value": null, "Type": "DateTime", "Label": "FixedActivationDate", "Rules": [] }, { "Key": "DurationValue", "Value": "36", "Type": "Number", "Label": "DurationValue", "Rules": [] }, { "Key": "DurationType", "Value": "Months", "Type": "String", "Label": "DurationType", "Rules": [] }, { "Key": "ActivationType", "Value": "PurchaseDate", "Type": "String", "Label": "ActivationType", "Rules": [] }, { "Key": "SessionCount", "Value": "1", "Type": "Number", "Label": "SessionCount", "Rules": [] }, { "Key": "ConfiguredSessionTypeId", "Value": null, "Type": "Number", "Label": "ConfiguredSessionTypeId", "Rules": [] }, { "Key": "ConfiguredStaffId", "Value": null, "Type": "Number", "Label": "ConfiguredStaffId", "Rules": [] } ] } ], "Options": [], "Rules": [] } ], "NextPageLink": null, "Count": 8 }
The searchable service category types to pass into the route of the service pricing option for a specific instance search call are:
For example, if I wanted to search for service pricing options that can pay for an enrollment, I would pass "Enrollment" into the search route as: .../Sales/{subscriberId}/Catalog/Search/Services/Enrollment/{InstanceId}/PaymentMethods
If I wanted to search for service pricing options that could pay for a specific class I would set the route as:
.../Sales/{subscriberId}/Catalog/Search/Services/Class/{InstanceId}/PaymentMethods
and if I wanted to search against a specific appointment my route would be:
.../Sales/{subscriberId}/Catalog/Search/Services/Appointment/{InstanceId}/PaymentMethods
The AppointmentSearchDefinition is used to search for Service Pricing Options that can pay for appointments