Subscriptions
List all subscriptions
Lists all subscriptions for the given contact.
Parameters
Parameter | Type | Description |
---|---|---|
contact_id |
Integer |
Required |
Example: lists all subscriptions for a contact
Request
Response
Create a new subscription
Starts a new subscription for the given contact. The product_id
points to a product with a frequency, price and description.
A recurring sales invoice is automatically created to bill the contact for the given frequency. The first invoice will be sent on the
start date, but no sooner than tomorrow. The reference
will be added to the sales invoices.
Optionally you can create a subscription with a different frequency than stored in the product. Make sure the frequency of the product and the provided frequency are compatible. E.g. you can bill a monthly product yearly.
Parameters
Parameter | Type | Description |
---|---|---|
subscription[start_date] |
Date |
Required |
subscription[product_id] |
Integer |
Required Should be a valid product id. |
subscription[amount] |
String |
|
subscription[discount] |
Decimal |
Both a decimal and a string ‘10,95’ are accepted. |
subscription[contact_id] |
Integer |
Should be a valid contact id. |
subscription[contact_person_id] |
Integer |
Should be a valid contact person id. |
subscription[end_date] |
Date |
|
subscription[reference] |
String |
|
subscription[document_style_id] |
Integer |
Should be a valid document style id. |
subscription[frequency] |
Integer |
|
subscription[frequency_type] |
String |
|
subscription[mergeable] |
Boolean |
|
subscription[prices_are_incl_tax] |
Boolean |
Example: creates a new subscription for the contact
Request
Response
Get subscription
Get a subscription.
Example: returns a subscription
Request
Response
Example: returns 404 when the subscription does not exist
Request
Response
Update a subscription
Updates the product the contact is subscribed to. This will automatically calculate the differences between the product prices and create a one off sales invoice to bill the extra charge for the remaining billing period.
Optionally you can provide a start date for the product change to become active.
Parameters
Parameter | Type | Description |
---|---|---|
subscription[contact_person_id] |
String |
Should be a valid contact person id. |
subscription[document_style_id] |
Integer |
Should be a valid document style id. |
subscription[reference] |
String |
|
subscription[mergeable] |
Boolean |
|
subscription[prices_are_incl_tax] |
Boolean |
|
subscription[product_id] |
Integer |
Should be a valid product id. |
subscription[start_date] |
Date |
|
subscription[amount] |
String |
|
subscription[discount] |
Decimal |
Both a decimal and a string ‘10,95’ are accepted. |
Example: updates a subscription
Request
Response
Example: returns a 404 if the subscription couldn't be found
Request
Response
Cancel a subscription
Cancels the subscription. Stops the recurring sales invoice for the contact. Optionally
you can provide an end_date
to stop the subscription on a future date.
Parameters
Parameter | Type | Description |
---|---|---|
subscription[end_date] |
Date |
Example: cancels a subscription for the contact
Request
Response
Create and schedule an invoice to be sent together with the subscription
Besides the recurring sales invoice for the subscription, you sometimes need to bill separate costs like usage based charges. Ideally you want these costs to be on the same invoice as the subscription invoice. This endpoint allows you to put extra invoice details on the subscription invoice.
This endpoint creates a new sales invoice and schedules it for sending on the same date as the next subscription invoice. During sending, Moneybird will merge both the scheduled invoice and the subscription invoice. This means the contact will receive one sales invoice with multiple invoice details, both from the subscription and from the one off sales invoice.
Parameters
Parameter | Type | Description |
---|---|---|
sales_invoice[details_attributes][description] |
String |
|
sales_invoice[details_attributes][period] |
String |
String with a date range: |
sales_invoice[details_attributes][price] |
Decimal |
Both a decimal and a string ‘10,95’ are accepted. |
sales_invoice[details_attributes][amount] |
String |
|
sales_invoice[details_attributes][tax_rate_id] |
Integer |
Should be a valid tax rate id. |
sales_invoice[details_attributes][ledger_account_id] |
Integer |
Should be a valid ledger account id. |
sales_invoice[details_attributes][product_id] |
Integer |
Should be a valid product id. |
sales_invoice[details_attributes][row_order] |
Integer |
|
sales_invoice[invoice_date] |
Date |
Example: creates a sales invoice
Request
Response
Create an additional charge to be invoiced together with the subscription
At the end of the current subscription period, the additional charges are merged where possible and an invoice will be created for them. The invoice will be scheduled for sending together with the subscription invoice, so that they are merged on sending.
Example: create a usage charge
Request
Response
Get additional charges
Get the additional charges of the given subscription.
Parameters
Parameter | Type | Description |
---|---|---|
include_billed |
Boolean |
If true, includes the additional charges that have already been billed. Default is false. |