Skip to main content

Create Multiple Orders | Climes API


This endpoint creates a single order.

Request Parameters

Orders Schema

Each request payload has an orders array which requires individual order object

NameDescriptionTypeOptional
ordersThis is an array of orders which can be sent instead of sending single order.array
required

Order Schema

NameDescriptionTypeOptional
climesThis is the amount of climes chosen by the user to neutralise his/her journey. You can calculate the total Carbon emitted by the users journey using Climes' Truecost API's.number
required
partner_order_idThis partner_order_id has to be unique and generated from your end. This can be used to have a tally of orders sent for processing if required.string
required
customer_emailUsers Email addressstring
required
customer_nameUsers Full Namestring
required
customer_phoneUsers Phone Numberstringoptional
unlock_dateThis timestamp is for the journeys that are yet to be done which have a possibility for the ticket cancellation. The unlock_date has to be the timestamp at which the journey is over. Till the journey is not over the climes will be in a locked state and can only be accessed after the journey is over.

Default is 10 days from the date of order placed.
epoch timestamp in milliseconds. i.e. 1660933800000optional
cart_idThis is the cart_id of your store. This has to be unique and has to be same as cart_id in Create OptIn API.
For Climes Vote product if this is not sent then it will be of same value as partner_order_id

This field is for Climes Vote product only
stringoptional
project_idThis is the project selected by your user to support with their climes.stringoptional
tip

If you want the order to be unlocked immediately then you can send any past timestamp.

caution

All the order updates like Partial Addition, Partial Cancellation , Full Order Cancellation can only be done before the unlock_date has passed. Once unlock_date has passed no updates will be supported for that order.

Endpoint

For an order where the merchant is paying :

/v3/integrations/vote/orders

For an order where the customer is paying :

/v3/integrations/calculated/orders

Method

POST

Headers

{
'x-api-key' : 'API_KEY',
'Content-Type' : 'application/json'
}

Payload

{
"orders": [
{
"climes": 15,
"partner_order_id": "PIDhkj786sdfdsf",
"customer_email": "johndoe@climes.io",
"customer_name": "John Doe",
"customer_phone": "+911234567890",
"unlock_date": 1651326671442,
"cart_id" : "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"project_id" : "farmers-for-forests"
},
{
"climes": 19,
"partner_order_id": "PIDketwjh78dpwe",
"customer_email": "johndoe@climes.io",
"customer_name": "John Doe",
"customer_phone": "+911234567890",
"unlock_date": 1651326678489,
"cart_id" : "550e8400-e29b-41d4-a716-446655440000",
"project_id" : "farmers-for-forests"
}
]
}

Response Parameters

Status Code

201

Response Data

{
"message": "Orders created successfully",
"partner_order_ids": [
"987346873685787647",
"345345343434534534"
]
}

Sample Request

curl --location --request POST 'BASE_URL/v3/integrations/vote/orders' --header 'Content-Type: application/json' --header 'x-api-key: API_KEY' --data-raw '{
"orders": [
{
"climes": 15,
"partner_order_id": "987346873685787647",
"customer_email": "johndoe@climes.io",
"customer_name": "John Doe",
"customer_phone": "+911234567890",
"unlock_date": 1651326671442,
"cart_id" : "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"project_id" : "farmers-for-forests"
},
{
"climes": 19,
"partner_order_id": "345345343434534534",
"customer_email": "johndoe@climes.io",
"customer_name": "John Doe",
"customer_phone": "+911234567890",
"unlock_date": 1651326678489,
"cart_id" : "550e8400-e29b-41d4-a716-446655440000",
"project_id" : "farmers-for-forests"
}
]
}'

Sample Response

Below are sample responses for the above request.

Responses

{
"message": "Orders created successfully",
"partner_order_ids": [
"987346873685787647",
"345345343434534534"
]
}