riverty logo

Docs

Get All Discounts

Get all discounts applied to a subscription.

Path

GET /v1/clients/{clientId}/subscriptions/{subscriptionId}/discounts

Request Parameters

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

Responses

Successful RequestUnsuccessful Request, Incorrect/Missing Information

Request Example

    
        null
    

Response Example

    
        [
 {
  "id": "discount-id-1",
  "description": "discount.",
  "type": "PERCENTAGE",
  "value": 12.5,
  "start": "2023-09-10",
  "duration": {
   "type": "REPEATING",
   "count": 5
  },
  "metadata": [
   {
    "key": "order-id",
    "value": "a9ee9996-e941-4aa8-90b9-4b047c4afe87"
   }
  ],
  "createdAt": "2022-09-30T07:29:04.407Z",
  "_links": [
   {
    "method": "GET",
    "href": "https://api.riverty.io/subscription/v1/clients/1234/subscriptions/subscription-id-1/discounts/discount-id-1",
    "rel": "self",
    "target": "API"
   }
  ]
 },
 {
  "id": "discount-id-2",
  "description": "small discount.",
  "type": "PERCENTAGE",
  "value": 12.5,
  "start": "2023-09-10",
  "duration": {
   "type": "REPEATING",
   "count": 5
  },
  "metadata": [
   {
    "key": "order-id",
    "value": "9a1a03f5-dbb0-4e32-9fc2-89c9be29780a"
   }
  ],
  "createdAt": "2022-10-05T07:29:04.407Z",
  "_links": [
   {
    "method": "GET",
    "href": "https://api.riverty.io/subscription/v1/clients/1234/subscriptions/subscription-id-1/discounts/discount-id-2",
    "rel": "self",
    "target": "API"
   }
  ]
 }
]