{"errors":{"custom_collection":"Required parameter missing or invalid"}}

Solved
SatishDevidas
Tourist
7 1 0

Hi Team,

we are facing error "{"errors":{"custom_collection":"Required parameter missing or invalid"}}" while creating custom collection

 

$sData['custom_collection']['title'] = 'test';
$sData['custom_collection']['published'] =1;

$sData = json_encode($sData);

$sAccessToken = ["Authorization: Basic ".$sCredi,"Content-Type : 'application/json'","Accept : '*/*'"];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $sUrl);
curl_setopt($ch, CURLOPT_HTTPHEADER, $sAccessToken);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_POSTFIELDS, $sData);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$mResponse = curl_exec($ch);
curl_close($ch);

 

 

0 Likes
Jivan_Suhagiya
Shopify Partner
494 68 102

Hi,
What is the end point you're using? I mean for $sUrl

If helpful then please Like and Accept Solution.
Email: suhagiyajivan1992@gmail.com
Skype: jivan.suhagiya
First kind of Checkout Reminder APP: https://apps.shopify.com/checkout-reminder
0 Likes
SatishDevidas
Tourist
7 1 0

This is an accepted solution.

Hi Jivan, below change work for me, thank you for reply

$sUrl = "https://xxx:yyy@zzz.myshopify.com/admin/api/2021-04/custom_collections.json";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $sUrl);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_POSTFIELDS, $sData);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$mResponse = curl_exec($ch);
curl_close($ch);

0 Likes