fbpx

< / >

Update obligation

Update obligation

URL:

https://{{wolkvox_server}}/server/API/v2/collections/insertObligation.php

Description:

This API provides the ability to add new obligations to existing collections in the CRM system. Obligations represent the financial commitments or payment agreements between the company and its customers. By using this API, agents or administrators can efficiently record and manage obligations.

¿How it works?

This API operates through a ‘raw‘ type body and a PUT request, which requires the following fields for proper functioning:

In the request headers, the following is required:

  • Wolkvox-Token

– In the request body, the following is required:

  • operation
  • wolkvox-id
  • fields

REQUEST

KEY
DESCRIPTION
EXAMPLE
Wolkvox-Token
It is the token configured by the client on the CRM page.
A8K3J7F2
operation
It is the name of the CRM operation.
“operation”:”testmodule”
wolkvox_id
It is the identifier of the record in collections.
“wolkvox_id”: “61fa3”
fields
It is the set of attributes for the new obligation.
id
Identification code of the obligation in the specified record.
“id”: “obl1”
name
Name of the obligation.
“name”: “Invoice 12345 – Pending Payment”
total_balance
It is the total balance.
“total_balance”: “10000”
portfolio_type
It is the associated portfolio type.
“portfolio_type”: “VIP Client”
last_pay
It indicates the amount of the last associated payment.
“last_pay”: “2000”
last_pay_date
It indicates the date of the last associated payment.
“last_pay_date”: “06-06-2023”
expiring_date
It indicates the due date.
“expiring_date”: “07-07-2023”
days_delay
It indicates the number of days of delay.
“days_delay”: “90”
form
It is a dataset representing additional fields (in obligations) created as complements to the default ones.
“form”: [ { “name”: “Degree”, “value”: “degree value” }, { “name”: “Frequency”, “value”: “Frequent” } ]

REQUEST

				
					$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://{{wolkvox_server}}/server/API/v2/collections/updateObligation.php',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "operation": "",
    "wolkvox_id": "",
    "obligation": "",
    "fields": {
        "id": "",
        "name": "",
        "total_balance": "",
        "portfolio_type": "",
        "last_pay": "",
        "last_pay_date": "",
        "expiring_date": "",
        "days_delay": "",
        "form": [
            {
                "name": "",
                "value": ""
            },
            {
                "name": " ",
                "value": ""
            }
        ]
    }
}
',
  CURLOPT_HTTPHEADER => array(
    'Wolkvox-Token: {{Wolkvox-Token}}',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

				
			

RESPONSE

KEY
DESCRIPTION
EXAMPLE
code
It indicates the response status code.
“code”: 200
error
Provides details about the error that occurred during the request.
“error”: “null”
msg
Displays a descriptive message about the request outcome.
“msg”: “Succesfully edit record”
data
It is the set of information obtained as a result of making the request.
{ “code”: “200”, “error”: “null”, “msg”: “2 records were are found”, “data”: [ { “Company ID”: 12345, “Company name”: “Tech Solutions Inc.”, “Email”: “[email protected]”, “wolkvox_id”: “64dc” }, { “Company ID”: 1001, “Company name”: “GreenTech Innovations Ltd.”, “Email”: “[email protected]”, “wolkvox_id”: “64dcf” } ] }
				
					{
    "code": 200,
    "error": "null",
    "msg": "Succesfully create record",
    "data": {
        "wolkvox_id": "123cb"
    }
}
				
			
Possible error codes

Usamos cookies, se continuar a navegar assumimos que concorda. Pode ler mais sobre a utilização de cookies nas nossas políticas de privacidade e tratamento de dados pessoais

We use cookies, if you continue browsing we will assume that you agree. You can read more about the use of cookies in our privacy policies and treatment of personal data