Skip to content

Cancel subscription-system-provisioned subscription

/subscription_system/cancel_subscription

Target audience: Developers

Cancel subscription system provisioned subscription

Introduction

Cancel a subscription system provisioned subscription. Contact support for more information on how to enable this functionality.

Warning

An unpaid invoice on the current period will result in the subscription being terminated immediately!

Subscription system specifics

Currently available only for Kayak.

No open invoice

If the subscription has no open invoice then the subscription will be cancelled at the end of the current period.

Subscription is paid by Autogiro

If the subscription is paid by Autogiro then the subscription will be cancelled at the end of the current period.

There is an open invoice on the current period

If the current period of the subscription has a unpaid invoice then the subscription will be cancelled immediately and a credit invoice will be created for the unpaid invoice.

There is an open invoice on the upcoming period

If the upcoming period of the subscription has a unpaid invoice then the subscription will be cancelled at the end of the current period and a credit invoice will be created for the unpaid invoice.

URI

Environment URI
Stage https://payway-api.stage.adeprimo.se/external/api/v1/subscription_system/cancel_subscription
Production https://backend.worldoftulo.com/external/api/v1/subscription_system/cancel_subscription

Requirements

Identity Scope
No /external/subscription_system/w

Parameters

Field Required Type Description
account_id Required String The account id for the account that owns the subscription.
Size range: ..24
Allowed values: "/^[a-f\d]{24}$/i"
user_product_id Required String The id of the subscription to cancel.
Size range: ..24
Allowed values: "/^[a-f\d]{24}$/i"
cancellation_reason_id Required String The cancellation reason id.
Size range: ..24
Allowed values: "/^[a-f\d]{24}$/i"

Curl Example

curl --request PUT \
  --url https://payway-api.stage.adeprimo.se/external/api/v1/subscription_system/cancel_subscription \
  --header 'accept: application/json' \
  --header 'authorization: Bearer token' \
  --header 'content-type: application/json' \
  --data '{
              "account_id": "5cb804811d41c82b5c518ea1",
              "user_product_id": "5cb804811d41c82b5c518ea2",
              "cancellation_reason_id": "5cb804811d41c82b5c518ea3"
          }'

Response

Field Description
user_product_id The id of the cancelled subscription.
cancellation_type "at_end_of_period" or "immediate"
subscription_end_date When the subscription ends

Example Response: Successfully accepted shared subscription

HTTP 200 Updated
{
    "item": {
      "user_product_id": "50f3ac249f6aef294d000007",
      "cancellation_type": "at_end_of_period",
      "subscription_end_date": "2024-01-12T23:59:59.000+01:00"
    }
}

Errors

This API uses the common error conventions of the Payway API

See common error responses