> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paytsoftware.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Responses

> How create and update endpoints (POST/PATCH) report success, partial failures, and fatal errors.

Endpoints that create or update data (POST/PATCH) accept multiple records per request. The response tells you how many records were processed and which ones failed.

## Fatal errors

If Payt cannot process the request at all (for example, the request body is malformed or required parameters are missing), it returns a `422 Unprocessable Entity` error and no records are processed.

Authentication and permission problems return `401` or `403` with an error body:

```json theme={null}
{
  "code": "forbidden",
  "message": "Missing permission: invoices:write"
}
```

## Success with partial errors

If Payt can process the request but encounters errors on individual records (e.g., it cannot find an invoice in the update invoices endpoint), it skips those records and processes the rest. The response still returns `success: true`, so **always check the `errors` object**: an empty object means all records were processed.

**Response:**

```json theme={null}
{
  "count": 10,
  "errors": {
    "not_found": [
      "invoice_number_that_could_not_be_found"
    ]
  },
  "success": true
}
```

| Key        | Value                                                                                                    |
| ---------- | -------------------------------------------------------------------------------------------------------- |
| `success`  | Whether the request was handled.                                                                         |
| `count`    | Number of records processed successfully (those without errors).                                         |
| `errors`   | Records that could not be processed, with the reasons. Keys identify the record or the type of failure.  |
| `warnings` | Records that were processed only partially, with warning messages. Only present when there are warnings. |
