SimPayDocs

    Upload MED Response File

    Upload a response file (evidence document) for a specific MED dispute. Supports PDF, DOC, DOCX, JPG, PNG and other document formats. The file is stored securely and associated with the MED for analysis purposes.

    POSThttps://api.somossimpay.com.br/v3/meds/{med_id}/file/upload
    curl --request POST \
      --url 'https://api.somossimpay.com.br/v3/meds/{med_id}/file/upload' \
      --header 'Authorization: Bearer <ACCESS_TOKEN>'
    Response200
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "pix_med_id": "550e8400-e29b-41d4-a716-446655440000",
      "file_response": "media/pixmed/response-files/a1b2c3d4-e5f6-7890-abcd-ef1234567890.pdf",
      "created_by_id": 246,
      "is_psp": false,
      "created_at": "2026-06-02T14:30:00Z"
    }

    Endpoint

    POST /v3/meds/{med_id}/file/upload

    Headers

    ParameterTypeDescriptionExample
    AuthorizationStringBearer + Access_tokenBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzEzMzAwOTMxLCJpYXQiOjE3MTMyOTczMzEsImp0aSI6Ijc2ZWI4ZTE5ZjM4YjQ4NmZiODdmNzNjNTdkMWVmNDJhIiwidXNlcl9pZCI6MjQ2fQ.5zekMa7CUj9p-MvNHns5ke4ZPhYV3Y1CLOsYL7hDUUo

    Path Parameters

    ParameterTypeDescriptionExample
    med_idStringThe unique identifier of the MED infraction report550e8400-e29b-41d4-a716-446655440000

    Body Details

    This endpoint uses multipart/form-data to upload files.

    FieldTypeDescriptionRequired or Optional
    fileFileResponse file for the MED (PDF, DOC, DOCX, JPG, PNG). Maximum size: 10MBrequired

    Request Examples

    Upload PDF evidence:

    POST /v3/meds/550e8400-e29b-41d4-a716-446655440000/file/upload
    Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
    Content-Type: multipart/form-data
    
    file: evidence-document.pdf

    Upload image evidence:

    POST /v3/meds/550e8400-e29b-41d4-a716-446655440000/file/upload
    Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
    Content-Type: multipart/form-data
    
    file: screenshot-proof.png

    Response Details

    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "pix_med_id": "550e8400-e29b-41d4-a716-446655440000",
      "file_response": "media/pixmed/response-files/a1b2c3d4-e5f6-7890-abcd-ef1234567890.pdf",
      "created_by_id": 246,
      "is_psp": false,
      "created_at": "2026-06-02T14:30:00Z"
    }
    FieldTypeDescription
    idStringUnique identifier for the uploaded file
    pix_med_idStringMED ID this file is associated with
    file_responseStringS3 storage path of the uploaded file
    created_by_idIntegerUser ID who uploaded the file
    is_pspBooleanWhether file was uploaded by PSP (always false for API uploads)
    created_atDateTimeTimestamp when file was uploaded (ISO 8601 format)

    Error Responses

    HTTP CodeError MessageDescription
    400Invalid file formatFile format not supported. Use PDF, DOC, DOCX, JPG, PNG or TXT
    400File size exceeds maximumFile is larger than 10MB limit
    400PIXMED is not in a valid state for response fileThe MED status is not WAITING. Files can only be uploaded for MEDs awaiting response
    401UnauthorizedInvalid or missing authentication token. Ensure you are sending a valid Bearer token
    404Med not foundThe specified MED ID does not exist or you don't have access to it
    422Validation errorRequest validation failed. Check that file field is present

    Business Rules

    File Upload Requirements:

    • Files can only be uploaded for MEDs with status WAITING
    • You must have access to the account associated with the MED
    • Maximum file size: 10 MB
    • Supported formats: PDF, DOC, DOCX, TXT, JPG, JPEG, PNG
    • File extension is validated against content type for security

    MED Status Validation:

    • MED must be in WAITING status to accept file uploads
    • Once MED is processed (ACCEPTED/REJECTED), no more files can be uploaded
    • You can upload multiple files for the same MED while it's in WAITING status

    Access Control:

    • You must have Permissions.PixMed.ANALYZE scope
    • You must have access to the credited account (receiver) or debited account (payer)
    • MED must belong to your company

    File Storage:

    • Files are securely stored in S3
    • File path follows pattern: media/pixmed/response-files/{file_id}.{extension}
    • Files are permanently stored and associated with the MED record
    • Original filename is not preserved for security reasons

    Use Cases:

    • Evidence Submission: Upload proof documents supporting your position in the dispute
    • Communication Records: Upload screenshots of conversations or email exchanges
    • Transaction Proof: Upload receipts, invoices, or transaction confirmations
    • Identity Verification: Upload ID documents or account ownership proof