diff --git a/source/account.html.md b/source/account.html.md index 10c786f..ddc5dab 100644 --- a/source/account.html.md +++ b/source/account.html.md @@ -32,6 +32,8 @@ menu_items: - aviate-health - aviate-metering - aviate-wallet + - aviate-coupons + title: Kill Bill diff --git a/source/admin.html.md b/source/admin.html.md index e04c824..2d2e817 100644 --- a/source/admin.html.md +++ b/source/admin.html.md @@ -31,7 +31,9 @@ menu_items: - aviate-catalog - aviate-health - aviate-metering - - aviate-wallet + - aviate-wallet + - aviate-coupons + title: Kill Bill diff --git a/source/aviate-auth.html.md b/source/aviate-auth.html.md index af3729c..021da03 100644 --- a/source/aviate-auth.html.md +++ b/source/aviate-auth.html.md @@ -32,6 +32,7 @@ menu_items: - aviate-health - aviate-metering - aviate-wallet + - aviate-coupons title: Kill Bill diff --git a/source/aviate-catalog.html.md b/source/aviate-catalog.html.md index bb9abc3..5835090 100644 --- a/source/aviate-catalog.html.md +++ b/source/aviate-catalog.html.md @@ -32,6 +32,7 @@ menu_items: - aviate-health - aviate-metering - aviate-wallet + - aviate-coupons title: Kill Bill diff --git a/source/aviate-coupons.html.md b/source/aviate-coupons.html.md new file mode 100644 index 0000000..0a9abd3 --- /dev/null +++ b/source/aviate-coupons.html.md @@ -0,0 +1,54 @@ +--- +includes: + - aviate-coupons + +current_page: aviate-coupons + +menu_items: + - index + - tenant + - catalog + - account + - payment-method + - subscription + - bundle + - invoice + - invoice-item + - credit + - payment + - payment-transaction + - invoice-payment + - usage + - custom-field + - tag + - tag-definition + - export + - admin + - security + - overdue + - test + - aviate-auth + - aviate-catalog + - aviate-health + - aviate-metering + - aviate-wallet + - aviate-coupons + +title: Kill Bill + +language_tabs: + - shell + - java + - ruby + - python + - javascript + - php + +toc_footers: + - Report a doc problem + +search: true + +code_clipboard: true + +--- \ No newline at end of file diff --git a/source/aviate-health.html.md b/source/aviate-health.html.md index 349df49..c1bf34e 100644 --- a/source/aviate-health.html.md +++ b/source/aviate-health.html.md @@ -32,6 +32,7 @@ menu_items: - aviate-health - aviate-metering - aviate-wallet + - aviate-coupons title: Kill Bill diff --git a/source/aviate-metering.html.md b/source/aviate-metering.html.md index 8ae2cff..a7b9e56 100644 --- a/source/aviate-metering.html.md +++ b/source/aviate-metering.html.md @@ -32,6 +32,7 @@ menu_items: - aviate-health - aviate-metering - aviate-wallet + - aviate-coupons title: Kill Bill diff --git a/source/aviate-wallet.html.md b/source/aviate-wallet.html.md index e95a6b3..319b264 100644 --- a/source/aviate-wallet.html.md +++ b/source/aviate-wallet.html.md @@ -32,6 +32,7 @@ menu_items: - aviate-health - aviate-metering - aviate-wallet + - aviate-coupons title: Kill Bill diff --git a/source/bundle.html.md b/source/bundle.html.md index 14e4af2..54898d5 100644 --- a/source/bundle.html.md +++ b/source/bundle.html.md @@ -32,6 +32,7 @@ menu_items: - aviate-health - aviate-metering - aviate-wallet + - aviate-coupons title: Kill Bill diff --git a/source/catalog.html.md b/source/catalog.html.md index 274f43d..e95f660 100644 --- a/source/catalog.html.md +++ b/source/catalog.html.md @@ -32,6 +32,7 @@ menu_items: - aviate-health - aviate-metering - aviate-wallet + - aviate-coupons title: Kill Bill diff --git a/source/credit.html.md b/source/credit.html.md index 589aaf5..c5ce761 100644 --- a/source/credit.html.md +++ b/source/credit.html.md @@ -32,6 +32,7 @@ menu_items: - aviate-health - aviate-metering - aviate-wallet + - aviate-coupons title: Kill Bill diff --git a/source/custom-field.html.md b/source/custom-field.html.md index 2088fda..6ac18d9 100644 --- a/source/custom-field.html.md +++ b/source/custom-field.html.md @@ -32,6 +32,7 @@ menu_items: - aviate-health - aviate-metering - aviate-wallet + - aviate-coupons title: Kill Bill diff --git a/source/export.html.md b/source/export.html.md index fe9db4d..09b9901 100644 --- a/source/export.html.md +++ b/source/export.html.md @@ -32,6 +32,7 @@ menu_items: - aviate-health - aviate-metering - aviate-wallet + - aviate-coupons title: Kill Bill diff --git a/source/includes/_aviate-coupons.md b/source/includes/_aviate-coupons.md new file mode 100644 index 0000000..f3ab51c --- /dev/null +++ b/source/includes/_aviate-coupons.md @@ -0,0 +1,306 @@ +# Aviate Coupons + +The [Aviate Coupons feature](https://docs.killbill.io/latest/aviate-coupons) provides endpoints that allow you to create and manage coupons. Coupons are reusable discounts that can be redeemed by customers during subscription creation or update. This section documents the APIs exposed by the Aviate Coupons feature. + +## Before You Begin + +### Authentication + +The Aviate Plugin uses a JWT-based authentication mechanism. All the APIs listed in this document require a valid token, which can be obtained via the [Auth API](aviate-auth.html). + +--- + +## Resources + +This section lists the models used by the Aviate Coupon APIs. + +### CouponInput + +Represents the input payload for creating a new coupon. + +| Name | Type | Required | Description | +|----------------------|-----------|----------|-----------------------------------------------------------------------------------| +| `redemptionCode` | `string` | yes | Unique redemption code for the coupon | +| `reusable` | `boolean` | yes | Whether the coupon can be reused multiple times by the same customer | +| `maxUse` | `integer` | yes | Max number of times a coupon can be redeemed by customers | +| `discountType` | `string` | yes | Discount type: `DISCOUNT_TYPE_FIXED` or `DISCOUNT_TYPE_PERCENTAGE` | +| `discountPrice` | `string` | no | Fixed discount amount (required if `discountType` = FIXED) | +| `discountCurrency` | `string` | no | Currency for fixed discount (required if `discountType` = FIXED) | +| `discountPercentage` | `number` | no | Percentage discount (required if `discountType` = PERCENTAGE) | +| `expirationDate` | `string` (date-time) | no | Optional expiration date | +| `planList` | `array` of `string` | no | Optional list of plan names where the coupon is applicable | + +--- + +### Coupon + +Represents a coupon that can be redeemed. + + +| Name | Type | Description | +|----------------------|-----------|-----------------------------------------------------------------------| +| `redemptionCode` | `string` | Unique redemption code | +| `reusable` | `boolean` | Whether the coupon can be reused multiple times by the same customer| +| `maxUse` | `integer` | Max number of times a coupon can be redeemed by customers | +| `discountType` | `string` | Discount type | +| `discountPrice` | `string` | Fixed discount amount | +| `discountCurrency` | `string` | Currency for fixed discount | +| `discountPercentage` | `number` | Percentage discount | +| `expirationDate` | `string` (date-time) | Expiration date | +| `planList` | `array` | Applicable plan names | +| `createdDate` | `string` (date-time) | Date when the coupon was created | +| `archived` | `boolean` | Whether the coupon is archived | + +--- + +### CouponResponse + +Represents the response returned after creating a coupon. + +| Name | Type | Description | +|-----------------|----------------------|--------------------------------------------------| +| `coupon` | [`Coupon`](#coupon) | Coupon object | +| `status` | `string` | `SUCCESS` or `FAILED` | +| `errorMessage` | `string` | Error message when status = FAILED | + +--- + +## Coupon APIs + +### Create a Coupon + +Create a new coupon with the given attributes. + +**HTTP Request** + +`POST /plugins/aviate-plugin/v1/coupon` + +> Example Request: + +```shell +curl -X POST \ + -H "Authorization: Bearer ${ID_TOKEN}" \ + -H 'X-Killbill-ApiKey: bob' \ + -H 'X-Killbill-ApiSecret: lazar' \ + -H 'Content-Type: application/json' \ + -d '{ + "redemptionCode": "UPGRADE2025", + "reusable": true, + "maxUse": 100, + "discountType": "DISCOUNT_TYPE_FIXED", + "discountPrice": "10.00", + "discountCurrency": "USD", + "expirationDate": "2025-12-31T00:00:00Z", + "planList": ["premium-monthly", "premium-annual"] + }' \ + http://127.0.0.1:8080/plugins/aviate-plugin/v1/coupon +``` + + +```java +``` + +```ruby +``` + +```python +``` + +````php +```` + +````javascript +```` + +> Example Response: + +Returns `201` with a `CouponResponse` object. + +```json +{ + "coupon": { + "redemptionCode": "UPGRADE2025", + "reusable": true, + "maxUse": 100, + "discountType": "DISCOUNT_TYPE_FIXED", + "discountPrice": "10.00", + "discountCurrency": "USD", + "expirationDate": "2025-12-31T00:00:00Z", + "planList": ["premium-monthly", "premium-annual"], + "createdDate": "2025-08-02T10:00:00Z", + "archived": false + }, + "status": "SUCCESS", + "errorMessage": null +} +``` + + +### List Coupons + +Retrieve all existing coupons, optionally including expired or archived coupons. + +**HTTP Request** + +`GET /plugins/aviate-plugin/v1/coupon` + +Query Parameters + +| Name | Type | Required | Default | Description +|-----------------|----------------|----------|--------------|--------------------------| +| includeArchived | boolean | false | false | Include archived coupons in the response +| includeExpired | boolean | false | false | Include expired coupons in the response +--- + +> Example Request: + +```shell +curl -X GET \ + -H "Authorization: Bearer ${ID_TOKEN}" \ + -H 'X-Killbill-ApiKey: bob' \ + -H 'X-Killbill-ApiSecret: lazar' \ + http://127.0.0.1:8080/plugins/aviate-plugin/v1/coupon?includeArchived=false&includeExpired=true +``` + +```java +``` + +```ruby +``` + +```python +``` + +````php +```` + +````javascript +```` + +> Example Response: + +```json +[ + { + "redemptionCode": "UPGRADE2025", + "reusable": true, + "maxUse": 100, + "discountType": "DISCOUNT_TYPE_FIXED", + "discountPrice": "10.00", + "discountCurrency": "USD", + "expirationDate": "2025-12-31T00:00:00Z", + "planList": ["premium-monthly", "premium-annual"], + "createdDate": "2025-08-02T10:00:00Z", + "archived": false + }, + { + "redemptionCode": "BLACKFRIDAY", + "reusable": false, + "maxUse": 100, + "discountType": "DISCOUNT_TYPE_PERCENTAGE", + "discountPercentage": 20, + "expirationDate": "2025-11-30T23:59:59Z", + "planList": [], + "createdDate": "2025-07-15T12:00:00Z", + "archived": false + } +] +``` + + +### Get Coupon by Redemption Code + +Retrieve details of a specific coupon. + +**HTTP Request** + + +`GET /plugins/aviate-plugin/v1/coupon/redemptionCode/{redemptionCode}` + +> Example Request: + +```shell +curl -X GET \ + -H "Authorization: Bearer ${ID_TOKEN}" \ + -H 'X-Killbill-ApiKey: bob' \ + -H 'X-Killbill-ApiSecret: lazar' \ + http://127.0.0.1:8080/plugins/aviate-plugin/v1/coupon/redemptionCode/UPGRADE2025 +``` + + +```java +``` + +```ruby +``` + +```python +``` + +```php +``` + +```javascript +``` + +> Example Response: + +```json +{ + "redemptionCode": "UPGRADE2025", + "reusable": true, + "maxUse": 100, + "discountType": "DISCOUNT_TYPE_FIXED", + "discountPrice": "10.00", + "discountCurrency": "USD", + "expirationDate": "2025-12-31T00:00:00Z", + "planList": ["premium-monthly", "premium-annual"], + "createdDate": "2025-08-02T10:00:00Z", + "archived": false +} +``` + +### Archive a Coupon + +Archive a coupon so that it can no longer be redeemed. + +**HTTP Request** + +`PUT /plugins/aviate-plugin/v1/coupon/{redemptionCode}/archive` + +> Example Request: + +```shell +curl -X PUT \ + -H "Authorization: Bearer ${ID_TOKEN}" \ + -H 'X-Killbill-ApiKey: bob' \ + -H 'X-Killbill-ApiSecret: lazar' \ + http://127.0.0.1:8080/plugins/aviate-plugin/v1/coupon/UPGRADE2025/archive +``` + + +```java +``` + +```ruby +``` + +```python +``` + +```php +``` + +```javascript +``` + +> Example Response: + +```json +{ + "status": "SUCCESS" +} +``` + + +Returns HTTP 200 on success \ No newline at end of file diff --git a/source/includes/_aviate-health.md b/source/includes/_aviate-health.md index 17b8fb9..00e1648 100644 --- a/source/includes/_aviate-health.md +++ b/source/includes/_aviate-health.md @@ -372,7 +372,7 @@ curl -X GET \ -H "Authorization: Bearer ${ID_TOKEN}" \ -H 'X-killbill-apiKey: bob' \ -H 'X-killbill-apisecret: lazar' \ - 'http://127.0.0.1:8080/plugins/aviate-plugin/v1/health/metrics?nodeName=ip-172-31-6-87&name=logs.rates.error' + 'http://127.0.0.1:8080/plugins/aviate-plugin/v1/health/metrics?nodeName=ip-172-31-6-87&name=logs.rates.error' # Returns metric data for the logs.rates.error metric for all the nodes: curl -X GET \ @@ -380,7 +380,7 @@ curl -X GET \ -H "Authorization: Bearer ${ID_TOKEN}" \ -H 'X-killbill-apiKey: bob' \ -H 'X-killbill-apisecret: lazar' \ - 'http://127.0.0.1:8080/plugins/aviate-plugin/v1/health/metrics?metricName=logs.rates.error' + 'http://127.0.0.1:8080/plugins/aviate-plugin/v1/health/metrics?metricName=logs.rates.error' # Returns metric data for the queue.bus.incoming metric for all the nodes (nodeName is ignored since queue.bus.incoming is a global metric): curl -X GET \ @@ -960,4 +960,4 @@ None **Response** -If successful, returns a status code of 200 and the requested diagnostic data. \ No newline at end of file +If successful, returns a status code of 200 and the requested diagnostic data. diff --git a/source/index.html.md b/source/index.html.md index 629567c..0f14794 100644 --- a/source/index.html.md +++ b/source/index.html.md @@ -32,6 +32,7 @@ menu_items: - aviate-health - aviate-metering - aviate-wallet + - aviate-coupons title: Kill Bill diff --git a/source/invoice-item.html.md b/source/invoice-item.html.md index 51d7458..32ae70a 100644 --- a/source/invoice-item.html.md +++ b/source/invoice-item.html.md @@ -32,6 +32,7 @@ menu_items: - aviate-health - aviate-metering - aviate-wallet + - aviate-coupons title: Kill Bill diff --git a/source/invoice-payment.html.md b/source/invoice-payment.html.md index da5c66a..5a35e8e 100644 --- a/source/invoice-payment.html.md +++ b/source/invoice-payment.html.md @@ -32,7 +32,8 @@ menu_items: - aviate-health - aviate-metering - aviate-wallet - + - aviate-coupons + title: Kill Bill language_tabs: diff --git a/source/invoice.html.md b/source/invoice.html.md index c07a8b0..3ca2d92 100644 --- a/source/invoice.html.md +++ b/source/invoice.html.md @@ -32,6 +32,7 @@ menu_items: - aviate-health - aviate-metering - aviate-wallet + - aviate-coupons title: Kill Bill diff --git a/source/overdue.html.md b/source/overdue.html.md index a1e8e6b..cc6bef5 100644 --- a/source/overdue.html.md +++ b/source/overdue.html.md @@ -32,6 +32,7 @@ menu_items: - aviate-health - aviate-metering - aviate-wallet + - aviate-coupons title: Kill Bill diff --git a/source/payment-method.html.md b/source/payment-method.html.md index 40b4147..3b7842b 100644 --- a/source/payment-method.html.md +++ b/source/payment-method.html.md @@ -32,6 +32,7 @@ menu_items: - aviate-health - aviate-metering - aviate-wallet + - aviate-coupons title: Kill Bill diff --git a/source/payment-transaction.html.md b/source/payment-transaction.html.md index 534a6bb..2e057ec 100644 --- a/source/payment-transaction.html.md +++ b/source/payment-transaction.html.md @@ -32,6 +32,7 @@ menu_items: - aviate-health - aviate-metering - aviate-wallet + - aviate-coupons title: Kill Bill diff --git a/source/payment.html.md b/source/payment.html.md index dbe135b..e15097d 100644 --- a/source/payment.html.md +++ b/source/payment.html.md @@ -32,6 +32,7 @@ menu_items: - aviate-health - aviate-metering - aviate-wallet + - aviate-coupons title: Kill Bill diff --git a/source/security.html.md b/source/security.html.md index dbadc0b..d08dbfa 100644 --- a/source/security.html.md +++ b/source/security.html.md @@ -32,6 +32,7 @@ menu_items: - aviate-health - aviate-metering - aviate-wallet + - aviate-coupons title: Kill Bill diff --git a/source/subscription.html.md b/source/subscription.html.md index 4bb885d..4cdc1e3 100644 --- a/source/subscription.html.md +++ b/source/subscription.html.md @@ -32,6 +32,7 @@ menu_items: - aviate-health - aviate-metering - aviate-wallet + - aviate-coupons title: Kill Bill diff --git a/source/tag-definition.html.md b/source/tag-definition.html.md index 13fe6b6..3342699 100644 --- a/source/tag-definition.html.md +++ b/source/tag-definition.html.md @@ -32,6 +32,7 @@ menu_items: - aviate-health - aviate-metering - aviate-wallet + - aviate-coupons title: Kill Bill diff --git a/source/tag.html.md b/source/tag.html.md index 34a1e39..8e876e6 100644 --- a/source/tag.html.md +++ b/source/tag.html.md @@ -32,6 +32,8 @@ menu_items: - aviate-health - aviate-metering - aviate-wallet + - aviate-coupons + title: Kill Bill diff --git a/source/tenant.html.md b/source/tenant.html.md index d1ad785..eccc68c 100644 --- a/source/tenant.html.md +++ b/source/tenant.html.md @@ -32,6 +32,7 @@ menu_items: - aviate-health - aviate-metering - aviate-wallet + - aviate-coupons title: Kill Bill diff --git a/source/test.html.md b/source/test.html.md index 303ebc9..d9173d7 100644 --- a/source/test.html.md +++ b/source/test.html.md @@ -32,6 +32,7 @@ menu_items: - aviate-health - aviate-metering - aviate-wallet + - aviate-coupons title: Kill Bill diff --git a/source/usage.html.md b/source/usage.html.md index ee63ea5..a07fce4 100644 --- a/source/usage.html.md +++ b/source/usage.html.md @@ -32,6 +32,7 @@ menu_items: - aviate-health - aviate-metering - aviate-wallet + - aviate-coupons title: Kill Bill