Skip to content

Subscriptions

Manage subscriptions in Moneybird.

Working with Subscriptions

This section covers how to interact with Moneybird’s Subscriptions API. You can create, retrieve, update, and delete subscriptions, as well as perform various actions such as pausing, resuming, and duplicating.

Basic Operations

Get a Subscription

Retrieve a subscription by its ID.

$subscription = $client->subscriptions()->get('123456789');

List Subscriptions

Get a paginated list of subscriptions.

$subscriptions = $client->subscriptions()->paginate();
// Iterate through the pages
foreach ($subscriptions as $subscription) {
echo $subscription->reference . ': ' . $subscription->frequency_type;
}

Create a Subscription

Create a new subscription.

$data = [
'contact_id' => '123456789',
'product_id' => '987654321',
'reference' => 'Monthly Service',
'start_date' => '2023-01-01',
'discount' => '10',
'amount' => '1x'
];
$subscription = $client->subscriptions()->create($data);

Update a Subscription

Update an existing subscription.

$updateData = [
'reference' => 'Updated Monthly Service',
'discount' => '15'
];
$subscription = $client->subscriptions()->update('123456789', $updateData);

Delete a Subscription

Delete a subscription.

$client->subscriptions()->delete('123456789');

Subscription Actions

Pause a Subscription

Pause an active subscription.

$subscription = $client->subscriptions()->pause('123456789');

Resume a Subscription

Resume a paused subscription.

$subscription = $client->subscriptions()->resume('123456789');

Reactivate a Subscription

Reactivate a cancelled subscription.

$subscription = $client->subscriptions()->reactivate('123456789');

Duplicate a Subscription

Create a duplicate of a subscription.

$duplicateSubscription = $client->subscriptions()->duplicate('123456789');

Subscription Properties

When working with subscriptions, you’ll have access to the following properties:

PropertyTypeDescription
idstringUnique identifier
administration_idstringID of the administration the subscription belongs to
start_datestringDate when the subscription starts
end_datestringDate when the subscription ends (null if ongoing)
frequencyintFrequency number (e.g., 1, 3, 6)
frequency_typestringFrequency unit (e.g., ‘month’, ‘year’)
referencestringReference text for the subscription
cancelled_atstringDate when the subscription was cancelled (null if active)
product_idstringID of the product associated with the subscription
productarrayProduct information
contact_idstringID of the contact associated with the subscription
contactarrayContact information
contact_person_idstringID of the contact person
contact_personarrayContact person information
subscription_productsarrayProducts included in the subscription
recurring_sales_invoice_idstringID of the recurring sales invoice

Note: See the official API reference for the complete list of available properties.

Further reading