Retrieve a list of Attachments

Retrieve a list of attachments. You may sort by the id, name, relatedId, relatedType, fileId, createdTime, and updatedTime.

SecuritySecretApiKey or JWT
Request
query Parameters
limit
integer [ 0 .. 1000 ]

The collection items limit.

offset
integer >= 0

The collection items offset.

filter
string

The collection items filter requires a special format. Use "," for multiple allowed values. Use ";" for multiple fields. See the filter guide for more options and examples about this format.

q
string

The partial search of the text fields.

expand
string

Expand a response to get a full related object included inside of the _embedded path in the response. It accepts a comma-separated list of objects to expand. See the expand guide for more info.

fields
string

Limit the returned fields to the list specified, separated by comma. Note that id is always returned.

sort
Array of strings

The collection items sort field and order (prefix with "-" for descending sort).

Responses
200

A list of Attachments was retrieved successfully.

Response Headers
Pagination-Total
integer

Total items count.

Example: 332
Pagination-Limit
integer

Items per page limit.

Example: 100
Pagination-Offset
integer

Pagination offset.

Example: 2
Response Schema: application/json
Array
fileId
required
string

Linked File object id.

relatedId
required
string

Linked object Id.

relatedType
required
string

Linked object type.

Enum: "customer" "customer-timeline-comment" "customer-edd-timeline-comment" "dispute" "gateway-timeline-comment" "invoice" "invoice-timeline-comment" "order-timeline-comment" "organization" "payment" … 5 more
id
string <= 50 characters

The resource ID. Defaults to UUID v4.

name
string

The Original Attachment name.

description
string

The Attachment description.

createdTime
string <date-time>

Creation date/time.

updatedTime
string <date-time> (UpdatedTime)

Read-only timestamp updates when the resource is updated.

Array of Self (object) or FileLink (object) or AttachmentResourceLink (object) >= 3 items

The links related to resource.

Array (>= 3 items)
Any of:
href
required
string

The link URL.

rel
required
string

The link type.

Value: "self"
Array of FileEmbed (object) non-empty

Any embedded objects available that are requested by the expand querystring parameter.

Array (non-empty)
Any of:

File object.

object (File)
401

Unauthorized access, invalid credentials were used.

403

Access forbidden.

get/attachments
Request samples
$attachments = $client->attachments()->search([
    'filter' => 'relatedType:customer',
]);
Response samples
application/json
[
  • {
    }
]