Cmdlets for Square

Build 25.0.9434

CreateInvoiceAttachment

Uploads a file and attaches it to an invoice.

Stored Procedure Specific Information

Execute

To execute this stored procedure, you need to provide the InvoiceId for which the attachment will be created and the file path of the attachment.

EXECUTE CreateInvoiceAttachment InvoiceId = 'inv:0-ChAALv-Dv-66y_I0TT0hCN2UEL0M', File = 'D:\\Pictures\\Screenshots\\Screenshot123.png', Description = 'Test Description'

In place of 'File', you can also provide 'FileData' and 'FileName'. The 'FileData' parameter must be populated with the Base64 representation of the file. The 'FileName' parameter must include the file's name, containing its extension.

EXECUTE CreateInvoiceAttachment InvoiceId = 'inv:0-ChBcwd8ZKFkladTOqRCGP3mtEL0M', Description = 'Test', FileName = 'Test.png', FileData = 'iVBORw0KGgoAAAANSUhEUgAAAw8AAAFoCAMAAAAmbDcvAAAABGdBTUEAALGPC==';

You can also provide an instance of an input stream where the file data will be read from. You must also provide a value to the 'FileName' parameter.

Input

Name Type Required Description
InvoiceId String True The ID of the invoice to attach the file to.
File String False A file of following content types is allowed: image/gif, image/jpeg, application/pdf, image/png, image/tiff, image/bmp.
Description String False The description of the attachment to display on the invoice.
FileData String False Base64 string representation of the file content. Only used if File and InputStream are not set.
FileName String False The file name along with its extension. Set this when uploading the file using either InputStream or FileData. A file of following content types is allowed: image/gif, image/jpeg, application/pdf, image/png, image/tiff, image/bmp.

Result Set Columns

Name Type Description
Success Boolean Whether or not the file was attached to the invoice.
* String The fields of the newly created invoice attachment object.

Copyright (c) 2025 CData Software, Inc. - All rights reserved.
Build 25.0.9434