Knowledge Center

Knowledge Center > API > REST API > REST API Reference > Attachments > Add Attachment

Add Attachment

Use the Add Attachment REST request with a multipart/form-data to attach a document file to an Account, a Subscription, or an Invoice.

Request

  • ProductionPOST https://api.zuora.com/rest/v1/attachments
  • API SandboxPOST https://apisandbox-api.zuora.com/rest/v1/attachments

Request Parameter

The following parameters must be specified in the request URL.

description

optional

Description of the attachment document.
associatedObjectType required

Specify one of the following values:

  • Account
  • Subscription
  • Invoice
associtedObjectKey required

For the Subscription type, specify the Subscription Number. An attachment is tied tied to the Subscription Number and thus viewable with every subscription version.

For Account and Invoice, specify the id.

 

Request Body 

file

required

The file to be attached. Must be multipart/form-data.

The maximum file size is 4 MB.

Files with the following extensions are not supported: .exe, .sh, .dmg, .pkg, .cmd, .bat

Response

success

Returns true if the request is successful. Otherwise, returns false.

id Attachment id
fileId Id to identify the attached file

Example

Request

curl
--form "file=@PODocument.pdf"
-X POST https://api.zuora.com/rest/v1/attachments/?description=123&associatedObjectType=Subscription&associatedObjectKey=A-S00005714

Response

{
  "success": true
  "id": "402880ea536ff494015372a7ea17001f"
  "fileId": "402880ea536ff494015372a7ea12001e"
}

 

Last modified
20:45, 11 May 2016

Tags

This page has no custom tags.

Classifications

(not set)