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

# Upload an inbound PO document

POST https://dream.rushorder.com/api/inbound/documents
Content-Type: application/json

Attaches a file, such as a packing list, to the PO. Allowed types are `.csv`, `.txt`, `.pdf`, `.xls`, and `.xlsx`, up to 25 MB. To change a file that is already attached, use [`PUT /inbound/documents`](https://docs.rushorder.com/api-reference/inbound/replace-document).

Reference: https://docs.rushorder.com/api-reference/inbound/upload-document

## Authentication

- `Authorization` header (basic auth, required) — Basic authentication of the form `Basic <base64(username:password)>`.

## Request

### Headers

- `RushOrderMomCode` (string, required) — All requests require the header to contain RushOrderMomCode, a 3 character string that represents the client internally in Rush Order. This should be given to you by Rush Order.

### Body (application/json)

This endpoint expects an object.

- `poRef` (string, required) — The PO reference number.
- `fileName` (string, required) — Must end in `.csv`, `.txt`, `.pdf`, `.xls`, or `.xlsx`.
- `content` (string, required) — The file, base64-encoded. A `data:<type>;base64,` prefix is accepted. Up to 25 MB, and the content must match the file extension.
- `lading` (string, optional) — If the PO was submitted with a bill of lading, include it here, or the PO will not be found.

## Response

### 200

Uploaded.

- `Success` (boolean, optional)
- `Error` (string, optional, nullable) — Why the request failed. Null on success.
- `Message` (string, optional, nullable) — Same as `Error`.
- `Document` (InboundPoDocument, optional)

## Errors

### 400 Bad Request Error

The file name, type, size, or content is invalid.

- `Success` (boolean, optional)
- `Error` (string, optional, nullable) — Why the request failed. Null on success.
- `Message` (string, optional, nullable) — Same as `Error`.
- `Document` (InboundPoDocument, optional)

### 404 Not Found Error

No active inbound PO matches.

- `Success` (boolean, optional)
- `Error` (string, optional, nullable) — Why the request failed. Null on success.
- `Message` (string, optional, nullable) — Same as `Error`.
- `Document` (InboundPoDocument, optional)

### 409 Conflict Error

A document with this file name is already attached.

- `Success` (boolean, optional)
- `Error` (string, optional, nullable) — Why the request failed. Null on success.
- `Message` (string, optional, nullable) — Same as `Error`.
- `Document` (InboundPoDocument, optional)

## Types

### InboundPoDocument

- `DocumentId` (integer, optional)
- `PoRef` (string, optional)
- `Lading` (string, optional, nullable)
- `FileName` (string, optional)
- `FileSize` (long, optional) — Size in bytes.
- `CreatedBy` (string, optional)
- `CreatedAt` (datetime, optional)
- `UpdatedBy` (string, optional, nullable)
- `UpdatedAt` (datetime, optional, nullable)

## Examples

**Request**

```json
{
  "poRef": "MYPO7656",
  "fileName": "packing-list.pdf",
  "content": "string"
}
```

**Response**

```json
{
  "Success": true,
  "Error": "string",
  "Message": "string",
  "Document": {
    "DocumentId": 311,
    "PoRef": "MYPO7656",
    "Lading": "string",
    "FileName": "packing-list.pdf",
    "FileSize": 1,
    "CreatedBy": "string",
    "CreatedAt": "2024-01-15T09:30:00Z",
    "UpdatedBy": "string",
    "UpdatedAt": "2024-01-15T09:30:00Z"
  }
}
```

**SDK Code**

```python
import requests

url = "https://dream.rushorder.com/api/inbound/documents"

payload = {
    "poRef": "MYPO7656",
    "fileName": "packing-list.pdf",
    "content": "string"
}
headers = {
    "RushOrderMomCode": "ABC"
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers, auth=("<username>", "<password>"))

print(response.json())
```

```javascript
const url = 'https://dream.rushorder.com/api/inbound/documents';
const credentials = btoa("<username>:<password>");

const options = {
  method: 'POST',
  headers: {
    RushOrderMomCode: 'ABC',
    Authorization: `Basic ${credentials}`,
    'Content-Type': 'application/json'
  },
  body: '{"poRef":"MYPO7656","fileName":"packing-list.pdf","content":"string"}'
};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://dream.rushorder.com/api/inbound/documents"

	payload := strings.NewReader("{\n  \"poRef\": \"MYPO7656\",\n  \"fileName\": \"packing-list.pdf\",\n  \"content\": \"string\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("RushOrderMomCode", "ABC")
	req.SetBasicAuth("<username>", "<password>")
	req.Header.Add("Content-Type", "application/json")

	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://dream.rushorder.com/api/inbound/documents")

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

request = Net::HTTP::Post.new(url)
request["RushOrderMomCode"] = 'ABC'
request.basic_auth("<username>", "<password>")
request["Content-Type"] = 'application/json'
request.body = "{\n  \"poRef\": \"MYPO7656\",\n  \"fileName\": \"packing-list.pdf\",\n  \"content\": \"string\"\n}"

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.post("https://dream.rushorder.com/api/inbound/documents")
  .header("RushOrderMomCode", "ABC")
  .basicAuth("<username>", "<password>")
  .header("Content-Type", "application/json")
  .body("{\n  \"poRef\": \"MYPO7656\",\n  \"fileName\": \"packing-list.pdf\",\n  \"content\": \"string\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://dream.rushorder.com/api/inbound/documents', [
  'body' => '{
  "poRef": "MYPO7656",
  "fileName": "packing-list.pdf",
  "content": "string"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'RushOrderMomCode' => 'ABC',
  ],
    'auth' => ['<username>', '<password>'],
]);

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

```csharp
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://dream.rushorder.com/api/inbound/documents");
client.Authenticator = new HttpBasicAuthenticator("<username>", "<password>");
var request = new RestRequest(Method.POST);
request.AddHeader("RushOrderMomCode", "ABC");

request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"poRef\": \"MYPO7656\",\n  \"fileName\": \"packing-list.pdf\",\n  \"content\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let credentials = Data("<username>:<password>".utf8).base64EncodedString()

let headers = [
  "RushOrderMomCode": "ABC",
  "Authorization": "Basic \(credentials)",
  "Content-Type": "application/json"
]
let parameters = [
  "poRef": "MYPO7656",
  "fileName": "packing-list.pdf",
  "content": "string"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://dream.rushorder.com/api/inbound/documents")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```