### Overview

In order to retrieve metadata for existing purchase orders, you must:

- Be authenticated user

Information on how you can authenticate: [Authentication](https://developer.sellercloud.com/dev-article/authentication/)

As soon as you do authentication and receive a valid token, it needs to be passed on the call for getting purchase orders.

You can do additional filtering and pagination on the purchase orders.

### Endpoint

Example for such endpoint for TT server: [https://tt.api.sellercloud.com/rest/api/purchaseorders?pageNumber=1&pageSize=1](https://tt.api.sellercloud.com/rest/api/purchaseorder/getall?pageNumber=1&pageSize=1)

### Request

Information about expected request parameters and their type can be found on swagger UI [https://tt.api.sellercloud.com/rest/swagger](https://tt.api.sellercloud.com/rest/swagger).

- Method Type: **HttpGet**  
- Authorization: Use **Bearer Token** \+ token received from token authentication  
- Header info: **Content-Type: application/json**  
- Parameters:

|     |     |     |     |
| --- | --- | --- | --- |
| Parameters | Data Type | Description | Is Required |
| pageNumber | integer | Number of page | no |
| pageSize | integer | Number of purchase orders per page | no |
| pOIDs | List | List of IDs of purchase orders | no |
| companyIDList | List | List of IDs of companies | no |
| pOStatuses | List | Saved,Ordered,Received, Pending,Cancelled, Competed. | no |
| receivingWarehouseID | List | List of receiving warehouse IDs | no |
| shippingStatuses | List | None, PartiallyShipped,FullyShipped | no |
| receivedStatuses | List | None, PartiallyReceived, FullyReceived | no |
| createDateFrom | DateTime | Minimum creation date | no |
| createDateTo | DateTime | Maximum creation date | no |
| paymentStatus | List | NoPayment, Authorized, Charged, Uncleared, PartiallyRefund, eBayPaid, PaymentError<br>**_Important: That filter should only be utilized if client setting “Enable vendor invoices workflow” is disabled._** | no |
| inventoryCountEnabled | int? | Is Inventory Count Enabled<br>0: No, 1: Yes | no |
| vendorInvoiced | VendorInvoicedStatus? | Is Vendor Invoiced . This filter should only be utilized if client setting “Enable vendor invoices workflow” is enabled. | no |
| approved | int? | Is Approved, 0: No, 1: Yes | no |
| keyword | string | A search term for performing a global search. No | no |

### Response

- If user is authenticated and provides a valid token, then response will be **Status Code 200 => OK** and purchase order metadata in JSON format  
- If user is not authenticated, then response will be **Status Code 401 => Not Valid Token**  
- On server response => **Status Code 500 => Internal Server Error**

### Response Body Format

```
{
  "Items": [
    {
      "EmailSentCount": 0,
      "DisableInventoryCount": true,
      "POType": 0,
      "CancelledPOID": 0,
      "TotalBalance": 0,
      "TotalBalanceNotReceivedGood": 0,
      "VendorID": 0,
      "PurchaseTitle": "string",
      "CreatedOn": "2024-06-03T09:24:01.337Z",
      "CreatedBy": 0,
      "OrderTotal": 0,
      "TaxTotal": 0,
      "ShippingTotal": 0,
      "GrandTotal": 0,
      "DateOrdered": "2024-06-03T09:24:01.337Z",
      "LastRevisedOn": "2024-06-03T09:24:01.337Z",
      "RevisedBy": 0,
      "PurchaseOrderStatus": 0,
      "PaymentStatus": 0,
      "ExtraCharges": 0,
      "TotalRefunded": 0,
      "PurchaseOrdersShippingStatus": 0,
      "TrackingNumber": "string",
      "TrackingNumbers": [
        {
          "ShippedOn": "2024-06-03T09:24:01.337Z",
          "ShippingCarrier": "string",
          "TrackingNumber": "string"
        }
      ],
      "ShippedOn": "2024-06-03T09:24:01.337Z",
      "CourierService": "string",
      "PurchaseOrdersPriority": 0,
      "ReceivingStatus": 0,
      "CompanyID": 0,
      "PurchaseOrdersApproved": true,
      "DropShipOrderNumber": 0,
      "VendorInvoiceNumber": "string",
      "VendorInvoiceFileName": "string",
      "VendorInvoiceFileNameOriginal": "string",
      "Invoices": [
        {
          "InvoiceDate": "2024-06-03T09:24:01.337Z",
          "InvoiceNumber": "string"
        }
      ],
      "Memo": "string",
      "ExpectedDeliveryDate": "2024-06-03T09:24:01.337Z",
      "DiscountTotal": 0,
      "bExported": true,
      "DisplayName": "string",
      "CM": 0,
      "NotesCount": 0,
      "PaidOn": "2024-06-03T09:24:01.337Z",
      "UnitCounts": 0,
      "PurchaseOrderCreditMemo": true,
      "WarehouseID": 0,
      "Items": [
        {
          "ID": 0,
          "SKU": "string",
          "VendorSKU": "string",
          "ProductName": "string",
          "QtyOrdered": 0,
          "QtyReceived": 0,
          "UnitPrice": 0,
          "AdjustedPrice": 0,
          "LineTotal": 0,
          "ExpectedDeliveryDate": "2024-06-03T09:24:01.337Z",
          "ItemNotes": "string"
        }
      ],
      "RequestedShippingCarrier": "string",
      "RequestedShippingService": "string",
      "ShipToAddress": {
        "ClientID": 0,
        "UserID": 0,
        "HomePhoneExt": "string",
        "PhoneNumberExt": "string",
        "IsShippingAddress": true,
        "IsBillingAddress": true,
        "AddressClassification": 0,
        "Notes": "string",
        "HomePhone": "string",
        "EmailAddress": "string",
        "AddressStatus": 0,
        "AddressSource": 0,
        "ID": 0,
        "FirstName": "string",
        "MiddleInitial": "string",
        "LastName": "string",
        "CompanyName": "string",
        "StreetLine1": "string",
        "StreetLine2": "string",
        "City": "string",
        "StateName": "string",
        "StateCode": "string",
        "PostalCode": "string",
        "CountryName": "string",
        "CountryCode": "string",
        "PhoneNumber": "string",
        "FaxNumber": "string",
        "WebSiteURL": "string"
      },
      "ID": 0
    }
  ],
  "TotalResults": 0
}
```
