Skip to content

upsertPurchaseOrder

WRITE

Upsert purchase order.

POST /api/v1/purchasing/upsertPurchaseOrder
curl -X POST '<your-host>/api/v1/purchasing/upsertPurchaseOrder' \
  -H 'Authorization: Bearer <api-key>' \
  -H 'Content-Type: application/json' \
  -d '{
    "purchaseOrder": "string"
  }'
Response
{
  "results": [
    {
      "id": "string",
      "purchaseOrderId": "string"
    }
  ],
  "count": null
}

Parameters

ParameterType

Input schema

schema
{
  "type": "object",
  "properties": {
    "purchaseOrder": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "purchaseOrderType": {
              "type": "string",
              "enum": [
                "Purchase",
                "Outside Processing"
              ]
            },
            "status": {
              "type": "string",
              "enum": [
                "Draft",
                "Planned",
                "Needs Approval",
                "To Review",
                "To Receive",
                "To Receive and Invoice",
                "To Invoice",
                "Completed",
                "Rejected",
                "Closed"
              ]
            },
            "supplierId": {
              "type": "string",
              "minLength": 1
            },
            "locationId": {
              "type": "string"
            },
            "supplierLocationId": {
              "type": "string"
            },
            "supplierContactId": {
              "type": "string"
            },
            "supplierReference": {
              "type": "string"
            },
            "orderDate": {
              "type": "string"
            },
            "notes": {},
            "currencyCode": {
              "type": "string"
            },
            "exchangeRate": {
              "type": "number"
            },
            "exchangeRateUpdatedAt": {
              "type": "string"
            },
            "purchaseOrderId": {
              "type": "string"
            },
            "customFields": {}
          },
          "required": [
            "purchaseOrderType",
            "supplierId",
            "purchaseOrderId"
          ]
        },
        {
          "type": "object",
          "properties": {
            "purchaseOrderType": {
              "type": "string",
              "enum": [
                "Purchase",
                "Outside Processing"
              ]
            },
            "status": {
              "type": "string",
              "enum": [
                "Draft",
                "Planned",
                "Needs Approval",
                "To Review",
                "To Receive",
                "To Receive and Invoice",
                "To Invoice",
                "Completed",
                "Rejected",
                "Closed"
              ]
            },
            "supplierId": {
              "type": "string",
              "minLength": 1
            },
            "locationId": {
              "type": "string"
            },
            "supplierLocationId": {
              "type": "string"
            },
            "supplierContactId": {
              "type": "string"
            },
            "supplierReference": {
              "type": "string"
            },
            "orderDate": {
              "type": "string"
            },
            "notes": {},
            "currencyCode": {
              "type": "string"
            },
            "exchangeRate": {
              "type": "number"
            },
            "exchangeRateUpdatedAt": {
              "type": "string"
            },
            "id": {
              "type": "string"
            },
            "purchaseOrderId": {
              "type": "string"
            },
            "customFields": {}
          },
          "required": [
            "purchaseOrderType",
            "supplierId",
            "id",
            "purchaseOrderId"
          ]
        }
      ]
    },
    "receiptRequestedDate": {
      "type": "string"
    }
  },
  "required": [
    "purchaseOrder"
  ]
}