Create Purchase Order


This endpoint is used to create the purchase order

Basic Information

  • Method: POST
  • URI: /purchase_orders
  • Request Format: JSON
  • Response Format: JSON

Headers

The following headers should be sent along with the request

  • Accept: application/json
  • Authorization: Your API Key

Request

Below table list the request parameters which can be sent to create purchase order API in JSON format

{info} The request parameters should be sent as a JSON object in the request body

Parameter Type Required Description
supplier_email Email Yes Valid email of the supplier
purchase_order_items Array of Objects Yes An array of objects representing the items in the order. Please check purchase order items table for the details about the single object
currency String Yes Currency code of the amount. For example: "SAR"
remark String No It is an optional field to add any additional detail about the purchase order


"purchase_order_items" object

Parameter Type Required Description
name String No The name of the attribute, like "Screen Size."
sku_code String Yes A valid SKU code of a product
quantity Integer Yes The quantity of the item in the order. It must be greater than 0.
unit_price Number Yes The unit price of the item. It must be greater than 0.


Sample Request


URL:

https://dev-fc-api.aymakan.net/api/v1/purchase_orders


Body:

{
 "supplier_email": "[email protected]",
 "purchase_order_items": [
   {
     "sku_code": "airpods-sku",
     "quantity": 10,
     "unit_price": 10.4
   }
 ],
 "remark": "Testing PO",
 "currency": "SAR"
}

Response

Sample response is added here:

Success:

{
    "success": true,
    "message": "Purchase Order saved successfully",
    "data": null,
    "meta": null
}