All URIs are relative to https://localhost:8080/RestAPI
Method | HTTP request | Description |
---|---|---|
create_coupon | POST /coupons | Create a coupon. |
create_coupon_unique_codes | POST /coupons/{code}/codes | Create a list of unique coupon codes that can be applied to a subscription. |
get_all_coupons | GET /coupons | Returns a collection of all coupons. By default 10 values are returned. Records are returned in natural order. |
get_applied_coupons | GET /coupons/{code}/applied | Returns a list of unique coupons which have been applied. |
get_available_coupon_codes_for_code | GET /coupons/{code}/codes | Returns a list of available unique coupon codes for the specified parent coupon code that can be applied to a subscription. |
get_coupon_code | GET /coupons/{code} | Returns the coupon for the specified code that can be applied to a subscription. |
get_subscription_applications_of_coupons | GET /coupons/{code}/subscriptions | Retrieves a collection of the coupons by this coupon code which have been applied. |
retire_coupon | DELETE /coupons/{code} | <p>This method has 2 main behaviours depending on what is passed in. If the parent coupon code, for example SUMMER, is given no new coupons can be issued or claimed from this code. Deleting will result in the deleted property being set to true.</p><p>If a unique coupon code, for example SUMMER-AGH8, is given this will stop the coupon from being applied to the subscription from that point onwards. When a coupon is deleted the validUntil property is set which is the date/time it stopped applying to the target.</p> |
CouponPagedMetadata create_coupon(code)
Create a coupon.
{"nickname":"Create a new coupon","request":"createCouponRequest.html","response":"createCouponResponse.html"}
# load the gem
require 'bf_ruby2'
api_instance = Bfwd::CouponsApi.new
code = Bfwd::Coupon.new # Coupon | The coupon object to be created.
begin
#Create a coupon.
result = api_instance.create_coupon(code)
p result
rescue Bfwd::ApiError => e
puts "Exception when calling CouponsApi->create_coupon: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
code | Coupon | The coupon object to be created. |
No authorization required
- Content-Type: application/json; charset=utf-8
- Accept: application/json; charset=utf-8
CouponUniqueCodesResponsePagedMetadata create_coupon_unique_codes(code, opts)
Create a list of unique coupon codes that can be applied to a subscription.
{ "nickname":"Create unique coupon codes","request":"createUniqueCodesRequest.html","response":"createUniqueCodesResponse.html"}
# load the gem
require 'bf_ruby2'
api_instance = Bfwd::CouponsApi.new
code = "code_example" # String | The coupon code to use in the generation of the unique codes.
opts = {
request: Bfwd::CouponUniqueCodesRequest.new # CouponUniqueCodesRequest | The request object that specifies the number of codes to be created.
}
begin
#Create a list of unique coupon codes that can be applied to a subscription.
result = api_instance.create_coupon_unique_codes(code, opts)
p result
rescue Bfwd::ApiError => e
puts "Exception when calling CouponsApi->create_coupon_unique_codes: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
code | String | The coupon code to use in the generation of the unique codes. | |
request | CouponUniqueCodesRequest | The request object that specifies the number of codes to be created. | [optional] |
CouponUniqueCodesResponsePagedMetadata
No authorization required
- Content-Type: application/json; charset=utf-8
- Accept: application/json; charset=utf-8
CouponPagedMetadata get_all_coupons(opts)
Returns a collection of all coupons. By default 10 values are returned. Records are returned in natural order.
{ "nickname":"Retrieve all coupons","response":"getCouponAll.html"}
# load the gem
require 'bf_ruby2'
api_instance = Bfwd::CouponsApi.new
opts = {
organizations: ["organizations_example"], # Array<String> | A list of organization-IDs used to restrict the scope of API calls.
offset: 0, # Integer | The offset from the first subscription to return.
records: 10, # Integer | The maximum number of subscriptions to return.
order_by: "created", # String | Specify a field used to order the result set.
order: "DESC", # String | Ihe direction of any ordering, either ASC or DESC.
include_retired: false # BOOLEAN | Whether retired subscriptions should be returned.
}
begin
#Returns a collection of all coupons. By default 10 values are returned. Records are returned in natural order.
result = api_instance.get_all_coupons(opts)
p result
rescue Bfwd::ApiError => e
puts "Exception when calling CouponsApi->get_all_coupons: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
organizations | Array<String> | A list of organization-IDs used to restrict the scope of API calls. | [optional] |
offset | Integer | The offset from the first subscription to return. | [optional] [default to 0] |
records | Integer | The maximum number of subscriptions to return. | [optional] [default to 10] |
order_by | String | Specify a field used to order the result set. | [optional] [default to created] |
order | String | Ihe direction of any ordering, either ASC or DESC. | [optional] [default to DESC] |
include_retired | BOOLEAN | Whether retired subscriptions should be returned. | [optional] [default to false] |
No authorization required
- Content-Type: Not defined
- Accept: application/json; charset=utf-8
CouponPagedMetadata get_applied_coupons(code, opts)
Returns a list of unique coupons which have been applied.
{ "nickname":"Retrieve used unique coupons","response":"getAppliedCodesForCode.html"}
# load the gem
require 'bf_ruby2'
api_instance = Bfwd::CouponsApi.new
code = "code_example" # String | The base code to use in the generation of the unique codes.
opts = {
organizations: ["organizations_example"], # Array<String> | A list of organization-IDs used to restrict the scope of API calls.
offset: 0, # Integer | The offset from the first subscription to return.
records: 10, # Integer | The maximum number of subscriptions to return.
order_by: "created", # String | Specify a field used to order the result set.
order: "DESC", # String | Ihe direction of any ordering, either ASC or DESC.
include_retired: false # BOOLEAN | Whether retired subscriptions should be returned.
}
begin
#Returns a list of unique coupons which have been applied.
result = api_instance.get_applied_coupons(code, opts)
p result
rescue Bfwd::ApiError => e
puts "Exception when calling CouponsApi->get_applied_coupons: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
code | String | The base code to use in the generation of the unique codes. | |
organizations | Array<String> | A list of organization-IDs used to restrict the scope of API calls. | [optional] |
offset | Integer | The offset from the first subscription to return. | [optional] [default to 0] |
records | Integer | The maximum number of subscriptions to return. | [optional] [default to 10] |
order_by | String | Specify a field used to order the result set. | [optional] [default to created] |
order | String | Ihe direction of any ordering, either ASC or DESC. | [optional] [default to DESC] |
include_retired | BOOLEAN | Whether retired subscriptions should be returned. | [optional] [default to false] |
No authorization required
- Content-Type: text/plain
- Accept: application/json; charset=utf-8
CouponUniqueCodesResponsePagedMetadata get_available_coupon_codes_for_code(code, opts)
Returns a list of available unique coupon codes for the specified parent coupon code that can be applied to a subscription.
{ "nickname":"Retrieve unused unique coupons","response":"getAvailableCodesForCode.html"}
# load the gem
require 'bf_ruby2'
api_instance = Bfwd::CouponsApi.new
code = "code_example" # String | The base code to use in the generation of the unique codes.
opts = {
organizations: ["organizations_example"], # Array<String> | A list of organization-IDs used to restrict the scope of API calls.
offset: 0, # Integer | The offset from the first subscription to return.
records: 10, # Integer | The maximum number of subscriptions to return.
order_by: "created", # String | Specify a field used to order the result set.
order: "DESC", # String | Ihe direction of any ordering, either ASC or DESC.
include_retired: false # BOOLEAN | Whether retired subscriptions should be returned.
}
begin
#Returns a list of available unique coupon codes for the specified parent coupon code that can be applied to a subscription.
result = api_instance.get_available_coupon_codes_for_code(code, opts)
p result
rescue Bfwd::ApiError => e
puts "Exception when calling CouponsApi->get_available_coupon_codes_for_code: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
code | String | The base code to use in the generation of the unique codes. | |
organizations | Array<String> | A list of organization-IDs used to restrict the scope of API calls. | [optional] |
offset | Integer | The offset from the first subscription to return. | [optional] [default to 0] |
records | Integer | The maximum number of subscriptions to return. | [optional] [default to 10] |
order_by | String | Specify a field used to order the result set. | [optional] [default to created] |
order | String | Ihe direction of any ordering, either ASC or DESC. | [optional] [default to DESC] |
include_retired | BOOLEAN | Whether retired subscriptions should be returned. | [optional] [default to false] |
CouponUniqueCodesResponsePagedMetadata
No authorization required
- Content-Type: text/plain
- Accept: application/json; charset=utf-8
CouponUniqueCodesResponsePagedMetadata get_coupon_code(code, opts)
Returns the coupon for the specified code that can be applied to a subscription.
{ "nickname":"Retrieve coupon","response":"getCouponByCode.html"}
# load the gem
require 'bf_ruby2'
api_instance = Bfwd::CouponsApi.new
code = "code_example" # String | The parent coupon code to use in the generation of the unique codes.
opts = {
organizations: ["organizations_example"] # Array<String> | A list of organization-IDs used to restrict the scope of API calls.
}
begin
#Returns the coupon for the specified code that can be applied to a subscription.
result = api_instance.get_coupon_code(code, opts)
p result
rescue Bfwd::ApiError => e
puts "Exception when calling CouponsApi->get_coupon_code: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
code | String | The parent coupon code to use in the generation of the unique codes. | |
organizations | Array<String> | A list of organization-IDs used to restrict the scope of API calls. | [optional] |
CouponUniqueCodesResponsePagedMetadata
No authorization required
- Content-Type: text/plain
- Accept: application/json; charset=utf-8
SubscriptionPagedMetadata get_subscription_applications_of_coupons(code, opts)
Retrieves a collection of the coupons by this coupon code which have been applied.
{ "nickname":"Retrieve subscriptions to which the given coupon code has been applied.","response":"getSubscriptionApplications.html"}
# load the gem
require 'bf_ruby2'
api_instance = Bfwd::CouponsApi.new
code = "code_example" # String | Base code of the coupon.
opts = {
organizations: ["organizations_example"], # Array<String> | A list of organization-IDs used to restrict the scope of API calls.
offset: 0, # Integer | The offset from the first subscription to return.
records: 10, # Integer | The maximum number of subscriptions to return.
order_by: "created", # String | Specify a field used to order the result set.
order: "DESC", # String | Ihe direction of any ordering, either ASC or DESC.
include_retired: false # BOOLEAN | Whether retired subscriptions should be returned.
}
begin
#Retrieves a collection of the coupons by this coupon code which have been applied.
result = api_instance.get_subscription_applications_of_coupons(code, opts)
p result
rescue Bfwd::ApiError => e
puts "Exception when calling CouponsApi->get_subscription_applications_of_coupons: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
code | String | Base code of the coupon. | |
organizations | Array<String> | A list of organization-IDs used to restrict the scope of API calls. | [optional] |
offset | Integer | The offset from the first subscription to return. | [optional] [default to 0] |
records | Integer | The maximum number of subscriptions to return. | [optional] [default to 10] |
order_by | String | Specify a field used to order the result set. | [optional] [default to created] |
order | String | Ihe direction of any ordering, either ASC or DESC. | [optional] [default to DESC] |
include_retired | BOOLEAN | Whether retired subscriptions should be returned. | [optional] [default to false] |
No authorization required
- Content-Type: text/plain
- Accept: application/json; charset=utf-8
CouponPagedMetadata retire_coupon(code, organizations)
This method has 2 main behaviours depending on what is passed in. If the parent coupon code, for example SUMMER, is given no new coupons can be issued or claimed from this code. Deleting will result in the deleted property being set to true.
If a unique coupon code, for example SUMMER-AGH8, is given this will stop the coupon from being applied to the subscription from that point onwards. When a coupon is deleted the validUntil property is set which is the date/time it stopped applying to the target.
{ "nickname":"Retire coupon","response":"retireCoupon.html"}
# load the gem
require 'bf_ruby2'
api_instance = Bfwd::CouponsApi.new
code = "code_example" # String | ID of the coupon to remove.
organizations = ["organizations_example"] # Array<String> | A list of organization-IDs used to restrict the scope of API calls.
begin
#<p>This method has 2 main behaviours depending on what is passed in. If the parent coupon code, for example SUMMER, is given no new coupons can be issued or claimed from this code. Deleting will result in the deleted property being set to true.</p><p>If a unique coupon code, for example SUMMER-AGH8, is given this will stop the coupon from being applied to the subscription from that point onwards. When a coupon is deleted the validUntil property is set which is the date/time it stopped applying to the target.</p>
result = api_instance.retire_coupon(code, organizations)
p result
rescue Bfwd::ApiError => e
puts "Exception when calling CouponsApi->retire_coupon: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
code | String | ID of the coupon to remove. | |
organizations | Array<String> | A list of organization-IDs used to restrict the scope of API calls. |
No authorization required
- Content-Type: text/plain
- Accept: application/json; charset=utf-8