data-src=../../../../../includes/commerce-only.md

placeOrderForPurchaseOrder mutation

The placeOrderForPurchaseOrder mutation converts an approved purchase order to an order. If the request is successful, the status of the purchase order is ORDER_PLACED.

data-variant=info
data-slots=text
If you want to place a purchase order using the cart ID instead of the purchase order UID, use the placePurchaseOrder mutation.

Syntax

mutation {
    placeOrderForPurchaseOrder(
        input: PlaceOrderForPurchaseOrderInput!
    ) {
        PlaceOrderForPurchaseOrderOutput
    }
}

Reference

The placeOrderForPurchaseOrder reference provides detailed information about the types and fields defined in this mutation.

Example usage

The following example places an order based on the approved purchase order.

Request:

mutation {
  placeOrderForPurchaseOrder(
    input: {
        purchase_order_uid: "MQ=="
    }
  ) {
   order {
    number
   }
  }
}

Response:

{
  "data": {
    "placeOrderForPurchaseOrder": {
      "order": {
        "number": "000000001"
      }
    }
  }
}