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

# Upload Request Picture

POST https://api.papertracc.com/v1/store/requests/files
Content-Type: application/json

Uploads a picture for a request and returns its `id`. Send the `id` in `photos`, or in a `PHOTO` answer's `files`, on Create Request within 24 hours; pictures not used by then are removed. Each picture can be used once. The body can be up to 15 MB on this endpoint.

**Keys:** public key or secret key.

Reference: https://api-docs.papertracc.com/storefront/requests/upload-request-picture

## Authentication

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

## Servers

- `https://api.papertracc.com/v1` (Production, default)
- `https://api.papertracc.com/rc-1` (Release Candidate 1)

## Request

### Headers

- `client-ip` (string, optional) — The shopper's IP address. Read only when the request is signed with a secret key, so a server calling on behalf of many shoppers does not share one rate limit. Ignored for public keys.

### Body (application/json)

This endpoint expects a RequestFileUpload.

- `file` (string, required) — The picture as a data URI, such as `data:image/jpeg;base64,...`. PNG, JPG, GIF, WEBP or AVIF, at most 10 MB before encoding.

## Response

### 201

Successfully uploaded picture

- `status` (boolean, required) — Always `true` on success.
- `message` (string, required) — Human-readable outcome.
- `data` (RequestFile, required)

## Errors

### 400 Bad Request Error

The `channel` header is missing, the body is not valid JSON, or a field failed validation.

- `status` (boolean, required) — Always `false` on a failed request.
- `message` (string, required) — What went wrong, written for the shopper or the developer.
- `error_code` (string, optional) — Present on `402` responses.

### 401 Unauthorized Error

The API key is missing or invalid, the key owner is no longer an active member of the organisation, or the key owner is not a member of the workspace in the `identity` header.

- `status` (boolean, required) — Always `false` on a failed request.
- `message` (string, required) — What went wrong, written for the shopper or the developer.
- `error_code` (string, optional) — Present on `402` responses.

### 402 Payment Required Error

The workspace's subscription plan does not include the Open API.

- `status` (boolean, required) — Always `false` on a failed request.
- `message` (string, required) — What went wrong, written for the shopper or the developer.
- `error_code` (string, optional) — Present on `402` responses.

### 404 Not Found Error

The sales channel, or the record the request names, does not exist or is not published to this channel.

- `status` (boolean, required) — Always `false` on a failed request.
- `message` (string, required) — What went wrong, written for the shopper or the developer.
- `error_code` (string, optional) — Present on `402` responses.

### 422 Unprocessable Entity Error

The request was understood but a rule stopped it. The message says which.

- `status` (boolean, required) — Always `false` on a failed request.
- `message` (string, required) — What went wrong, written for the shopper or the developer.
- `error_code` (string, optional) — Present on `402` responses.

### 429 Too Many Requests Error

Too many attempts from this shopper or on this store. Wait for the time in the message before trying again.

- `status` (boolean, required) — Always `false` on a failed request.
- `message` (string, required) — What went wrong, written for the shopper or the developer.
- `error_code` (string, optional) — Present on `402` responses.

## Types

### RequestFile

- `id` (string, required) — Send it in `photos` or in a `PHOTO` answer's `files`.
- `content_type` (string, required)
- `size` (integer, required) — Size in bytes.

## Examples

**Request**

```json
{
  "file": "data:image/png;base64,iVBORw0KGgo..."
}
```

**Response**

```json
{
  "status": true,
  "message": "Successfully uploaded picture",
  "data": {
    "id": "string",
    "content_type": "image/jpeg",
    "size": 284113
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.papertracc.com/v1/store/requests/files"

payload = { "file": "data:image/png;base64,iVBORw0KGgo..." }
headers = {
    "channel": "channel",
    "Authorization": "Bearer <apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.papertracc.com/v1/store/requests/files';
const options = {
  method: 'POST',
  headers: {
    channel: 'channel',
    Authorization: 'Bearer <apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"file":"data:image/png;base64,iVBORw0KGgo..."}'
};

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://api.papertracc.com/v1/store/requests/files"

	payload := strings.NewReader("{\n  \"file\": \"data:image/png;base64,iVBORw0KGgo...\"\n}")

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

	req.Header.Add("channel", "channel")
	req.Header.Add("Authorization", "Bearer <apiKey>")
	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://api.papertracc.com/v1/store/requests/files")

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

request = Net::HTTP::Post.new(url)
request["channel"] = 'channel'
request["Authorization"] = 'Bearer <apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"file\": \"data:image/png;base64,iVBORw0KGgo...\"\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://api.papertracc.com/v1/store/requests/files")
  .header("channel", "channel")
  .header("Authorization", "Bearer <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"file\": \"data:image/png;base64,iVBORw0KGgo...\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.papertracc.com/v1/store/requests/files', [
  'body' => '{
  "file": "data:image/png;base64,iVBORw0KGgo..."
}',
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
    'channel' => 'channel',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.papertracc.com/v1/store/requests/files");
var request = new RestRequest(Method.POST);
request.AddHeader("channel", "channel");
request.AddHeader("Authorization", "Bearer <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"file\": \"data:image/png;base64,iVBORw0KGgo...\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "channel": "channel",
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["file": "data:image/png;base64,iVBORw0KGgo..."] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.papertracc.com/v1/store/requests/files")! 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()
```