Subscriptions
#
Creating a new subscriptionUse this endpoint if you want to add a new subscription.
Method: POST
Endpoint: {{env}}/api/subscription
- Payload
- Payload for scheduled subscription
- Response
Input parameters
Parameter | Type | Mandatory | Description |
---|---|---|---|
AnnuallyBillingDay | int | yes | Billing day for annual product prices (1-28) |
AnnuallyBillingMonth | int | yes | Billing month for annual product price (0-11) |
BillingDay | int | yes | Billing day for monthly product prices (1-28) |
DueDay | int | yes | Days to due date |
InvoicePaymentType | int | yes | Payment Type Operator |
LastDayOfTheMonth | boolean | no | Set to true if you to use the last day of the month to be used has a billing day (can be used with monthly and annual product prices) |
Memo | string | no | Memo that will be reflect on invoices and transactions |
Quantity | int | yes | Desired quantity for the product |
PaymentGateways | string[] | yes | Payment gateways through witch the subscription will be processed |
ProductPriceId | guid | yes | Id for the product price |
UserId | guid | yes | Id for the user that will be charged for the subscription |
StartDateType | string | no | Start Date Type Operator |
StartDate | date | yes (if start date type custom is selected) | Desired start date |
EndDateType | string | no | End Date Type Operator |
EndDate | date | yes (if end date type custom is selected) | Desired end date |
BillingCycle | int | yes (if end date type billing cycles is selected) | Desired number od billing cycles |
TaxRates | no | Tax rates that will be included on the subscription | |
Id | guid | no | Id for the tax rate |
Name | string | no | Name for the tax rate |
Description | string | no | Description for the tax rate |
Type | string | no | The type is "Exclusive" or "Inclusive" |
Value | int | no | The tax value in percentage |
ClassName | string | no | The class name value is "TaxRate" |
CommonFees | no | Fees that will be included on the subscription | |
Id | guid | no | Id for the common fee |
Name | string | no | Name for the common fee |
Description | string | no | Description for the common fee |
Value | int | no | The value for the common fee |
ClassName | string | no | The class name value is "CommonFee" |
info
Differently from invoices, subscriptions only accept one product, witch can only be of the recurrent type
PaymentType
Type | Behavior |
---|---|
AutomaticallyCharge | Automatically charge the user by initiating a transaction has soon as possible on the selected Rails |
NotifyUser | Email invoice to the user to pay manually |
PaymentGateway
Type | Behavior |
---|---|
Eft | Process through Eft |
Interac | Process through Interac |
VisaDirect | Process through VisaDirect |
CreditCard | Process through CreditCard |
Start Date Type
Type | Behavior |
---|---|
CustomStartDate | Set a custom start date |
NextMonth | Set to the first day of the next month |
FirstInvoiceDate | Set to the first invoice date based on the invoice date calculation |
End Date Type
Type | Behavior |
---|---|
CustomEndDate | Set a custom end date |
BillingCycles | Set the number of billing cycles upon witch the end date will be calculated |
Never | Never ends the subscription |
Response
Parameter | Type | Description |
---|---|---|
Id | guid | Id for the subscription |
Total | decimal | Total amount for the subscription |
CreatedAt | date | Creation date for the subscription |
ProductName | string | Name for the product related to subscription |
SubscriptionStatus | string | Subscription status |
Customer | Basic Customer data | |
CompanyName | string | Company Name |
Id | guid | Id for the related customer |
User | Basic User data | |
FirstName | string | User first name |
LastName | string | User Last name |
CompanyName | string | User Company |
IsActive | boolean | Indicates if the user is active or not |
string | User email | |
Id | guid | Id for the user that is related to the subscription |
ProductPrice | Product price related to product | |
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 |
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 |
EnableSubscriptionEndDate | boolean | Enable subscription end date |
SubscriptionEndDate | date | Subscription end date |
Product | Product related to product price | |
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 |
TaxRates | Tax rates that will be included on the subscription | |
Id | guid | Id for the tax rate |
Name | string | Name for the tax rate |
Description | string | Description for the tax rate |
Type | string | The type is "Exclusive" or "Inclusive" |
Value | int | The tax value in percentage |
ClassName | string | The class name value is "TaxRate" |
CommonFees | Fees that will be included on the subscription | |
Id | guid | Id for the common fee |
Name | string | Name for the common fee |
Description | string | Description for the common fee |
Value | int | The value for the common fee |
ClassName | string | The class name value is "CommonFee" |
#
Update a subscriptionUse this endpoint if you want to update a new subscription.
Method: PUT
Endpoint: {{env}}/api/subscription/{{subscription_id}}
Zūm supports changing existing subscriptions without having to cancel and recreate them. Some of the most significant changes you might make are:
Changing the quantity of products within the subscription Changing the method/way of payment collection
- Payload
- Response
Input parameters
Parameter | Type | Mandatory | Description |
---|---|---|---|
Id | guid | yes | Id for the subscription |
AnnuallyBillingDay | int | yes | Billing day for annual product prices (1-28) |
AnnuallyBillingMonth | int | yes | Billing month for annual product price (0-11) |
BillingDay | int | yes | Billing day for monthly product prices (1-28) |
DueDay | int | yes | Days to due date |
InvoicePaymentType | int | yes | Payment Type Operator |
LastDayOfTheMonth | boolean | no | Set to true if you to use the last day of the month to be used has a billing day (can be used with monthly and annual product prices) |
Memo | string | no | Memo that will be reflect on invoices and transactions |
Quantity | int | yes | Desired quantity for the product |
PaymentGateways | string[] | yes | Payment gateways through witch the subscription will be processed |
ProductPriceId | guid | yes | Id for the product price |
UserId | guid | yes | Id for the user that will be charged for the subscription |
StartDateType | string | no | Start Date Type Operator |
StartDate | date | yes (if start date type custom is selected) | Desired start date |
EndDateType | string | no | End Date Type Operator |
EndDate | date | yes (if end date type custom is selected) | Desired end date |
BillingCycle | int | yes (if end date type billing cycles is selected) | Desired number od billing cycles |
TaxRates | no | Tax rates that will be included on the subscription | |
Id | guid | no | Id for the tax rate |
Name | string | no | Name for the tax rate |
Description | string | no | Description for the tax rate |
Type | string | no | The type is "Exclusive" or "Inclusive" |
Value | int | no | The tax value in percentage |
ClassName | string | no | The class name value is "TaxRate" |
CommonFees | no | Fees that will be included on the subscription | |
Id | guid | no | Id for the common fee |
Name | string | no | Name for the common fee |
Description | string | no | Description for the common fee |
Value | int | no | The value for the common fee |
ClassName | string | no | The class name value is "CommonFee" |
Response
Parameter | Type | Description |
---|---|---|
Id | guid | Id for the subscription |
Total | decimal | Total amount for the subscription |
CreatedAt | date | Creation date for the subscription |
ProductName | string | Name for the product related to subscription |
SubscriptionStatus | string | Subscription status |
Customer | Basic Customer data | |
CompanyName | string | Company Name |
Id | guid | Id for the related customer |
User | Basic User data | |
FirstName | string | User first name |
LastName | string | User Last name |
CompanyName | string | User Company |
IsActive | boolean | Indicates if the user is active or not |
string | User email | |
Id | guid | Id for the user that is related to the subscription |
ProductPrice | Product price related to product | |
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 |
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 |
EnableSubscriptionEndDate | boolean | Enable subscription end date |
SubscriptionEndDate | date | Subscription end date |
Product | Product related to product price | |
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 |
TaxRates | Tax rates that will be included on the subscription | |
Id | guid | Id for the tax rate |
Name | string | Name for the tax rate |
Description | string | Description for the tax rate |
Type | string | The type is "Exclusive" or "Inclusive" |
Value | int | The tax value in percentage |
ClassName | string | The class name value is "TaxRate" |
CommonFees | Fees that will be included on the subscription | |
Id | guid | Id for the common fee |
Name | string | Name for the common fee |
Description | string | Description for the common fee |
Value | int | The value for the common fee |
ClassName | string | The class name value is "CommonFee" |
#
Get a specific subscriptionUse this endpoint if you want to get all the information for a specific subscription.
Method: GET
Endpoint: {{env}}/api/subscription/{subscription_id}
- Response
Response
Parameter | Type | Description |
---|---|---|
Id | guid | Id for the subscription |
Total | decimal | Total amount for the subscription |
CreatedAt | date | Creation date for the subscription |
ProductName | string | Name for the product related to subscription |
SubscriptionStatus | string | Subscription status |
AnnuallyBillingDay | int | Billing day for annual product prices (1-28) |
AnnuallyBillingMonth | int | Billing month for annual product price (0-11) |
BillingDay | int | Billing day for monthly product prices (1-28) |
DueDay | int | Days to due date |
InvoicePaymentType | int | Payment Type Operator |
LastDayOfTheMonth | boolean | Set to true if you to use the last day of the month to be used has a billing day (can be used with monthly and annual product prices) |
Memo | string | Memo that will be reflect on invoices and transactions |
Quantity | int | Desired quantity for the product |
PaymentGateways | string[] | Payment gateways through witch the subscription will be processed |
ProductPriceId | guid | Id for the product price |
UserId | guid | Id for the user that will be charged for the subscription |
StartDateType | string | Start Date Type Operator |
StartDate | date | Desired start date |
EndDateType | string | End Date Type Operator |
EndDate | date | Desired end date |
BillingCycle | int | Desired number od billing cycles |
Customer | Basic Customer data | |
CompanyName | string | Company Name |
Id | guid | Id for the related customer |
User | Basic User data | |
FirstName | string | User first name |
LastName | string | User Last name |
CompanyName | string | User Company |
IsActive | boolean | Indicates if the user is active or not |
string | User email | |
Id | guid | Id for the user that is related to the subscription |
ProductPrice | Product price related to product | |
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 |
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 |
EnableSubscriptionEndDate | boolean | Enable subscription end date |
SubscriptionEndDate | date | Subscription end date |
Product | Product related to product price | |
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 |
#
Search a subscriptionThis endpoint will return subscriptions based on the filter informed. Subscriptions are returned with pagination, which means that if you need to retrieve all subscriptions you need to call the same endpoint incrementing the CurrentPage.
Method: POST
Endpoint: {{env}}/api/subscription/filter
- Payload
- Response
Input parameters
Parameter | Type | Mandatory | Description |
---|---|---|---|
GenericSearch | string | no | Filter subscription by subscription id, user name and user email |
SubscriptionStatus | string | no | Subscription status |
CreatedAt | datetime | no | Create date |
CreatedAtOperator | string | no | Operator to filter with CreatedAt properties |
UserName | string | no | Username value |
UserNameOperator | string | no | Username Operator |
Pagination | no | ||
PageNumber | number | no | The respective page, starting at 1 |
ItemsPerPage | number | no | The quantity of items per page |
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 subscriptions | |
Id | guid | Id for the subscription |
Total | decimal | Total amount for the subscription |
CreatedAt | date | Creation date for the subscription |
ProductName | string | Name for the product related to subscription |
SubscriptionStatus | string | Subscription status |
Customer | Basic Customer data | |
CompanyName | string | Company Name |
Id | guid | Id for the related customer |
User | Basic User data | |
FirstName | string | User first name |
LastName | string | User Last name |
CompanyName | string | User Company |
IsActive | boolean | Indicates if the user is active or not |
string | User email | |
Id | guid | Id for the user that is related to the subscription |
ProductPrice | Product price related to product | |
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 |
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 |
EnableSubscriptionEndDate | boolean | Enable subscription end date |
SubscriptionEndDate | date | Subscription end date |
Product | Product related to product price | |
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 |
#
Cancel a subscriptionUse this endpoint if you want to cancel a subscription.
Method: PUT
Endpoint: {{env}}/api/subscription/cancel/{{subscription_id}}
- Payload
- Response
Input parameters
Parameter | Type | Mandatory | Description |
---|---|---|---|
CancellationReason | string | no | CancellationReason |
CancellationType | string | no | Cancellation Type |
CustomCancellationDate | datetime | yes (only if CancellationReason is CustomDate) | Desired cancellation date |
CustomCancellationReason | string | yes (only if CancellationReason is Other) | Description for the cancellation reason |
RefundLastInvoice | bool | no | Refund the last processed Invoice |
Cancellation Reasons
Type | Description |
---|---|
TooExpensive | This is too expensive |
Accident | This was created by accident |
DifferentProduct | I want a different product/variety |
NoNeed | I no longer need this product |
Sooner | I need it sooner |
Other | Other |
Cancellation Type
Type | Behavior |
---|---|
Immediately | Cancel the subscription right away |
EndOfCurrentPeriod | Wait for the next billing period and then cancels the subscription |
CustomDate | Set the cancellation to a chosen date |
#
Pause a subscriptionUse this endpoint if you want to pause a subscription.
Method: PUT
Endpoint: {{env}}/api/subscription/pause/{{subscription_id}}
caution
Subscriptions that are paused will not generate any invoices until resumed.
- Payload (Indefinite Pause)
- Payload (Custom Date Pause)
- Response
Input parameters
Parameter | Type | Mandatory | Description |
---|---|---|---|
PauseDuration | PauseDuration | yes | Pause Duration |
ResumeDate | datetime | no | Set a resume date for the subscriptions. This should be used only if setting a CustomDate pause duration |
Pause Duration
Type | Description |
---|---|
Indefinite | With this configuration the subscription will never be automatically resumed |
CustomDate | With this configuration you can set a given resume date for the subscription |
#
Resume a subscriptionUse this endpoint if you want to resume a subscription.
Method: PUT
Endpoint: {{env}}/api/subscription/resume/{{subscription_id}}
- Response
#
Get subscription eventsUse this endpoint if you want to get all the subscription events related to a specific subscription.
Method: GET
Endpoint: {{env}}/api/subscription/getsubscriptionevents/{{subscription_id}}
- Response
Response
A list of:
Parameter | Type | Description |
---|---|---|
InvoiceId | guid | Id for the subscription |
CreatedAt | date | Creation date for the subscription event |
Description | string | User friendly description for the event |
Type | string | Event Type |
Subscription Event Type
Type | Behavior |
---|---|
Created | Subscription was created |
Updated | Subscription was edited |
StatusChanged | Subscription status was changed |
#
Get subscription invoicesUse this endpoint if you want to get all the invoices related to a specific subscription.
Method: GET
Endpoint: {{env}}/api/subscription/getsubscriptioninvoices/{{subscription_id}}
- Response
Response
A list of:
Parameter | Type | Description |
---|---|---|
Id | guid | Id for the invoice |
Amount | decimal | Total amount for the invoice |
CreatedAt | date | Creation date for the invoice |
CustomerId | guid | Id for the related customer |
DaysToDueDate | int | Days until due date from the creation date |
DueDate | date | Due date |
InvoiceStatus | string | Invoice status |
Memo | string | Memo that will be reflected on the transactions |
PaymentType | string | PaymentType Operator |
PaymentGateways | string[] | PaymentGateways Operator |
UserId | guid | Id for the user that is related to the invoice |
Customer | Basic Customer data | |
CompanyName | string | Company Name |
Id | guid | Id for the related customer |
User | Basic User data | |
FirstName | string | User first name |
LastName | string | User Last name |
CompanyName | string | User Company |
IsActive | boolean | Indicates if the user is active or not |
string | User email | |
Id | guid | Id for the user that is related to the invoice |
Items | ||
OneOffProductName | string | Name for the one-off product |
OneOffProductAmount | decimal | Amount for each unit or package |
Quantity | int | Quantity for the product price |
Currency | string | Currency set for the product price |
Price | decimal | Price amount for each unit or package |
ProductPriceId | guid | Id for the related product price |
ProductPrice | Product price related to product | |
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 |
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 |
Product | Product related to product price | |
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 |
Transactions | Transactions related to the invoice | |
Id | guid | Id for the transaction |
Amount | decimal | Total amount for the transaction |
Comment | string | Comment fo the transaction |
CreatedAt | date | Creation date for the transaction |
From | string | From description for the transaction |
InvoiceId | guid | Id for the related Invoice |
IsRefundable | boolean | Indicates if the transaction is IsRefundable |
Memo | string | Memo for the transaction |
To | string | To description for the transaction |
TransactionMethod | string | Transaction method for the transaction |
TransactionStatus | string | Status for the transaction |
ZumRailsType | string | ZumRailsType Operator for the transaction |