get https://secure.fusebill.com/v1/Coupons/
This call is used to retrieve a Coupon by ID.
Path Parameters
Property | Type | Description |
---|---|---|
couponId | Integer | This is the Id value which uniquely identifies this Coupon in the Fusebill system. This is the Id of the Coupon you want to retrieve. |
Examples
curl -X GET "https://secure.fusebill.com/v1/coupons/{couponId}" \
-H "Content-Type: application/json" \
-H "Authorization: Basic {APIKey}"
//path parameter
int pathParameter = {couponId};
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/coupons/"+pathParameter);
//Add Content type
request.ContentType = "application/json";
request.ContentLength = 0;
//Add Api key authorization
request.Headers.Add(HttpRequestHeader.Authorization, "Basic "+apiKey);
//Set request method
request.Method = "GET";
//Perform the request
var httpResponse = (HttpWebResponse)request.GetResponse();
//Record the response from our request
var result = "";
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
result = streamReader.ReadToEnd();
}
#Import library Requests
import requests
#Pass in a dictionary to the Headers parameter
headers = {'Authorization' : 'Basic {APIKey}', 'Content-Type' : 'application/json'}
#Pass in your URI and Headers
r = requests.get('https://secure.fusebill.com/v1/coupons/{id}', headers=headers)
print(r.content)
Response
{
"discounts": [
{
"id": 1155,
"uri": "https://secure.fusebill.com/v1/discounts/1155"
}
],
"eligibilities": [
{
"startDate": "2019-11-01T04:00:00",
"endDate": "2019-11-16T04:59:59.997",
"discounts": [
{
"id": 1163,
"uri": "https://secure.fusebill.com/v1/coupons/1163"
}
]
}
],
"plans": [
{
"applyToAllProducts": false,
"planProducts": [
{
"planProductId": 60921,
"id": 60655,
"uri": "https://secure.fusebill.com/v1/planProducts/60921"
}
],
"id": 17126,
"uri": "https://secure.fusebill.com/v1/plans/17126"
}
],
"name": "Youth Discount",
"description": "Under 20",
"eligibilityStartDate": "2019-11-01T04:00:00",
"eligibilityEndDate": "2019-11-16T04:59:59.997",
"status": "Active",
"applyToAllPlans": true,
"couponCodes": [
{
"code": "YD09",
"timesUsed": 120,
"remainingUsages": 203
}
],
"id": 2263,
"uri": "https://secure.fusebill.com/v1/coupons/2263"
}
{
"ErrorId": 0,
"HttpStatusCode": 404,
"Errors": [
{
"Key": "Api Error",
"Value": "Coupon with id 1 not found."
}
]
}