Create New Purchase Order

Overview

In order to create new purchase order, you can consume the endpoint presented in this article. In order to consume it, you must:

  • Be authenticated user

For information on how you can authenticate, see: Authentication

As soon as you do authentication and receive a valid token, it needs to be passed to the service call.

Endpoint

Example for such endpoint for TT server is:

https://tt.api.sellercloud.com/rest/api/PurchaseOrders​​

For your server endpoint will be:

https://{your_server_id}.api.sellercloud.com/rest/api/PurchaseOrders

Request

Information about expected request parameters can be found on swagger UI https://tt/api.sellercloud.com/rest/swagger.

  • Method Type: HttpPost
  • Authorization: Use Bearer Token (where ‘Token’ is the token received from token authentication)
  • Header info: Content-Type: application/json
  • Request Body:

ParameterData TypeDescriptionIs Required
CompanyIDintegerPO company IDtrue
VendorIDintegerPO vendor IDtrue
POTypeenumPO type.

Possible values can be found here.

true
CaseQtyModeboolPO case quantity mode.true
DefaultWarehouseIDintegerPO warehouse ID.

If provided this warehouse will be set for the PO and for all PO products.

Set to null or omit in the request if not needed.

false
DescriptionstringPO description

Set to null or omit in the request if not needed.

false
VendorNotestringPO vendor note

Set to null or omit in the request if not needed.

false
PaymentTermIDintPayment term ID.

Possible values can be obtained using this endpoint.

Set to null or omit in the request if not needed.

false
ExpectedDeliveryDatedatePO expected delivery date. Should only be provided if client setting ‘Force user to enter Expected Delivery Date’ is enabled.

Set to null or omit in the request if not needed.

false
ProductsListList with PO product itemstrue
Product.ProductIDstringProduct IDtrue
Product.QtyUnitsOrderedintegerQuantity of ordered units of this product.

Should only be set if case quantity mode is set to false.

Set to null or omit in the request if not needed.

Should be greater than 0.

false
Product.UnitPricedecimalUnit price.

Should only be set if case quantity mode is set to false.

Cannot be negative.

false
Product.QtyCasesOrderedintegerQuantity of ordered cases with this product.

Should only be set if case quantity mode is set to true.

Set to null or omit in the request if not needed.

Should be greater than 0.

false
Product.QtyUnitsPerCaseintegerQuantity of unites per case for this product.

Should only be set if case quantity mode is set to true.

Set to null or omit in the request if not needed.

Should be greater than 0.

false
Product.CasePricedecimalPrice per case for this product.

Should only be set if case quantity mode is set to true.

Set to null or omit in the request if not needed.

Cannot be negative.

false
Product.DiscountTypeenumProduct discount type.

Possible values can be found here.

Can only be provided if client setting ‘Enable Multi Discount for Purchase Order’ is disabled.

Set to null or omit in the request if not needed.

false
Product.DiscountValuedecimalProduct discount value.

Can only be provided if client setting ‘Enable Multi Discount for Purchase Order’ is disabled.

Set to null or omit in the request if not needed.

false
Product.ItemNotesstringAdd item notes on PO Item levelfalse
Product.BillingAddressAddressPO billing address.

Can only be provided if client setting ‘Enable BillTo address for Purchase Orders’ is enabled.

Set to null or omit in the request if not needed.

false
Product.ShippingAddressAddressPO shipping address

Set to null or omit in the request if not needed.

false
Address.FirstNamestringFirst namefalse
Address.LastNamestringLast namefalse
Address.MiddleNamestringMiddle namefalse
Address.ZipCodestringZip codefalse
Address.CitystringCityfalse
Address.CountrystringTwo letter country codetrue
Address.BusinessstringBusiness namefalse
Address.AddressLine1stringAddress line 1false
Address.AddressLine2stringAddress line 2false
Address.FaxstringFaxfalse
Address.RegionstringRegionfalse
Address.StatestringStatefalse
Adress.PhonestringPhonefalse

Response

  • If user is authenticated and create purchase order is successful, then response will be Status Code 200 => OK and ID of the created purchase order is returned.
  • If user is not authenticated, then response will be Status Code 401 => Not Valid Token
  • In case of error, response will be Status Code 500 => Internal Server Error

Was this article helpful?

Next
PO Type