---
updatedAt: 2026-06-09T17:02:17.000Z
agentTools:
  projectIndex: https://hq.docs.netevia.com/llms.txt
---

# /api/v1/merchant/generateMPAPDF

## Get Merchant Processing Agreement (MPA) PDF

Generates a Merchant Processing Agreement in PDF format using the merchant's stored information. The document is returned as a Base64-encoded PDF string within the API response envelope. This endpoint is used in the MPA signing workflow before requesting a merchant signature.

### Endpoint

`GET /api/v1/merchant/generateMPAPDF`

### Authentication

Basic HTTP Authentication required.
Encode `username:password` in Base64 and pass in the Authorization header:

```
Authorization: Basic {base64(username:password)}
```

### When to use

Use this endpoint after the merchant application data has been fully populated to generate the legally binding MPA document. The returned PDF should be reviewed by the merchant before initiating the signature request via `requestSignature`. This is a required step in the MPA signing workflow.

### Query Parameters

| Parameter | Type            | Required | Description                                        |
| --------- | --------------- | -------- | -------------------------------------------------- |
| id        | integer (int32) | Yes      | The unique internal ID of the merchant application |

### Response

**200 OK**

| Field             | Type            | Description                                                           |
| ----------------- | --------------- | --------------------------------------------------------------------- |
| data              | object          | Wrapper for the MPA response payload                                  |
| data.base64Pdf    | string          | Base64-encoded PDF content of the Merchant Processing Agreement       |
| status            | string          | HTTP status string (e.g., `"OK"`)                                     |
| error             | string          | Error message if the request failed                                   |
| warning           | string          | Non-fatal warning message                                             |
| validationResults | array           | List of validation errors, each with `memberNames` and `errorMessage` |
| requestId         | integer (int32) | Internal request tracking ID                                          |

```json
{
  "data": {
    "base64Pdf": "JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PC9UeXBlL0NhdGFsb2c..."
  },
  "status": "OK",
  "error": null,
  "warning": null,
  "validationResults": [],
  "requestId": 48291
}
```

### Error Codes

| Code | When it happens                                            |
| ---- | ---------------------------------------------------------- |
| 400  | The `id` query parameter is missing or not a valid integer |
| 401  | Invalid or missing Basic Auth credentials                  |
| 403  | User does not have permission for this operation           |
| 404  | No merchant application found for the given `id`           |
| 500  | Internal server error while generating the PDF             |

### Common Mistakes

* Passing a string value for `id` instead of an integer — the parameter must be a numeric merchant application ID.
* Attempting to call this endpoint before the merchant application data is complete; the resulting PDF may be missing required fields.
* Confusing this endpoint with `getSignedMPA` — this endpoint generates the *unsigned* MPA for review, while `getSignedMPA` retrieves the *signed* copy.
* The response body is JSON (not a raw binary stream); decode `data.base64Pdf` client-side to obtain the PDF bytes.

### Related Endpoints

* `POST /api/v1/merchant/requestSignature` — send the generated MPA to the merchant for electronic signing
* `GET /api/v1/merchant/getSignatureStatus` — poll the signing status after a signature request is initiated
* `GET /api/v1/merchant/getSignedMPA` — retrieve the completed, signed copy of the MPA

### Example

```bash
curl -X GET "https://hq.staging.netevia.dev/api/v1/merchant/generateMPAPDF?id=10045" \
  -H "Authorization: Basic $(echo -n 'username:password' | base64)" \
  -H "Accept: application/json"
```

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "version": "v1",
    "title": "Netevia HQ | API Documentation",
    "description": "Netevia HQ | API Documentation"
  },
  "paths": {
    "/api/v1/merchant/generateMPAPDF": {
      "get": {
        "tags": [
          "Merchant Processing Agreement and Online Signature"
        ],
        "operationId": "Boarding_GetMerchantProcessingApplication",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse1_MPAResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse1_MPAResponse"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse1_MPAResponse"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse1_MPAResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "Basic": []
    }
  ],
  "servers": [
    {
      "url": "https://hq.staging.netevia.dev"
    }
  ],
  "components": {
    "securitySchemes": {
      "Basic": {
        "type": "http",
        "description": "Basic HTTP Authentication",
        "scheme": "basic"
      }
    },
    "schemas": {
      "ValidationResult": {
        "type": "object",
        "properties": {
          "memberNames": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "readOnly": true
          },
          "errorMessage": {
            "type": "string"
          }
        }
      },
      "ApiResponse1_MPAResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/MPAResponse"
          },
          "status": {
            "enum": [
              "Continue",
              "SwitchingProtocols",
              "OK",
              "Created",
              "Accepted",
              "NonAuthoritativeInformation",
              "NoContent",
              "ResetContent",
              "PartialContent",
              "MultipleChoices",
              "Ambiguous",
              "MovedPermanently",
              "Moved",
              "Found",
              "Redirect",
              "SeeOther",
              "RedirectMethod",
              "NotModified",
              "UseProxy",
              "Unused",
              "TemporaryRedirect",
              "RedirectKeepVerb",
              "BadRequest",
              "Unauthorized",
              "PaymentRequired",
              "Forbidden",
              "NotFound",
              "MethodNotAllowed",
              "NotAcceptable",
              "ProxyAuthenticationRequired",
              "RequestTimeout",
              "Conflict",
              "Gone",
              "LengthRequired",
              "PreconditionFailed",
              "RequestEntityTooLarge",
              "RequestUriTooLong",
              "UnsupportedMediaType",
              "RequestedRangeNotSatisfiable",
              "ExpectationFailed",
              "UpgradeRequired",
              "InternalServerError",
              "NotImplemented",
              "BadGateway",
              "ServiceUnavailable",
              "GatewayTimeout",
              "HttpVersionNotSupported"
            ],
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "warning": {
            "type": "string"
          },
          "validationResults": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ValidationResult"
            }
          },
          "requestId": {
            "format": "int32",
            "type": "integer"
          }
        }
      },
      "MPAResponse": {
        "type": "object",
        "properties": {
          "base64Pdf": {
            "type": "string"
          }
        }
      }
    }
  }
}
```