Create Dynamic Charges for a Purchased Product
post
/bcws/webresources/v1.0/subscriptions/offer/{id}/overridecharges
Creates dynamic charges for the purchased product with the specified ID.
Request
Path Parameters
-
id(required): string
The ID of the purchased product or discount to create dynamic charges for. For example: 0.0.0.1+-purchased_product+123123
Supported Media Types
- application/xml
- application/json
Details about the dynamic charges to create. The minimum required parameters are:
- event
- charges
Nested Schema : overriddenCharges
Type:
Show Source
object
-
charges(required): array
charges
The charge details.
-
event(required): string
The event associated with the overridden charges.
Nested Schema : charges
Type:
array
The charge details.
Show Source
-
Array of:
object Charges
The charge details.
Nested Schema : Charges
Type:
object
The charge details.
Show Source
-
charge(required): array
charge
The charges.
-
endDate: string
(date-time)
The date and time the charge's validity ends.
-
startDate(required): string
(date-time)
The date and time the charge's validity starts.
Nested Schema : Charge
Type:
object
The charges.
Show Source
-
amount(required): number
The charge amount.
-
priceTag(required): string
The charge's price tag.
-
type(required): string
The charge type.
Details about the dynamic charges to create. The minimum required parameters are:
- event
- charges
Nested Schema : overriddenCharges
Type:
Show Source
object
-
charges(required): array
charges
The charge details.
-
event(required): string
The event associated with the overridden charges.
Nested Schema : charges
Type:
array
The charge details.
Show Source
-
Array of:
object Charges
The charge details.
Nested Schema : Charges
Type:
object
The charge details.
Show Source
-
charge(required): array
charge
The charges.
-
endDate: string
(date-time)
The date and time the charge's validity ends.
-
startDate(required): string
(date-time)
The date and time the charge's validity starts.
Nested Schema : Charge
Type:
object
The charges.
Show Source
-
amount(required): number
The charge amount.
-
priceTag(required): string
The charge's price tag.
-
type(required): string
The charge type.
Response
201 Response
The dynamic charges were created successfully.
400 Response
The request isn't valid.
500 Response
An internal server error occurred.
Examples
This example shows how create dynamic charges for a purchased product by submitting a POST request on the REST resource using cURL. For more information about cURL, see "Use cURL".
cURL Command
curl -X POST 'http://hostname:port/bcws/webresources/version/subscriptions/offer/0.0.0.1+-purchased_product+2832219/overridecharges' -H 'content-type: application/json' -d @createCharges.json
where:
- hostname is the URL for the Billing Care REST server.
- port is the port for the Billing Care REST server.
- version is the version of the API you're using, such as v1.0.
- createCharges.json is the JSON file that specifies the loan to create.
Example of Request Body
This example shows the contents of the createCharges.json file sent as the request body.
[
{
"event":"/event/billing/product/fee/cycle/cycle_forward_arrear",
"charges":[
{
"startDate":"2021-10-19",
"endDate":"2021-11-19",
"charge":[
{
"amount":105,
"priceTag":"USD",
"type":"amount"
},
{
"amount":205,
"priceTag":"Free MInutes",
"type":"percentage"
}
]
},
{
"startDate":"2021-11-20",
"endDate":"",
"charge":[
{
"amount":100,
"priceTag":"USD",
"type":"percentage"
},
{
"amount":200,
"priceTag":"Free MInutes",
"type":"percentage"
}
]
}
]
},
{
"event":"/event/billing/product/fee/purchase",
"charges":[
{
"startDate":"2021-10-19",
"endDate":"2021-11-19",
"charge":[
{
"amount":105,
"priceTag":"USD",
"type":"amount"
}
]
},
{
"startDate":"2021-11-20",
"endDate":"",
"charge":[
{
"amount":100,
"priceTag":"USD",
"type":"percentage"
}
]
}
]
}
]
Example of Response Body
If successful, the response code 201 is returned with no response body.