Removes the currently applied discount on a subscription.
curl https://api.stripe.com/v1/subscriptions/sub_CBbgnZGMJwa9ta/discount \
-u STRIPE_SECRET_KEY: \
-X DELETE
import com.chilkatsoft.*;
public class ChilkatExample {
static {
try {
System.loadLibrary("chilkat");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load.\n" + e);
System.exit(1);
}
}
public static void main(String argv[])
{
CkRest rest = new CkRest();
boolean success;
// URL: https://api.stripe.com/v1/subscriptions/sub_CBbgnZGMJwa9ta/discount
boolean bTls = true;
int port = 443;
boolean bAutoReconnect = true;
success = rest.Connect("api.stripe.com",port,bTls,bAutoReconnect);
if (success != true) {
System.out.println("ConnectFailReason: " + rest.get_ConnectFailReason());
System.out.println(rest.lastErrorText());
return;
}
rest.SetAuthBasic("STRIPE_SECRET_KEY","");
CkStringBuilder sbResponseBody = new CkStringBuilder();
success = rest.FullRequestNoBodySb("DELETE","/v1/subscriptions/sub_CBbgnZGMJwa9ta/discount",sbResponseBody);
if (success != true) {
System.out.println(rest.lastErrorText());
return;
}
CkJsonObject jsonResponse = new CkJsonObject();
jsonResponse.LoadSb(sbResponseBody);
boolean deleted;
String id;
deleted = jsonResponse.BoolOf("deleted");
id = jsonResponse.stringOf("id");
}
}
{
"deleted": true,
"id": "di_1BnETLGswQrCoh0Xe991uMc7"
}