1

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!

Yogesh Prajapati
  • 4,770
  • 2
  • 36
  • 77
Tiz
  • 680
  • 5
  • 17

1 Answers1

3

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'
pierre
  • 128
  • 6
  • Thanks! We were looking in the API under Accounts, and Subscriptions, rather than bundles. Very much appreciate your help, and welcome to Stack Overflow! – Tiz May 12 '16 at 09:03
  • The persistent use of 'Bob'/'Lazar' as the secret keys throughout documentation and in SO answers is quite chuckleworthy. – Matt Mc Aug 05 '20 at 00:49