> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.gappify.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.gappify.com/_mcp/server.

# Retrieve Purchase Orders by ID

GET https://api.gappify.com/v1/purchase-orders/{source-system-id}

Retrieve Purchase Orders by ID

Reference: https://developers.gappify.com/api-reference/inbound-to-gappify/4/get-by-id

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://api.gappify.com/v1` (Production, default)
- `https://api.uat.gappifyinc.com/v1` (UAT)

## Request

### Path parameters

- `source-system-id` (string, required)

## Response

### 200

- `source_system_id` (string, required) — Unique identifier of the purchase order line in the erp system. This value will be used to match source data and perform upserts.
- `vendor_id` (string, required) — Id of the Vendor/Supplier. This value should match the source_vendors->g_source_system_id which will be used to send back as part of JE to ERP.
- `po_line_amount` (double, required) — Total amount in transaction currency of the PO line.
- `po_line_status` (string, required) — Status of the PO line. Status will be leveraged to filter lines that are not active anymore.
- `transaction_currency_id` (string, required) — Currency id in which the transaction was posted in the gl. Should match the g_source_system_id in the currency list of source_coas.
- `po_id` (string, optional) — System Id of the purchase order record. Required when `type` is `po` or blank/null; omit for PR rows.
- `po_number` (string, optional) — PO number value. Required when `type` is `po` or blank/null; omit for PR rows.
- `po_line_id` (string, optional) — System Id of the purchase order line. Required when `type` is `po` or blank/null; omit for PR rows.
- `po_header_description` (string, optional) — Description of the purchase order.
- `po_line_description` (string, optional) — Description of the PO line.
- `po_header_amount` (double, optional) — Total amount at the header level of the PO in transaction currency.
- `po_owner` (string, optional) — Name of the PO owner.
- `service_end_date` (date, optional) — End date of the PO line.
- `service_start_date` (date, optional) — Start date of the PO line.
- `invoiced_amount` (double, optional) — Amount invoiced in transaction currency of the PO line.
- `po_balance` (double, optional) — Balance remaining in transaction currency of the PO line.
- `email` (string, optional) — Email of the PO owner.
- `subsidiary_id` (string, optional) — Subsidiary id linked to the po line. This value should match the g_source_system_id in source_coas.
- `subsidiary_currency_id` (string, optional) — Subsidiary currency id of the posted transaction line in the gl. Should match the name in the currency list of source_coas.
- `glaccount_debit_id` (string, optional) — Expense glaccount id linked to the po line. This value should match the g_source_system_id in source_coas.
- `glaccount_credit_id` (string, optional) — Liability glaccount id linked to the po line. This value should match the g_source_system_id in source_coas.
- `department_debit_id` (string, optional) — Expense department/cost center id linked to the po line. This value should match the g_source_system_id in source_coas
- `department_credit_id` (string, optional) — Liability department/cost center id linked to the po line. This value should match the g_source_system_id in source_coas.
- `location_debit_id` (string, optional) — Expense location id linked to the po line. This value should match the g_source_system_id in source_coas.
- `location_credit_id` (string, optional) — Liability location id linked to the po line. This value should match the g_source_system_id in source_coas.
- `class_debit_id` (string, optional) — Expense class id linked to the po line. This value should match the g_source_system_id in source_coas.
- `class_credit_id` (string, optional) — Liability class id linked to the po line. This value should match the g_source_system_id in source_coas.
- `product_debit_id` (string, optional) — Expense product id linked to the po line. This value should match the g_source_system_id in source_coas.
- `product_credit_id` (string, optional) — Liability product id linked to the po line. This value should match the g_source_system_id in source_coas.
- `project_debit_id` (string, optional) — Expense project id linked to the po line. This value should match the g_source_system_id in source_coas.
- `project_credit_id` (string, optional) — Liability project id linked to the po line. This value should match the g_source_system_id in source_coas.
- `region_debit_id` (string, optional) — Expense region id linked to the po line. This value should match the g_source_system_id in source_coas.
- `region_credit_id` (string, optional) — Liability region id linked to the po line. This value should match the g_source_system_id in source_coas.
- `company_debit_id` (string, optional) — Expense company id linked to the po line. This value should match the g_source_system_id in source_coas.
- `company_credit_id` (string, optional) — Liability company id linked to the po line. This value should match the g_source_system_id in source_coas.
- `intercompany_debit_id` (string, optional) — Expense intercompany id linked to the po line. This value should match the g_source_system_id in source_coas.
- `intercompany_credit_id` (string, optional) — Liability intercompany id linked to the po line. This value should match the g_source_system_id in source_coas.
- `channel_debit_id` (string, optional) — Expense channel id linked to the po line. This value should match the g_source_system_id in source_coas.
- `channel_credit_id` (string, optional) — Liability channel id linked to the po line. This value should match the g_source_system_id in source_coas.
- `po_line_amount_cancelled` (double, optional) — Any po line amount that has been canceled.
- `cc_email` (string, optional) — CC emails to be used as part of outreach. Emails should be ";" separated.
- `po_date` (date, optional) — PO creation date
- `po_line_amount_usd` (double, optional)
- `po_balance_usd` (double, optional)
- `prepaid_account` (string, optional) — GL account name used for prepaid expenses when posting prepaid journal entries. Links to source_coas name.
- `prepaid_account_id` (string, optional) — GL account ID used for prepaid expenses when posting prepaid journal entries. Links to source_coas source_system_id.
- `custom_text_1` (string, optional) — User-defined custom text field
- `custom_text_2` (string, optional) — User-defined custom text field
- `custom_text_3` (string, optional) — User-defined custom text field
- `custom_text_4` (string, optional) — User-defined custom text field
- `custom_text_5` (string, optional) — User-defined custom text field
- `custom_date_1` (date, optional) — User-defined custom date field
- `custom_date_2` (date, optional) — User-defined custom date field
- `custom_date_3` (date, optional) — User-defined custom date field
- `custom_date_4` (date, optional) — User-defined custom date field
- `custom_date_5` (date, optional) — User-defined custom date field
- `custom_numeric_1` (float, optional) — User-defined custom numeric field
- `custom_numeric_2` (float, optional) — User-defined custom numeric field
- `custom_numeric_3` (float, optional) — User-defined custom numeric field
- `custom_numeric_4` (float, optional) — User-defined custom numeric field
- `custom_numeric_5` (float, optional) — User-defined custom numeric field
- `type` (string, optional) — Row discriminator. Set to `pr` to ingest a Purchase Request; `po` or blank/null is treated as a Purchase Order. Values are case-normalized to lowercase on write.
- `pr_id` (string, optional) — System Id of the purchase request record. Required when `type` is `pr`; omit for PO rows.
- `pr_number` (string, optional) — PR number value. Required when `type` is `pr`; omit for PO rows.
- `pr_line_id` (string, optional) — System Id of the purchase request line. Required when `type` is `pr`; omit for PO rows.

## Errors

### 401 Unauthorized Error

- `message` (string, required) — The error message
- `success` (boolean, required)

### 422 Unprocessable Entity Error

- `message` (string, required) — The error message
- `errors` (string, required) — The error details

### 404 Not Found Error

- `list of string`

### 500 Internal Server Error

- `list of string`

## Examples

**Response**

```json
{
  "source_system_id": "source_system_id",
  "vendor_id": "vendor_id",
  "po_line_amount": 1.1,
  "po_line_status": "po_line_status",
  "transaction_currency_id": "transaction_currency_id",
  "po_id": "po_id",
  "po_number": "po_number",
  "po_line_id": "po_line_id",
  "po_header_description": "po_header_description",
  "po_line_description": "po_line_description",
  "po_header_amount": 1.1,
  "po_owner": "po_owner",
  "service_end_date": "2023-01-15",
  "service_start_date": "2023-01-15",
  "invoiced_amount": 1.1,
  "po_balance": 1.1,
  "email": "email",
  "subsidiary_id": "subsidiary_id",
  "subsidiary_currency_id": "subsidiary_currency_id",
  "glaccount_debit_id": "glaccount_debit_id",
  "glaccount_credit_id": "glaccount_credit_id",
  "department_debit_id": "department_debit_id",
  "department_credit_id": "department_credit_id",
  "location_debit_id": "location_debit_id",
  "location_credit_id": "location_credit_id",
  "class_debit_id": "class_debit_id",
  "class_credit_id": "class_credit_id",
  "product_debit_id": "product_debit_id",
  "product_credit_id": "product_credit_id",
  "project_debit_id": "project_debit_id",
  "project_credit_id": "project_credit_id",
  "region_debit_id": "region_debit_id",
  "region_credit_id": "region_credit_id",
  "company_debit_id": "company_debit_id",
  "company_credit_id": "company_credit_id",
  "intercompany_debit_id": "intercompany_debit_id",
  "intercompany_credit_id": "intercompany_credit_id",
  "channel_debit_id": "channel_debit_id",
  "channel_credit_id": "channel_credit_id",
  "po_line_amount_cancelled": 1.1,
  "cc_email": "cc_email",
  "po_date": "2023-01-15",
  "po_line_amount_usd": 1.1,
  "po_balance_usd": 1.1,
  "prepaid_account": "prepaid_account",
  "prepaid_account_id": "prepaid_account_id",
  "custom_text_1": "custom_text_1",
  "custom_text_2": "custom_text_2",
  "custom_text_3": "custom_text_3",
  "custom_text_4": "custom_text_4",
  "custom_text_5": "custom_text_5",
  "custom_date_1": "2023-01-15",
  "custom_date_2": "2023-01-15",
  "custom_date_3": "2023-01-15",
  "custom_date_4": "2023-01-15",
  "custom_date_5": "2023-01-15",
  "custom_numeric_1": 1.1,
  "custom_numeric_2": 1.1,
  "custom_numeric_3": 1.1,
  "custom_numeric_4": 1.1,
  "custom_numeric_5": 1.1,
  "type": "type",
  "pr_id": "pr_id",
  "pr_number": "pr_number",
  "pr_line_id": "pr_line_id"
}
```

**SDK Code**

```python
import requests

url = "https://api.gappify.com/v1/purchase-orders/source-system-id"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.gappify.com/v1/purchase-orders/source-system-id';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.gappify.com/v1/purchase-orders/source-system-id"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.gappify.com/v1/purchase-orders/source-system-id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.gappify.com/v1/purchase-orders/source-system-id")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.gappify.com/v1/purchase-orders/source-system-id', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.gappify.com/v1/purchase-orders/source-system-id");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.gappify.com/v1/purchase-orders/source-system-id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```