Retrieve attachments

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

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

Limits the number of collection items to be returned.

offset
integer >= 0

Specifies the starting point within the collection of items to be returned.

filter
string

Filters the collection items. This field requires a special format. Use , for multiple allowed values. Use ; for multiple fields.

For more information, see Using filter with collections.

q
string

Use this field to perform a partial search of text fields.

expand
string

Expands a request to include embedded objects within the _embedded property of the response. This field accepts a comma-separated list of objects.

For more information, see Expand to include embedded objects.

fields
string

Limits the returned fields to the specified list, each field separated by a comma. The ID value is always returned.

sort
Array of strings

Sorts and orders the collection of items. To sort in descending order, prefix with -.

Responses
200

List of attachments retrieved.

Response Headers
Pagination-Total
integer

Total number of items.

Example: 332
Pagination-Limit
integer

Maximum number of items per page.

Example: 100
Pagination-Offset
integer

Specifies the starting point within the collection of resource results. For example, a request with limit=20 retrieves and displays the first 20 results on a page. A following request with limit=20 and offset=20, retrieves the next page of 20 results.

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

ID of the linked file object.

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

Unique resource ID. Defaults to UUID v4.

name
string

Name of original attachment.

description
string

Description of the attachment.

createdTime
string <date-time> (CreatedTime)

Date and time which is set automatically when the resource is created.

updatedTime
string <date-time> (UpdatedTime)

Date and time which updates automatically when the resource is updated.

Array of objects

Related links.

Array
href
string

Link URL.

rel
string

Type of link.

Enum: "self" "file"
object

Embedded objects that are requested by the expand query parameter.

file
object
401

Unauthorized access. Invalid credentials used.

403

Access forbidden.

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