Create an attachment

Attaches a file to one or multiple objects, such as: customer, dispute, transaction, order, plan, product, invoice, or timeline comment. Attachments enable you to quickly find and use files related to specific entities.

SecuritySecretApiKey or JWT
Request
Request Body schema: application/json

Attachment resource.

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
name
string

Name of original attachment.

description
string

Description of the attachment.

Responses
201

Attachment created.

Response Headers
Location
string <uri>

Location of the related resource.

Example: "https://api.rebilly.com/example"
Response Schema: application/json
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.

409

Conflict.

422

Invalid data sent.

post/attachments
Request samples
application/json
{
  • "fileId": "string",
  • "relatedType": "customer",
  • "relatedId": "string",
  • "name": "string",
  • "description": "string"
}
Response samples
application/json
{
  • "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "fileId": "string",
  • "relatedType": "customer",
  • "relatedId": "string",
  • "name": "string",
  • "description": "string",
  • "createdTime": "2019-08-24T14:15:22Z",
  • "updatedTime": "2019-08-24T14:15:22Z",
  • "_links": [
    ],
  • "_embedded": {
    }
}