Skip to content

Posting an Order

Posting an Order

POST Endpoint:

https://strapi-3apoh.ondigitalocean.app/api/live-orders

Request Body:

amount: number;
considerationPrice: number;
description: string;
firstPartyAddress: string;
firstPartyMobileNumber: string;
firstPartyName: string;
firstPartyPan: string;
paidBy: string; # "First Party" | "Second Party"
purpose: string;
secondPartyAddress: string;
secondPartyName: string;
secondPartyPan: string;
state: string;
purchasedBy: string;

Example Response:

{
"message": "Successfully created the order!",
"orderId": "<order-id>"
}
  • Purpose and state must exist: We look up the combination of purpose and state. If not found, the request fails.
  • When the purpose follows consideration price (toFollowConsiderationPrice):
    • considerationPrice must be > 0.
    • amount is calculated by the server as: considerationPrice * amountPercentConsideration, then clamped to the allowed range. If the purpose has a fixed amount, that fixed value is used as both min and max.
  • When the purpose does NOT follow consideration price:
    • If the purpose has a fixed amount, your amount must equal that fixed value.
    • If the purpose has a range (min/max), your amount must be within that range (inclusive).
  • Type validation: All fields are type-checked. Invalid types or missing required fields will result in a 400 Bad Request with details.

For more details on available purposes and their configuration (fixed/min/max, percentage), see the Organization portal: Article List.

If any validation fails, the API returns an appropriate error message with a status code of 4xx.

StatusWhen it happensExample message
200Order created successfullySuccessfully created the order!
400Invalid input schema or typesInvalid data. plus details per field
400Purpose follows consideration price but considerationPrice <= 0Consideration price is required to be greater than 0 for the selected purpose. Please provide a valid consideration price.
400Purpose has fixed amount and provided amount differsThe purpose have a fixed amount of: <fixed>, while the amount passed is equal to: <amount>
400Purpose has range and provided amount is out of boundsThe purpose can take an amount in the range of: <min>-<max>, while the amount passed is equal to: <amount>
403User is not authenticated (Bearer token not provided)ForbiddenError
404Purpose/state combination not foundPurpose with the name: <purpose> cannot be found.
Terminal window
curl -X POST https://strapi-3apoh.ondigitalocean.app/api/live-orders \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your-token>" \
-d '{
"amount": 1000,
"considerationPrice": 1200,
"description": "Sample Order",
"firstPartyAddress": "123 Street",
"firstPartyMobileNumber": "9876543210",
"firstPartyName": "John Doe",
"firstPartyPan": "ABCDE1234F",
"paidBy": "First Party",
"purpose": "Loan Agreement [5(d)]",
"secondPartyAddress": "456 Avenue",
"secondPartyName": "Jane Smith",
"secondPartyPan": "XYZAB9876P",
"state": "Rajasthan",
"purchasedBy": "John Doe"
}'