public function addAttachment($filename, $contents)
    {
        $this->connection()->upload($this->endpoint . '/' . $this->id . '/attachments', [
            'multipart' => [
                [
                    'name' => 'file',
                    'contents' => $contents,
                    'filename' => $filename,
                ],
            ],
        ]);

        return $this;
    }
public function addAttachment($filename, $contents)
    {
        $this->connection()->upload($this->endpoint . '/' . $this->id . '/attachments', [
            'multipart' => [
                [
                    'name' => 'file',
                    'contents' => $contents,
                    'filename' => $filename,
                ],
            ],
        ]);

        return $this;
    }
public function addAttachment ( $ filename , $ contents ) { $ this -> connection ( ) -> upload ( $ this -> endpoint . '/' . $ this -> id . '/attachments' , [ 'multipart' => [ [ 'name' => 'file' , 'contents' => $ contents , 'filename' => $ filename , ] , ] , ] ) ; return $ this ; }
Add Attachment to this invoice.

You can use fopen('/path/to/file', 'r') in $resource.

@param string $filename The filename of the attachment
@param resource $contents A StreamInterface/resource/string, @see http://docs.guzzlephp.org/en/stable/request-options.html?highlight=multipart#multipart

@return \Picqer\Financials\Moneybird\Entities\SalesInvoice

@throws \Picqer\Financials\Moneybird\Exceptions\ApiException
Add Attachment to this invoice .