Fail with CURL PUT call with Zoho Subscription API using PHP
Hello
I use the API provided by zoho in subscription and forms for my application. I got no problems for retreive any information and update my custormer data in Zoho Books but unfortunatly, that' not working for subscription.
This is my json array to update a subscription with a new addon
- {
- "reference_id": "",
- "plan": {
- "plan_code": "MyDWS-FR-Basic",
- "name": "Abonnement de base",
- "price": 0,
- "quantity": 1,
- "tax_id": "",
- "setup_fee_tax_id": ""
- },
- "addons": [{
- "addon_code": "ADD_EN-Others1",
- "price": 0,
- "quantity": 1,
- "tax_id": ""
- }],
- "contactpersons": [{
- "contactperson_id": "264809000000126115"
- }]
- }
This is my call in my PHP app
public function makePuTCurlQuery($query,$data){
$curl = curl_init($query);
curl_setopt_array($curl, array(
CURLOPT_POST => 1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => $data,
CURLOPT_RETURNTRANSFER => true
));
$response = curl_exec($curl);
curl_close($ch);
return $response;
}
Content of my variables :
$data >
array(3) { |
| ["authtoken"]=> |
| string(32) "my_working_authtoken" |
| ["organization_id"]=> |
| string(9) "my_working_organization_id" |
| ["JSONString"]=> |
| string(281) "{"reference_id":"","plan":{"plan_code":"MyDWS-FR-Basic","name":"Abonnement de base","price":0,"quantity":1,"tax_id":"","setup_fee_tax_id":""},"addons":[{"addon_code":"ADD_EN-Others1","price":0,"quantity":1,"tax_id":""}],"contactpersons":[{"contactperson_id":"264809000000126115"}]}" |
| } |
This is the result of the call with any others explaination > "The request passed is not valid."
Where i did a mistake ? This kind of call working like a charm for Books...
Cheers
Sébastien
Sticky Posts
Zoho Billing will discontinue support for older browser versions soon
Hello users, Starting from May 15, 2024, Zoho Billing will no longer support the following browser versions: Browsers Version Restrictions Firefox Browser Versions older than 100 Google Chrome Versions older than 100 Microsoft Edge Versions older than
Introducing Developer Space in Zoho Subscriptions
Hello devs! At Zoho Subscriptions, we're constantly looking for ways to empower the developer community. Our goal is to provide you with the tools you need to integrate Zoho Subscriptions with your other platforms, and we also want to make it easy to