Products
At Zūm Rails one product can have one or more prices, these are called product prices and need to be informed at the moment of creating a product. Product prices can have different types of configurations such as Pricing Model and Frequency.
Pricing Models Types
Type | Behavior |
---|---|
Standard | You should select standard pricing if you want to charge your users a fixed price per unit. |
Package | You should select package pricing if you want to charge your users for a group of units. Say you charge $50 for every 10 units. If the user buys 15 units, he will be charged $100 by default. |
Frequency Types
Type | Behavior |
---|---|
OneTime | If this is a product which is available as a one time purchase by paying the full price right now, choose frequency “OneTime”. |
Recurring | If this is a product which is available as a recurring subscription, choose frequency “Recurring". |
#
Creating a new productUse this endpoint if you want to add a new product to your account.
Method: POST
Endpoint: {{env}}/api/product
- Payload for product with one OneTime price
- Payload for product with one Recurring price
Input parameters
Parameter | Type | Mandatory | Description |
---|---|---|---|
Name | string | yes | Product Name |
Description | string | no | Product Description |
Prices | yes | ||
ProductPriceType | string | yes | Price Model |
Price | decimal | yes | Price value |
PerUnit | int | yes (if ProductPriceType is Package) | Package size |
Frequency | decimal | yes | Price frequency |
PlanName | string | yes (if Frequency is recurring) | Recurring plan name |
PlanDescription | string | no | Price frequency |
BillingPeriod | string | yes (if Frequency is recurring) | Billing Period Type |
EnableSubscriptionEndDate | bool | no | Enable subscription end date |
SubscriptionEndDate | date | yes (if EnableSubscriptionEndDate is true) | End date that makes subscription available |
EnableFreeTrial | bool | no | Enable free trial feature |
FreeTrialInDays | int | yes (if EnableFreeTrial is true) | Number of days for free trial |
EnableSetupFee | bool | no | Enable setup fee |
SetupFee | decimal | yes (if EnableSetupFee is true) | Number of days for free trial |
Billing Period Type
Parameter | Type | Description |
---|---|---|
Monthly | string | Sets a monthly recurrence |
Weekly | string | Sets a weekly recurrence |
Biweekly | string | Sets a biweeky recurrence |
Annually | string | Sets an annual recurrence |
#
Uploading a product pictureUse this endpoint if you want to upload a new image to a product.
Method: PATCH
Endpoint: {{env}}/api/product/{{producId}}/uploadproductimage
- Payload
Input parameters
Parameter | Type | Mandatory | Description |
---|---|---|---|
Filename | string | yes | Files name |
Bytes | string | yes | The file's blob |
info
To remove a image send a request with Filename and Bytes values has
null
#
Update a productUse this endpoint if you want to update a new product on your account.
Method: PUT
Endpoint: {{env}}/api/product/{{product_id}}
- Payload
Input parameters
Parameter | Type | Mandatory | Description |
---|---|---|---|
Name | string | yes | Product Name |
Description | string | no | Product Description |
Prices | yes | ||
Id | guid | yes (only if you are editing) | The Id for the product price |
ProductPriceType | string | yes | Price Model |
Price | decimal | yes | Price value |
PerUnit | int | yes (if ProductPriceType is Package) | Package size |
Frequency | decimal | yes | Price frequency |
PlanName | string | yes (if Frequency is recurring) | Recurring plan name |
PlanDescription | string | no | Price frequency |
BillingPeriod | string | yes (if Frequency is recurring) | Billing Period Type |
EnableSubscriptionEndDate | bool | no | Enable subscription end date |
SubscriptionEndDate | date | yes (if EnableSubscriptionEndDate is true) | End date that makes subscription available |
EnableFreeTrial | bool | no | Enable free trial feature |
FreeTrialInDays | int | yes (if EnableFreeTrial is true) | Number of days for free trial |
EnableSetupFee | bool | no | Enable setup fee |
SetupFee | decimal | yes (if EnableSetupFee is true) | Number of days for free trial |
SetToRemove | bool | yes (only if you are editing) | This will remove the product price of the product if set to true |
#
Get a specific productUse this endpoint if you want to get all the information for a specific product.
Method: GET
Endpoint: {{env}}/api/product/{product_id}
- Response
Response
Parameter | Type | Description |
---|---|---|
Id | guid | Product id |
Name | string | Product Name |
Description | string | Product Description |
ProductStatus | string | Status for the product |
ConnectUrl | string | Public url for access to this product |
CreatedAt | date | Creation date |
ProductPrices | ||
Id | string | The Id for the product price |
ProductId | string | The Id for the product on witch is related |
CreatedAt | date | Creation date |
ProductPriceType | string | Price Model |
ProductPriceStatus | string | Status for the product price |
Price | decimal | Price |
PerUnit | string | Package size |
Frequency | string | Price frequency |
PlanName | string | Plan name |
PlanDescription | string | Plan description |
BillingPeriod | string | Billing Period Type |
EnableSubscriptionEndDate | bool | Enable subscription end date |
SubscriptionEndDate | date | End date that makes subscription available |
EnableFreeTrial | bool | Enable free trial feature |
FreeTrialInDays | int | Number of days for free trial |
EnableSetupFee | bool | Enable setup fee |
SetupFee | decimal | Number of days for free trial |
Currency | string | Currency set for the product price |
#
Search a productThis endpoint will return products based on the filter informed. Products are returned with pagination, which means that if you need to retrieve all products you need to call the same endpoint incrementing the CurrentPage.
Method: POST
Endpoint: {{env}}/api/product/filter
- Payload
- Response
Response
Input parameters
Parameter | Type | Mandatory | Description |
---|---|---|---|
GenericSearch | string | no | Filter products by product name or product id |
ProductStatus | string | no | Product status |
CreatedAt | datetime | no | Create date |
CreatedAtOperator | string | no | Operator to filter with CreatedAt properties |
Pagination | no | ||
PageNumber | number | no | The respective page, starting at 1 |
Response
Parameter | Type | Description | |
---|---|---|---|
CurrentPage | number | The current page | |
PageSize | number | The amount of rows returned in the current page | |
TotalCount | number | The total rows the filter returns | |
Items | List of products | ||
Id | guid | The product Id | |
Name | string | The product name | |
Description | string | The product description | |
ProductStatus | string | The status for the product | |
CreatedAt | date | The creation date for the product | |
ProductPrices | List of Product Prices | ||
Id | guid | The product price Id | |
ProductId | guid | The Id for the product where this product price is used | |
CreatedAt | date | The creation date for the product price | |
ProductPriceType | string | The pricing model for the price | |
ProductPriceStatus | string | The status for the product price | |
Price | decimal | Price | |
PerUnit | string | Package size | |
Frequency | string | Price frequency | |
PlanName | string | yes (if Frequency is recurring) | Recurring plan name |
PlanDescription | string | no | Price frequency |
BillingPeriod | string | yes (if Frequency is recurring) | Billing Period Type |
EnableSubscriptionEndDate | bool | no | Enable subscription end date |
SubscriptionEndDate | date | yes (if EnableSubscriptionEndDate is true) | End date that makes subscription available |
EnableFreeTrial | bool | no | Enable free trial feature |
FreeTrialInDays | int | yes (if EnableFreeTrial is true) | Number of days for free trial |
EnableSetupFee | bool | no | Enable setup fee |
SetupFee | decimal | yes (if EnableSetupFee is true) | Number of days for free trial |
Currency | string | Currency selected for the product price | |
Product | Related product | ||
Id | guid | Id for the Product | |
Name | string | Product name | |
Description | string | Product Description | |
ProductStatus | string | Product status | |
CustomerId | guid | Id for the related customer |
tip
If you need to search for a specific product, we recommend that you retrieve the product id and then use the GET specific product endpoint to retrieve the detailed information about the product.
#
Archive a productUse this endpoint if you want to archive a product. Once archived, the product will not be visible in any end user facing screens. If there are any active subscriptions or invoices they will remain until cancelled.
Method: PATCH
Endpoint: {{env}}/api/product/{{product_id}}/archive
- Response
Response
Parameter | Type | Description |
---|---|---|
Id | guid | The product Id |
Name | string | The product name |
Description | string | The product description |
ProductStatus | string | The status for the product |
CreatedAt | date | The creation date for the product |
Use this endpoint if you want to archive a product.
#
Unarchive a productUse this endpoint if you want to unarchive a product. Once unarchive, the product will be visible in any end user facing screens. If there are any active subscriptions or invoices they will remain until unaffected.
Method: PATCH
Endpoint: {{env}}/api/product/{{product_id}}/unarchive
- Response
Response
Parameter | Type | Description |
---|---|---|
Id | guid | The product Id |
Name | string | The product name |
Description | string | The product description |
ProducStatus | string | The status for the product |
CreatedAt | date | The creation date for the product |
#
Delete a productUse this endpoint if you want to delete a product. Once delete, the product will not be visible or available to any end user or administrator.
Method: DELETE
Endpoint: {{env}}/api/product/{{product_id}}
- Response