Purchase Orders

Update purchase order status

Changed on
patch/purchaseorders/{id}/status

Request

  • Base URL
    https://api.getmaintainx.com/v1
  • Auth
    HTTP bearer

Path parameters

idnumber required

Query parameters

skipWebhookboolean

Set skipWebhook=true, skipWebhook=1 or skipWebhook=yes to skip all webhooks upon successful operation on the endpoint. Learn more about webhooks

Request body

status'APPROVED' | 'CANCELED' | 'COMPLETED' | 'DECLINED' | 'PARTIALLY_FULFILLED' | 'PENDING' required

Here is a list of valid status transitions:

Current StatusAllowed TransitionsDescription
REQUESTEDCANCELED DECLINED PENDINGInitial state when PO is first created
PENDINGAPPROVED CANCELED DECLINEDPO is awaiting approval
DECLINEDCANCELED PENDINGPO was rejected and needs revision
APPROVEDCANCELED or start receiving itemsPO is approved and items can be received
PARTIALLY_FULFILLEDCOMPLETEDSome items have been received
CANCELEDNonePO has been canceled and cannot be modified
COMPLETEDPARTIALLY_FULFILLEDAll items have been received

Notes:

  • Status changes trigger notifications to relevant users and vendors
  • You can subscribe to status changes using webhooks
  • The DECLINED status is displayed as 'Rejected' in the application interface
  • Moving to PARTIALLY_FULFILLED happens automatically when items are received
  • Use the optional reviewNote field to provide feedback when declining a purchase order
reviewNotestring nullable

Notes to be left for changes to be made when sending a Purchase Order for revision

Example request

{
  "status": "APPROVED",
  "reviewNote": "Please adjust quantities and resubmit"
}

Response

Successfully updated Purchase Order

Example response

{
  "purchaseOrder": {
    "id": 135,
    "note": "Please deliver during business hours",
    "title": "Office Supplies Order",
    "reviewNote": "Please adjust quantities and resubmit",
    "dueDate": "2022-01-01T00:00:00.000Z",
    "creatorId": 432,
    "vendorId": 432,
    "autoGeneratedNumber": 987,
    "overrideNumber": "A123",
    "approverId": 135,
    "approvalDate": "2022-01-01T00:00:00.000Z",
    "createdAt": "2022-01-01T00:00:00.000Z",
    "updatedAt": "2022-01-01T00:00:00.000Z",
    "deletedAt": "2022-01-01T00:00:00.000Z",
    "items": [
      {
        "id": 23,
        "partId": 43,
        "price": 25000,
        "priceDecimal": "250.000000",
        "quantityOrdered": 4,
        "quantityReceived": 3,
        "unitCost": 125000,
        "unitCostDecimal": "1250.000000",
        "fulfillments": [
          {
            "id": 23,
            "locationId": 852,
            "quantityReceived": "3.000000",
            "isLegacy": true
          }
        ],
        "lineExtraFields": {
          "Ordered Date": "2023-01-01"
        },
        "partExtraFields": {
          "Part Number": "321"
        }
      }
    ],
    "costs": [
      {
        "id": 123,
        "name": "Sales Tax",
        "type": "AMOUNT_TAXABLE",
        "amount": 125000
      }
    ],
    "thumbnail": {
      "id": 12345,
      "mimeType": "image/png",
      "fileName": "image.png",
      "url": "http://example.com/image.png",
      "createdAt": "2022-01-01T00:00:00.000Z",
      "width": 220,
      "height": 100
    },
    "attachments": [
      {
        "id": 12345,
        "mimeType": "image/png",
        "fileName": "image.png",
        "url": "http://example.com/image.png",
        "createdAt": "2022-01-01T00:00:00.000Z",
        "width": 220,
        "height": 100
      }
    ],
    "vendorContactIds": [
      12,
      34,
      56
    ],
    "shippingAddress": {
      "city": "Montreal",
      "country": "Canada",
      "postalCode": "H4B 5G0",
      "state": "Quebec",
      "street": "1909 Avenue des Canadiens-de-Montréal",
      "label": "1909 Avenue des Canadiens-de-Montréal, Montreal, H4B 5G0, QC, CA "
    },
    "billingAddress": {
      "city": "Montreal",
      "country": "Canada",
      "postalCode": "H4B 5G0",
      "state": "Quebec",
      "street": "1909 Avenue des Canadiens-de-Montréal",
      "label": "1909 Avenue des Canadiens-de-Montréal, Montreal, H4B 5G0, QC, CA "
    },
    "extraFields": {
      "Ordered Date": "2023-01-01"
    },
    "status": "APPROVED"
  }
}

Changes

    • warning

      added the new APPROVED enum value to the / response property for the response status

    • warning

      added the new CANCELED enum value to the / response property for the response status

    • warning

      added the new COMPLETED enum value to the / response property for the response status

    • warning

      added the new DECLINED enum value to the / response property for the response status

    • warning

      added the new PARTIALLY_FULFILLED enum value to the / response property for the response status

    • warning

      added the new PENDING enum value to the / response property for the response status

    • warning

      added the new REQUESTED enum value to the / response property for the response status

    • info

      endpoint added