Skip to content

setShippingTrackingId method

The method lets you add or update the shipment tracking number in a deal. When you specify a waybill number, the delivery service must be connected in the R7K12CRM integrations. The maximum number of input items is 100. Method: POST URL: https://api.r7k12.com/{{TOKEN}}/R7K12Crm Parameters: Table 1 Input data:

{

 "method": "setShippingTrackingId",

 "input": [

   {

     "dealId": (string),

     "type": (string),

     "shippingId": (string)

   },

   ...

 ]

}

Table 1

Parameter Type Required Description
method string Yes The method being called. Always “setShippingTrackingId”
input array[object] Yes Method input parameters
input[index].dealId string Yes Deal ID
input[index].type string Yes ID of the delivery service the tracking number belongs to - “novaPoshta” - Nova Poshta
input[index].shippingId string Yes Shipment tracking number

Request example:

define('TOKEN','YOURTOKEN');

function POST ($request) {
   $curl = curl_init();
   curl_setopt($curl, CURLOPT_URL, 'https://api.r7k12.com/'.TOKEN.'/R7K12Crm');
   curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
   curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($request,JSON_UNESCAPED_UNICODE));
   $out = curl_exec($curl);
   curl_close($curl);
   return json_decode($out,true);
}

$response = POST(
   [
            'method' => 'setShippingTrackingId' ,
            'input' => [
                    [
'dealId' => '5e450c947e7c21254b42a942',
'fields' => 'novaPoshta',
'fields' => '1234567890',
]
]
       ]
);

print_r($response);

Response handling:

{

 "success": true,

 "warning": [

   {

     "dealId": (string),

     "type": (syting),

     "shippingId": (string),

     "error": (string)

   }

 ]

}

Table 2

Parameter Type Required Description
success true No Flag indicating that all uploaded data was processed successfully. Present only if all the data was processed successfully
warning array[object] No Array of unprocessed input data
warning[index].dealId string Yes Deal ID
warning[index].type string Yes ID of the delivery service the tracking number belongs to - “novaPoshta” - Nova Poshta
warning[index].shippingId string Yes Shipment tracking number
warning[index].error string Yes Reason the data was not processed: - Field "dealId": must be string (a-z0-9) - Deal not found - Incorrect field "shippingId" - Incorrect shipping system - The electronic invoice number "XXXXX" is already set on another deal - Shipping system is not enabled

API errors

Response format:

{

 "error": {

   "code": (int),

   "error": (string),

   "error_detail": (string)

 }

}

Table 3

Code Error Description
-1 Request failed An internal API error occurred. Contact technical support and provide the requestId
20 Invalid access key
21 Invalid method
22 Invalid data format
23 Required parameters not specified
24 API integration is not connected
25 Write error
26 The maximum number of records per request is 100
27 The interval between requests must be at least 3 seconds
28 No access to the selected project
29 Insufficient permissions to execute this method
210 This method requires a user access key You need to obtain a key via OAUTH2
211 Access token is blocked Contact technical support for more information
212 Requests with the same method cannot be executed in parallel The selected API method is already being used in a parallel request with the specified token
301 Invalid API Method An invalid R7K12 CRM API method was called
302 R7K12 CRM is not connected in the project R7K12 CRM is not connected in the project
303 Integration not connected in R7K12 CRM The integration is not connected in R7K12 CRM
304 Incorrect input data Invalid input data
305 A lot of data The maximum amount of input data has been exceeded