Partial Order Addition | Climes API
This endpoint is useful to add extra climes to an already existing order which is in locked state.
caution
This endpoint is only applicable for orders which are in locked state. This will return an error in case of order in unlocked state.
Request Parameters
Order Partial Addition Schema
Name | Description | Type | Optional |
---|---|---|---|
climes | This is the amount of extra climes that are to be added to the users existing order. | number | required |
partner_order_id | This partner_order_id is same as one used while creating the order. This partner_order_id will be used to update the order's climes. | string | required |
Endpoint
For an order where the merchant is paying :
/v3/integrations/vote/order/add
For an order where the customer is paying :
/v3/integrations/calculated/order/add
Method
PATCH
Headers
{
'x-api-key' : 'API_KEY',
'Content-Type' : 'application/json'
}
Payload
{
"climes" : 50,
"partner_order_id" : "876287372837786837"
}
Response Parameters
Status Code
200
Response Data
{
"message": "Order updated successfully",
"updated_climes": 607,
"partner_order_id": "876287372837786837"
}
Sample Request
- cURL
- NodeJs
- Axios
- Python
- Php
curl --location --request PATCH 'BASE_URL/v3/integrations/vote/order/add'
--header 'x-api-key: API_KEY'
--header 'Content-Type: application/json'
--data-raw '{
"climes" : 50,
"partner_order_id" : "876287372837786837"
}'
const fetch = require('node-fetch');
const url = 'BASE_URL/v3/integrations/vote/order/add';
const apiKey = 'API_KEY';
const headers = {
'x-api-key': apiKey,
'Content-Type': 'application/json'
};
const body = JSON.stringify({
climes: 50,
partner_order_id: '876287372837786837'
});
const options = {
method: 'PATCH',
headers: headers,
body: body
};
fetch(url, options)
.then(response => response.text())
.then(data => {
console.log(data);
})
.catch(error => {
console.error('Error:', error);
});
var axios = require('axios');
var data = JSON.stringify({
"climes": 50,
"partner_order_id": "876287372837786837"
});
var config = {
method: 'patch',
url: 'BASE_URL/v3/integrations/vote/order/add',
headers: {
'x-api-key': 'API_KEY',
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
import requests
import json
url = "BASE_URL/v3/integrations/vote/order/add"
payload = json.dumps({
"climes": 50,
"partner_order_id": "876287372837786837"
})
headers = {
'x-api-key': 'API_KEY',
'Content-Type': 'application/json'
}
response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('BASE_URL/v3/integrations/vote/order/add');
$request->setMethod('PATCH');
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'x-api-key' => 'API_KEY',
'Content-Type' => 'application/json'
));
$request->setBody('{
"climes" : 50,
"partner_order_id" : "876287372837786837"
}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Sample Response
Below are sample responses for the above request.
Responses
- Success - 200
- Failure - 400
{
"message": "Order updated successfully",
"updated_climes": 607,
"partner_order_id": "876287372837786837"
}
{
"message": "Bad Request! Please send all the variables properly."
}