Tiz
Tiz

Reputation: 707

Pausing a Kill Bill subscription

We've been using Kill Bill to manage a delivery subscription service. You can sign up to a subscription to receive the items you choose, and be billed monthly.

We want to implement a pause feature so that customers could delay their subscriptions if they went on holiday, for example.

The problem is that we can't figure out how to do that with the API. There's a method to cancel the entitlement (another word for subscription, I think) and one to update it, but nothing obviously related to pausing.
Maybe there's a parameter we need to pass in the update method that we haven't found yet?

You can find the API here, and the majority of the mentions of pausing we could locate in the documentation are on this page.

Any help would be greatly appreciated!

Upvotes: 1

Views: 575

Answers (1)

stephane brossier
stephane brossier

Reputation: 46

There is indeed a pause/resume capability in Kill Bill. This is specified at the bundle level (meaning if you have a bundle with multiple subscriptions they would all be paused/resumed). There is also another mechanism with a lower granularity, but let's start with the basics:

Assuming the following:

  • a tenant 'bob'/'lazar'
  • a bundle with subscriptions whose bundle_id = '627a0b2a-82ef-4d7f-b1c7-a5a94be705bf'

Pause on 2016-05-14 (interpreted in account timezone):

curl -v \
 -X PUT \
 -u admin:password \
 -H "X-Killbill-ApiKey: bob" \
 -H "X-Killbill-ApiSecret: lazar" \
 -H "Content-Type: application/json" \
 -H "X-Killbill-CreatedBy: stephane" \
 'http://127.0.0.1:8080/1.0/kb/bundles/627a0b2a-82ef-4d7f-b1c7-a5a94be705bf/pause?requestedDate=2016-05-14'

Resume on 2016-05-18 (interpreted in account timezone):

curl -v \
 -X PUT \
 -u admin:password \
 -H "X-Killbill-ApiKey: bob" \
 -H "X-Killbill-ApiSecret: lazar" \
 -H "Content-Type: application/json" \
 -H "X-Killbill-CreatedBy: stephane" \
 'http://127.0.0.1:8080/1.0/kb/bundles/627a0b2a-82ef-4d7f-b1c7-a5a94be705bf/resume?requestedDate=2016-05-18'

Upvotes: 3

Related Questions