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

# Upload Invoice

> Uploads an invoice file for use with payout operations. The returned ID is used as the invoice identifier in subsequent payout requests.

## File Upload

The File Upload API allows you to upload documents such as invoices or receipts that may be required for certain types of payouts or compliance purposes.

### Use Case

When creating a payout, some corridors or transaction types might require supporting documentation (e.g., a business invoice). You can use this endpoint to upload the invoice first, and then reference the returned `id` as the optional `invoice` field in your payout request.

### Request Example

<CodeGroup>
  ```bash cURL theme={null}
  curl --location 'https://{{baseURL}}/v1/file/invoice' \
  --header 'x-api-key: API_KEY_HERE' \
  --form 'file=@"/path/to/your/invoice.jpeg"'
  ```
</CodeGroup>

<Note>
  The endpoint expects a `multipart/form-data` request with the file attached to the `file` field.
</Note>

### Response

A successful upload returns an `id` which is used as the optional `invoice` field in subsequent payout requests.

```json theme={null}
{
    "message": "File uploaded successfully",
    "status": "success",
    "data": {
        "id": "059c23af-eb87-4dc1-8518-8e335c98af30",
        "name": "Bar Deco.jpeg"
    }
}
```


## OpenAPI

````yaml post /v1/file/invoice
openapi: 3.0.3
info:
  title: meCash API
  version: 3.0.3
  description: >-
    API for meCash services, including FIAT and Ramp operations. This is the
    OpenAPI specification for the meCash API, covering all available endpoints
    for wallet management, currency quotes, and payouts.


    It follows a design-first approach based on OpenAPI 3.0.


    Authentication is handled via an API key passed in the `x-api-key` header.
    Replace `YOUR_API_KEY` with your actual key when making requests.


    Some useful links:

    - [meCash Documentation](https://docs.me-cash.com/)

    - [Authentication Guide](https://docs.me-cash.com/authentication)
servers:
  - url: https://sandboxapi.me-cash.com
    description: Sandbox Server for Testing
security:
  - ApiKeyAuth: []
tags:
  - name: Wallet
    description: Wallet management operations
  - name: Quote
    description: Currency quote operations
  - name: Payout
    description: Payout operations
  - name: Transaction
    description: Transaction management
  - name: Virtual Account
    description: Virtual account operations for static and dynamic accounts
  - name: Bank
    description: Bank account and list operations
  - name: Ramp
    description: Ramp operations for crypto
  - name: Miscellaneous
    description: Utility and miscellaneous operations
  - name: Collection
    description: Mobile money and wallet funding operations
  - name: Bulk Payout
    description: >-
      Bulk transfer operations for sending to multiple beneficiaries in a single
      request
paths:
  /v1/file/invoice:
    post:
      tags:
        - Transaction
      summary: Upload Invoice
      description: >-
        Uploads an invoice file for use with payout operations. The returned ID
        is used as the invoice identifier in subsequent payout requests.
      operationId: uploadInvoice
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: The invoice file to be uploaded.
              required:
                - file
      responses:
        '200':
          description: File uploaded successfully.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Success'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          id:
                            type: string
                            format: uuid
                            description: Unique identifier for the uploaded invoice.
                            example: 059c23af-eb87-4dc1-8518-8e335c98af30
                          name:
                            type: string
                            description: The name of the uploaded file.
                            example: Bar Deco.jpeg
        '401':
          $ref: '#/components/responses/PayoutUnauthorized'
        '403':
          $ref: '#/components/responses/PayoutForbidden'
        '500':
          $ref: '#/components/responses/PayoutInternalServerError'
components:
  schemas:
    Success:
      type: object
      properties:
        status:
          type: string
          example: success
        message:
          type: string
          example: Operation completed successfully.
        data:
          type: object
          description: The payload of the successful response.
      required:
        - status
        - message
    PayoutFailedResponse:
      type: object
      properties:
        message:
          type: string
          description: A human-readable error message.
        status:
          type: string
          example: failed
      required:
        - message
        - status
  responses:
    PayoutUnauthorized:
      description: Unauthorized. The provided API key is invalid or missing.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PayoutFailedResponse'
          example:
            message: Invalid API key
            status: failed
    PayoutForbidden:
      description: >-
        Forbidden. The request is not allowed because the source IP is not
        whitelisted.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PayoutFailedResponse'
          example:
            message: 'Access denied: IP address not whitelisted'
            status: failed
    PayoutInternalServerError:
      description: Internal Server Error. The server failed to process the request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PayoutFailedResponse'
          example:
            message: Server failed to process request.
            status: failed
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````