m2pfintech
API LibraryIssuance

Upload Beneficiaries Bulk Issuance

Uploads one or more files (CSV / Excel) containing beneficiary data for a previously created bulk issuance. This is the recommended approach for large batches (100+ records) instead of embedding all beneficiaries in the JSON body of the create call.

Typical Flow for Large Batches

1. POST /v1/corporate-issuances/         → issuanceType: Bulk, beneficiaries: []
   Response: applicationNumber + CREATED status

2. POST /file/upload/beneficiary/bulk-upload/{applicationNumber}
   → Upload CSV file with beneficiary rows
   Response: list of uploaded file references

3. POST /state-transition  → APPROVED

4. GET /fetch-by-status/SUCCESS  → poll for completion

CSV Format

The file should have one beneficiary per row with columns matching the CorporateBeneficiary schema fields (mobile, firstName, lastName, email, etc.). Contact M2P support for the exact template.

Server

Use the corporate server URLs for this endpoint.

POST
/v1/corporate-issuances/file/upload/beneficiary/bulk-upload/{applicationNumber}

Authorization

bearerAuth tenantId
AuthorizationBearer <token>

JWT Bearer token from the Authentication API

In: header

X-TENANT-ID<token>

Your unique tenant identifier assigned during onboarding

In: header

Path Parameters

applicationNumber*string

Application number created by the initial POST /v1/corporate-issuances/ call

Header Parameters

X-TENANT-ID*string

Your unique tenant identifier

Request Body

multipart/form-data

files?array<file>

One or more CSV/Excel files with beneficiary data

Response Body

application/json

application/json

application/json

curl -X POST "https://sandbox-api.m2pprepaid.com/prepaid/middleware/v1/corporate-issuances/file/upload/beneficiary/bulk-upload/BULK-APP-2026-001" \  -H "X-TENANT-ID: ACME_CORP"
{
  "result": [
    {
      "fileId": "file-001",
      "fileName": "beneficiaries-batch1.csv",
      "status": "UPLOADED",
      "recordCount": 150
    }
  ],
  "pagination": null
}
{
  "type": "https://www.m2pfintech.com/problem/problem-with-message",
  "title": "Bad Request",
  "status": 400,
  "detail": "Unable to convert http message",
  "message": "error.http.400"
}
{
  "type": "https://www.m2pfintech.com/problem/problem-with-message",
  "title": "string",
  "status": 0,
  "detail": "string",
  "message": "error.http.400",
  "businessCode": "string",
  "fieldErrors": [
    {
      "field": "string",
      "message": "string"
    }
  ],
  "cause": {},
  "errorCode": "string",
  "errors": [
    "string"
  ],
  "languageCode": "string",
  "localizedMessage": "string",
  "suppressed": [
    {}
  ]
}