Skip to main content

Create order

POST {{base_url}}/orders

Description

This API endpoint creates a new order with the provided details.

Request Headers:

NameDescription
tenantId(required, header) The tenant ID associated with the request.
countryCode(required, header) The country code associated with the request.

Request Body Schema (JSON):

{
"requestId": "string",
"globalOrderNumber": "string",
"orderNumber": "string",
"preferredProvider": "DEFAULT",
"userId": "string",
"buyerLocation": {
"latitude": 0,
"longitude": 0,
"address": "string",
"userId": "string"
},
"sellerLocation": {
"latitude": 0,
"longitude": 0,
"address": "string",
"userId": "string"
},
"buyerPhoneNumber": "string",
"sellerPhoneNumber": "string",
"buyerName": "string",
"sellerName": "string",
"items": [
{
"name": "string",
"price": 0,
"quantity": 1
}
]
}

Example:

<orderCreationRequest>
<requestId>string</requestId>
<globalOrderNumber>string</globalOrderNumber>
<orderNumber>string</orderNumber>
<preferredProvider>DEFAULT</preferredProvider>
<userId>string</userId>
<buyerLocation>
<latitude>0</latitude>
<longitude>0</longitude>
<address class=&#x27;preserveHtml&#x27; class=&#x27;preserveHtml&#x27; class=&#x27;preserveHtml&#x27; class=&#x27;preserveHtml&#x27; class=&#x27;preserveHtml&#x27; class=&#x27;preserveHtml&#x27; class=&#x27;preserveHtml&#x27; class=&#x27;preserveHtml&#x27;>string</address>
<userId>string</userId>
</buyerLocation>
<sellerLocation>
<latitude>0</latitude>
<longitude>0</longitude>
<address class=&#x27;preserveHtml&#x27; class=&#x27;preserveHtml&#x27; class=&#x27;preserveHtml&#x27; class=&#x27;preserveHtml&#x27; class=&#x27;preserveHtml&#x27; class=&#x27;preserveHtml&#x27; class=&#x27;preserveHtml&#x27; class=&#x27;preserveHtml&#x27;>string</address>
<userId>string</userId>
</sellerLocation>
<buyerPhoneNumber>string</buyerPhoneNumber>
<sellerPhoneNumber>string</sellerPhoneNumber>
<buyerName>string</buyerName>
<sellerName>string</sellerName>
<items>
<item>
<name>string</name>
<price>0</price>
<quantity>1</quantity>
</item>
</items>
</orderCreationRequest>

Responses: Status 200 OK Description:

Order created successfully. Response Body Schema (JSON):

{
"status": "boolean",
"statusCode": "integer",
"message": "string",
"data": {},
"errors": [
{
"message": "string",
"descriptiveMessage": "string"
}
]
}

Example:

<orderCreationResponse>
<status>true</status>
<statusCode>0</statusCode>
<message>string</message>
<data></data>
<errors>
<error>
<message>string</message>
<descriptiveMessage>string</descriptiveMessage>
</error>
</errors>
</orderCreationResponse>

400 Bad Request

Description: Invalid request. 404 Not Found

Description: Not found.

LANGUAGE

AUTHORIZATION

Bearer

CURL REQUEST


curl --request POST \ 
--url /orders \
--header 'accept: application/json' \
--header 'content-type: application/json'

RESPONSE


Click Try It! to start a request and see the response here!