Create PO API
### Create Po API
This API endpoint is used to create a purchase order externally. The request should be sent as an HTTP POST to the specified URL. The request body should be in raw format and include data related to the owner, currency, billTo, shipTo, category, delivery date, list of items, vendor, attributes, forms, end date, contract ID, type, logo, posting details, and purchase order number.
### Request Body
| Param | Required | Type | Description |
| --- | --- | --- | --- |
| data | Mandatory | Object | Main container for purchase order data. |
| owner | Mandatory | Object | Details about the owner of the purchase order. |
| ownerName | Mandatory | String | Name of the owner. |
| ownerEmail | Mandatory | String | Email address of the owner. |
| currency | Mandatory | String | The currency code for the purchase order (e.g., "INR"). |
| superId | Optional | Integer | Super ID associated with the purchase order. |
| billTo | Mandatory | Object | Billing information. |
| name | Mandatory | String | Name for billing. |
| value | Mandatory | Integer | Billing value. |
| shipTo | Mandatory | Object | Shipping information. |
| name | Mandatory | String | Name for shipping. |
| value | Mandatory | Integer | Shipping value. |
| category | Mandatory | Object | Category information. |
| id | Mandatory | Integer | Category ID. |
| label | Mandatory | String | Category label. |
| deliveryDate | Mandatory | Integer | Delivery date associated with the purchase order. |
| list | Mandatory | Array | Array of items in the purchase order. |
| base | Mandatory | Number | Base amount for the item. |
| product | Mandatory | Object | Product details. |
| label | Mandatory | String | Label of the product. |
| value | Mandatory | Integer | Value of the product. |
| itemReferenceNo | Mandatory | String | Item reference number. |
| isMaster | Mandatory | Boolean | Indicates if it's a master product. |
| productId | Mandatory | String | ID of the product. |
| gl | Optional | String | General ledger code. |
| image | Optional | String | URL or base64-encoded representation of the image. |
| title | Optional | String | Title of the product. |
| desc | Optional | String | Description of the product. |
| currency | Mandatory | String | Currency of the product. |
| hsn | Optional | String | Harmonized System Nomenclature code. |
| sku | Optional | String | Stock Keeping Unit code. |
| type | Optional | String | Type of the product. |
| service | Optional | String | Indicates if it's a service. |
| units | Optional | String | Units of the product. |
| sale | Mandatory | Boolean | Indicates if the product is for sale. |
| amount | Mandatory | Number | Amount of the product. |
| buy | Mandatory | Boolean | Indicates if the product is for purchase. |
| taxCode | Optional | String | Tax code for the product. |
| qtty | Mandatory | Number | Quantity of the item. |
| notes | Optional | String | Additional notes for the item. |
| contractItemId | Mandatory | String | Contract item ID. |
| title | Mandatory | String | Title of the purchase order. |
| vendor | Mandatory | Object | Vendor information. |
| id | Mandatory | Integer | Vendor ID. |
| registeredId | Mandatory | String | Registered ID of the vendor. |
| attrs | Optional | Object | Additional attributes. |
| forms | Optional | Object | Forms associated with the purchase order. |
| endDate | Optional | Integer | End date of the purchase order. |
| contractId | Optional | Integer | Contract ID. |
| type | Optional | String | Type of purchase order. |
| logo | Optional | String | URL or base64-encoded representation of the logo. |
| postingTriggeredAt | Optional | Integer | Timestamp when posting was triggered. |
| postingErrors | Optional | String | Errors encountered during posting. |
| postingDocNo | Optional | String | Document number generated during posting. |
| postingTriggered | Optional | Boolean | Indicates if posting was triggered. |
| postingFailed | Optional | Boolean | Indicates if posting failed. |
| po_no | Optional | String | Purchase order number. |
### Response
| Param | Type | Description |
| --- | --- | --- |
| vouchers | Array | Contains the list of vouchers with various details such as ID, employee information, currency, amounts, status, and other attributes. |
| total | Integer | Represents the total number of vouchers available. |
| currentPage | Integer | Indicates the current page number. |
| totalPages | Integer | Specifies the total number of pages based on the pageSize. |
Example Response:
``` json
{
"orderId": "PO-INDIAN-00412",
"success": true,
"message": "PO created successfully"
}
```
Headers
DICE-APP-ID
X-CLIENT-ID
X-CLIENT-SECRET
Request
This endpoint expects an object.
data
Response
OK
orderId
success
message

