Retrieves the coupon with the given ID.
curl https://api.stripe.com/v1/coupons/25OFF \
-u STRIPE_SECRET_KEY:
LOCAL loRest
LOCAL lnSuccess
LOCAL lnBTls
LOCAL lnPort
LOCAL lnBAutoReconnect
LOCAL loSbResponseBody
LOCAL loJsonResponse
LOCAL lcId
LOCAL lcObject
LOCAL lnAmount_off
LOCAL lnCreated
LOCAL lnCurrency
LOCAL lcDuration
LOCAL lnDuration_in_months
LOCAL lnLivemode
LOCAL lnMax_redemptions
LOCAL lnPercent_off
LOCAL lnRedeem_by
LOCAL lnTimes_redeemed
LOCAL lnValid
loRest = CreateObject('Chilkat_9_5_0.Rest')
* URL: https://api.stripe.com/v1/coupons/25OFF
lnBTls = 1
lnPort = 443
lnBAutoReconnect = 1
lnSuccess = loRest.Connect("api.stripe.com",lnPort,lnBTls,lnBAutoReconnect)
IF (lnSuccess <> 1) THEN
? "ConnectFailReason: " + STR(loRest.ConnectFailReason)
? loRest.LastErrorText
RELEASE loRest
CANCEL
ENDIF
loRest.SetAuthBasic("STRIPE_SECRET_KEY","")
loSbResponseBody = CreateObject('Chilkat_9_5_0.StringBuilder')
lnSuccess = loRest.FullRequestNoBodySb("GET","/v1/coupons/25OFF",loSbResponseBody)
IF (lnSuccess <> 1) THEN
? loRest.LastErrorText
RELEASE loRest
RELEASE loSbResponseBody
CANCEL
ENDIF
loJsonResponse = CreateObject('Chilkat_9_5_0.JsonObject')
loJsonResponse.LoadSb(loSbResponseBody)
lcId = loJsonResponse.StringOf("id")
lcObject = loJsonResponse.StringOf("object")
lnAmount_off = loJsonResponse.IsNullOf("amount_off")
lnCreated = loJsonResponse.IntOf("created")
lnCurrency = loJsonResponse.IsNullOf("currency")
lcDuration = loJsonResponse.StringOf("duration")
lnDuration_in_months = loJsonResponse.IntOf("duration_in_months")
lnLivemode = loJsonResponse.BoolOf("livemode")
lnMax_redemptions = loJsonResponse.IsNullOf("max_redemptions")
lnPercent_off = loJsonResponse.IntOf("percent_off")
lnRedeem_by = loJsonResponse.IsNullOf("redeem_by")
lnTimes_redeemed = loJsonResponse.IntOf("times_redeemed")
lnValid = loJsonResponse.BoolOf("valid")
RELEASE loRest
RELEASE loSbResponseBody
RELEASE loJsonResponse
{
"id": "25OFF",
"object": "coupon",
"amount_off": null,
"created": 1516662783,
"currency": null,
"duration": "repeating",
"duration_in_months": 3,
"livemode": false,
"max_redemptions": null,
"metadata": {},
"percent_off": 25,
"redeem_by": null,
"times_redeemed": 0,
"valid": true
}