riverty logo

Docs

Create or Update Subscription Product

Create a new or update an existing subscription product.

Path

PUT /v1/clients/{clientId}/subscription-products/{subscriptionProductId}

Request Parameters

clientId
required
integer
Your assigned `ClientId`.
subscriptionProductId
required
string
Id of the subscription product to retrieve.

Request Body

application/json

required
object
Describes a period of the subscription product.
required
array

Responses

Successful Request, Subscription Product UpdatedSuccessful Request, Subscription Product Created

Request Example

    
        {
 "details": {
  "description": "Home services",
  "productUrl": "https://telecommunicationcompany.com/subscriptions/internet-100-25",
  "imageUrl": "https://telecommunicationcompany.com/images/internet-100-25.png"
 },
 "period": {
  "type": "MONTH",
  "start": {
   "type": "ACTIVATION",
   "day": null,
   "month": null
  }
 },
 "items": [
  {
   "name": "Internet 100M / 25M, monthly fee",
   "description": "Home internet service",
   "price": {
    "grossAmount": 500,
    "vatPercentage": 20
   },
   "trialPrice": {
    "grossAmount": 100
   },
   "metadata": [
    {
     "key": "order-id",
     "value": "9a1a03f5-dbb0-4e32-9fc2-89c9be29780a"
    }
   ],
   "isRefundable": true
  },
  {
   "name": "Router Technicolor DGA4330, monthly fee",
   "description": "Equipment rent",
   "price": {
    "grossAmount": 299,
    "vatPercentage": 15
   },
   "trialPrice": {
    "grossAmount": 110
   },
   "metadata": [
    {
     "key": "order-id",
     "value": "9a1a03f5-dbb0-4e32-9fc2-89c9be29780a"
    }
   ],
   "isRefundable": false
  }
 ],
 "termsAndConditions": {
  "description": "Some description about the terms and conditions for this product.",
  "billingType": "IN_ADVANCE",
  "cancellationType": "AFTER_CURRENT_PERIOD",
  "commitment": {
   "numberOfPeriods": 3,
   "numberOfCycles": 2,
   "endOfCommitmentAction": "CONTINUE_WITHOUT_COMMITMENT"
  }
 },
 "trial": {
  "details": {
   "description": "Free 14 days trial."
  },
  "length": "14_DAYS",
  "isFinanceable": false
 },
 "available": {
  "from": "2022-09-24",
  "until": "2023-09-24"
 },
 "financing": {
  "type": "BILLING"
 }
}
    

Response Example

    
        {
 "id": "subscription-product-id-1",
 "details": {
  "description": "Home services",
  "productUrl": "https://telecommunicationcompany.com/subscriptions/internet-100-25",
  "imageUrl": "https://telecommunicationcompany.com/images/internet-100-25.png"
 },
 "period": {
  "type": "MONTH",
  "start": {
   "type": "ACTIVATION",
   "day": null,
   "month": null
  }
 },
 "items": [
  {
   "name": "Internet 100M / 25M, monthly fee",
   "description": "Home internet service",
   "price": {
    "currencyCode": "NOK",
    "grossAmount": 500,
    "vatPercentage": 20
   },
   "trialPrice": {
    "grossAmount": 100
   },
   "metadata": [
    {
     "key": "order-id",
     "value": "9a1a03f5-dbb0-4e32-9fc2-89c9be29780a"
    }
   ],
   "isRefundable": true
  },
  {
   "name": "Router Technicolor DGA4330, monthly fee",
   "description": "Equipment rent",
   "price": {
    "currencyCode": "NOK",
    "grossAmount": 299,
    "vatPercentage": 15
   },
   "trialPrice": {
    "grossAmount": 110
   },
   "metadata": [
    {
     "key": "order-id",
     "value": "9a1a03f5-dbb0-4e32-9fc2-89c9be29780a"
    }
   ],
   "isRefundable": false
  }
 ],
 "createdAt": "2019-08-24T14:15:22Z",
 "termsAndConditions": {
  "description": "Terms and conditions short text.",
  "billingType": "IN_ADVANCE",
  "cancellationType": "AFTER_CURRENT_PERIOD",
  "commitment": {
   "numberOfPeriods": 3,
   "numberOfCycles": 2,
   "endOfCommitmentAction": "CONTINUE_WITHOUT_COMMITMENT"
  }
 },
 "available": {
  "from": "2022-09-24",
  "until": "2023-09-24"
 },
 "financing": {
  "type": "BILLING"
 },
 "_links": [
  {
   "method": "GET",
   "href": "https://api.riverty.io/subscription/v1/clients/1234/subscription-products/887a7846-2762-46f4-8f38-98d1287e5d28",
   "rel": "self",
   "target": "API"
  }
 ]
}