cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Subscription Billing: cancellation backdated to subscription start

cnorman
Explorer
0 Kudos

Hi Community!

I would like to cancel an SAP Subscription Billing Subscription using a backdated date, meaning a date in the past. Normally I can use the cancellationNoticeDate workaround, but in this case the requestedCancellationDate is equal to the validFrom date of the subscription. The subscription was created on Dec 1, 2020. In this case, I want to see if I can do something without using the withdrawal endpoint (POST /subscriptions/{id}/withdrawal).


Endpoint: POST /subscriptions/{id}/cancellation

Request:
{ "metaData": { "version": 1 }, "requestedCancellationDate": "2020-12-01", "cancellationReason": "Not Paid" }

Response:

{ "status": 400, "type": "business_error", "message": "Changes in the past aren't allowed for this subscription.", "details": [] }

So that is expected. I know that we can use the cancellation notice date as a workaround in most cases, but in this case the backdated date I want to use is also the validFrom date of the subscription.

Request:
{ "metaData": { "version": 1 }, "requestedCancellationDate": "2020-12-01", "cancellationNoticeDate": "2020-11-30", "cancellationReason": "Not Paid" }

Response:
{ "status": 400, "type": "business_error", "message": "Cancellation notice date must not be before valid from date.", "details": [] }

Is the withdrawal endpoint my only option here? I believe I have all scopes set up for my API keys.

Accepted Solutions (1)

Accepted Solutions (1)

former_member727193
Discoverer

Hi Christopher,

are you using the header parameter billing-sb-dates-in-market-timezone?

If not you should pass the "cancellationNoticeDate" as a time stamp, like:

"cancellationNoticeDate": "2020-12-01T05:00:00.000Z". Otherwise date "2020-12-01" is interpreted as "2020-12-01T00:00:00.000Z" which is actually a day before in the markets timezone.

If you want to cancel a subscription at the validFrom date you should use the attribute "overruleTerms" in the cancellation request:

{
    "requestedCancellationDate": "2020-12-01",
    "cancellationNoticeDate": "2020-12-01T05:00:00.000Z",
    "overruleTerms": true,
    "cancellationReason": "anyReason",
    "metaData": {
        "version": "1"
    }
}

We have a standard term/rule that the earliest cancellation date is 1 day after validFrom. So that rule you need to overrule in your case. Therefore you also need the scope "subscription-cancellation_overrule-terms".

If you have further questions let me know.

Regards, Vitali

Answers (1)

Answers (1)

cnorman
Explorer
0 Kudos

Hi Vitali!

I believe I am just sending timestamps in UTC. My market timezone is GMT, and I did not include that header parameter billing-sb-dates-in-market-timezone.

Indeed I was missing the overrule terms for subscription cancellation scope in my API keys. I've updated this and it works now, even without the hours/mins/seconds of a timestamp.

If I take this action, I've noticed that the subscription no longer shows up in the subscriptions app in the UI. Thank you for the answers.

Regards,

Chris