A purchase order is a document created by an entity with precise information about products and/or services that the entity intends to purchase from a counterpart (vendor). It also contains the entity and counterpart data.
Each item in the purchase order must have:
The list of items should be carefully filled to match the external catalog of products/services that the vendor offers.
It is possible to preview the purchase order and send it via email to the counterpart.
Purchase orders can move through different statuses during their lifecycle:
draft purchase order is not sent yet and can be edited anytime.issued.To create a purchase order, call POST /payable_purchase_orders:
The successful response contains the information about the recently created purchase order, including its ID:
To preview a draft purchase order before sending via email, call POST /payable_purchase_orders/{purchase_order_id}/preview, passing the purchase order ID in the URL:
The successful response contains information about the preview:
To send a purchase order via email to a counterpart, call POST /payable_purchase_orders/{purchase_order_id}/send and provide the email subject and body text. The purchase order will be attached as a PDF file to the email.
The successful response contains the ID of the sent email:
Notes:
status field changes from draft to issued and the issued_at field is set to the current date.mail.attach_documents_as_pdf field to true in your partner settings. For more information, see Update partner settings.To resend an already issued purchase order, you can call POST /payable_purchase_orders/{purchase_order_id}/send again, optionally with different subject_text and body_text templates.
Resending a purchase order does not change its status or issued_at date.
To get information about all purchase orders associated with the specified entity, call GET /payable_purchase_orders.
To get information about a specific purchase order, call GET /payable_purchase_orders/{purchase_order_id}.
To edit an existing purchase order, call PATCH /payable_purchase_orders/{purchase_order_id}. Only purchase orders in the draft status can be edited.
To delete a specific purchase order, call DELETE /payable_purchase_orders/{purchase_order_id}. Only purchase orders in the draft status can be deleted.