| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Generate Merchant Processing Application (MPA PDF)
Generates a Merchant Processing Agreement (MPA) PDF document pre-populated with the merchant's current profile data and saves it to the merchant's underwriting ticket. The generated PDF is also returned in the response as a Base64-encoded string, allowing you to display or download it directly without an additional fetch call.
Endpoint
POST /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
Call this endpoint after the merchant application data has been fully populated and is ready for the merchant's signature. The generated PDF is the document the merchant will review and sign. It must be generated before initiating the online signature request (POST /api/v1/merchant/requestSignature). If the merchant's data changes after the PDF is generated, regenerate it by calling this endpoint again before requesting a new signature.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| id | integer (int32) | Yes | The merchant profile ID for which to generate the MPA PDF |
{
"id": 48291
}Response
200 OK
| Field | Type | Description |
|---|---|---|
| data.base64Pdf | string | The generated MPA PDF encoded as a Base64 string — decode to get the raw PDF bytes |
| requestId | integer | Unique identifier for this API request |
| success | boolean | true if the PDF was generated and saved successfully |
| error | string | Error message if generation failed |
| validationErrors | array | List of field-level validation errors with field and error properties |
{
"data": {
"base64Pdf": "JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZwovUGFnZXMgMiAwIFIKPj4KZW5kb2JqCjIgMCBvYmoKPDwKL1R5cGUgL1BhZ2VzCi9LaWRzIFszIDAgUl0KL0NvdW50IDEKPD4KZW5kb2JqCg=="
},
"requestId": 91047,
"success": true,
"error": null,
"validationErrors": []
}Error Codes
| Code | When it happens |
|---|---|
| 400 | id is missing or invalid |
| 401 | Invalid or missing Basic Auth credentials |
| 403 | User does not have permission for this operation |
| 404 | Merchant with the specified id not found |
| 500 | Internal server error or PDF generation failure |
Common Mistakes
- Calling this endpoint before the merchant's application data is complete — the generated PDF will reflect whatever data is currently on the record; incomplete fields will appear blank in the MPA.
- Not regenerating the PDF after data changes — if the merchant's information is updated after the PDF is generated, a new PDF must be generated to reflect those changes before requesting a signature.
- Attempting to decode the
base64Pdfwithout proper Base64 decoding — use a standard Base64 decoder to convert the string to a PDF binary. - Skipping this step and calling the signature request endpoint directly — the signature request depends on an existing generated MPA attached to the merchant's ticket.
Related Endpoints
POST /api/v1/merchant/requestSignature— initiate the online signature request after generating the MPAPOST /api/v1/merchant/signatureCertificate— upload the completed signed certificateGET /api/v1/merchant/getSignedMPA— retrieve the signed version of the MPA after signing is complete
Example
curl -X POST https://hq.staging.netevia.dev/api/v1/merchant/generateMPAPDF \
-H "Authorization: Basic $(echo -n 'username:password' | base64)" \
-H "Content-Type: application/json" \
-d '{
"id": 48291
}'