Amberflo API
Defining Commitments

Create or update a commitment

1min
code examples curl location 'https //app amberflo io/payments/pricing/amberflo/customer commitment/arrears commitment with trueup' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{ "customerid" "", "planid" "", "label" "", "cycles" "", "trueup" { "minimumpayment" "", "interval" "" }, "reward" { "value" "", "label" "" } }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "customerid" "", "planid" "", "label" "", "cycles" "", "trueup" { "minimumpayment" "", "interval" "" }, "reward" { "value" "", "label" "" } }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("https //app amberflo io/payments/pricing/amberflo/customer commitment/arrears commitment with trueup", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("https //app amberflo io/payments/pricing/amberflo/customer commitment/arrears commitment with trueup") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request body = json dump({ "customerid" "", "planid" "", "label" "", "cycles" "", "trueup" { "minimumpayment" "", "interval" "" }, "reward" { "value" "", "label" "" } }) response = https request(request) puts response read body import requests import json url = "https //app amberflo io/payments/pricing/amberflo/customer commitment/arrears commitment with trueup" payload = json dumps({ "customerid" "", "planid" "", "label" "", "cycles" "", "trueup" { "minimumpayment" "", "interval" "" }, "reward" { "value" "", "label" "" } }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // successful request { "contractgenerator" {}, "contract" { "id" "", "type" "", "accountid" "", "customerid" "", "customerobligations" {}, "accountobligations" {}, "commitmentviolationpolicy" { "notifypercustomerviolations" false, "notifyperaccountviolations" false, "compensateoncustomerviolation" false, "compensateonaccountviolation" false }, "timerange" { "starttimeinseconds" "", "endtimeinseconds" "" }, "productid" "", "commitmentendingconfig" { "commitmentrestartconfig" { "latestdecisiontimeseconds" "", "optout" false }, "extendprepaidcardendtimeinseconds" "" }, "exitclauses" {} }, "firstcustomerplan" { "productid" "", "productplanid" "", "customerid" "", "starttimeinseconds" "", "endtimeinseconds" "", "relationid" "", "createdtimeinseconds" "" }, "firstcustomerappliedpromotions" \[ { "id" "", "productid" "", "customerid" "", "promotionid" "", "appliedtimeinseconds" "", "addedtimeinseconds" "", "removedtimeinseconds" "", "relationid" "", "appliedtimerange" { "starttimeinseconds" "", "endtimeinseconds" "" }, "priority" 0, "removalcontext" "", "commitmentid" "", "entityproductinvoices" \[ { "invoiceuri" "", "createdtimeinseconds" "", "amount" 0, "invoiceamount" 0 } ], "amountleftincycle" 0, "totalamountleft" 0 } ], "firstcustomerprepaidcards" {}, "firstprepaidcardsorders" {}, "creationtimeinseconds" "", "firstcustompromotions" \[ { "promotion" {}, "customerappliedpromotion" { "id" "", "productid" "", "customerid" "", "promotionid" "", "appliedtimeinseconds" "", "addedtimeinseconds" "", "removedtimeinseconds" "", "relationid" "", "appliedtimerange" { "starttimeinseconds" "", "endtimeinseconds" "" }, "priority" 0, "removalcontext" "", "commitmentid" "", "entityproductinvoices" \[ { "invoiceuri" "", "createdtimeinseconds" "", "amount" 0, "invoiceamount" 0 } ], "amountleftincycle" 0, "totalamountleft" 0 } } ], "firstorders" \[ { "customerid" "", "id" "", "orderitems" \[ { "id" "", "quantity" 0, "resourceid" "", "dimensions" "", "totalprice" 0 } ], "productitemid" "", "productplanid" "", "appliedtimerange" { "starttimeinseconds" "", "endtimeinseconds" "" }, "billingperiods" "", "label" "", "subscriptionsettings" { "cancellationrule" "", "chargeexecution" "", "purchaserule" "", "subscriptionrate" "", "ispricedperrate" false, "iscancellable" false }, "addedtimeinseconds" "", "commitmentid" "", "prepaiduris" \[ "" ], "removedtimeinseconds" "", "removalcontext" "" } ], "firstplanoverridegenerators" {}, "commitmentstatehistory" "" }