iotoms Docs

Approve a purchase order

PATCH
/api/v1/procurement/purchase-orders/{id}/approve

Moves a submitted purchase order to APPROVED. The required approvedBy query parameter records who approved it. Orders not in SUBMITTED status are rejected.

How to use it

  1. Submit the order first with Submit a purchase order; only SUBMITTED orders can be approved.
  2. Pass the approver's name or username in approvedBy.
  3. The status moves to APPROVED and the approval is recorded; next, use Send a purchase order to the vendor.

Authorization

BearerAuth
headerAuthorizationBearer <JWT>

Path Parameters

id*string

ID of the record (UUID).

Formatuuid

Query Parameters

approvedBy*string

Name or username of the approver, stored on the order. Required.

Header Parameters

X-TenantID*string

Your merchant's tenant code — the value typed in the Domain field on the iotoms login screen. See Concepts.

Response Body

OK

*/*
  1. response
status*string

Outcome of the call: SUCCESS when the request was processed; otherwise an error status.

message*string

Short human-readable message describing the outcome, e.g. which record was saved or why the call failed.

data?

The purchase order after the call, with its line items.

Example Request
curl -X PATCH 'https://beta.iotoms.com/api/v1/procurement/purchase-orders/497f6eca-6276-4993-bfeb-53cbbbba6f08/approve?approvedBy=string' \  -H 'X-TenantID: your-tenant-code'
Example Response
{  "status": "string",  "message": "string",  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "poNumber": "string",    "vendorId": "e9b57fab-1850-44d4-8499-71fd15c845a0",    "vendorName": "string",    "status": "string",    "orderDate": "2019-08-24",    "expectedDeliveryDate": "2019-08-24",    "totalAmount": 0,    "notes": "string",    "items": [      {        "id": 0,        "itemId": "string",        "itemName": "string",        "orderedQty": 0,        "receivedQty": 0,        "outstandingQty": 0,        "unitCost": 0,        "unitOfMeasure": "string",        "uomId": "4df47f00-a69d-4ff2-b50d-4a7649a4b70c",        "receivingLocationId": "f1f8626b-ea08-4582-99e5-64aabd817e6a",        "receivingLocationName": "string",        "sourceQuotationItemId": 0      }    ],    "rfqId": "5483c05b-f58d-4a80-82f1-a80d2c5d2632",    "sourceQuotationId": "5ebd081a-5e1a-48e9-b096-b5f5f5f7febd",    "createdAt": "2019-08-24T14:15:22Z"  }}