Document API

The Document API allows you to create, retrieve, and delete document files. Documents (for example, scanned receipts or shipment delivery slips) are used to help resolve disputes. Supported file types include PNG, JPG, and PDF.

Attributes

Name Type Description
object string

The string document.

id object_id

The document identifier matching /docu(_test)?_[0-9a-z]+/.

livemode boolean

Whether this is a live (true) or test (false) document.

location string

API path to retrieve the current document object.

created_at datetime

UTC datetime of document creation in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).

deleted boolean

Whether document is deleted.

download_uri string

URI of document for download.

filename string

Original filename of uploaded document.

Example

  • JSON Response

List documents

- GET https://api.omise.co/disputes/{id}/documents

Returns a list of documents belonging to the dispute.

Request Parameters

Name Type Description
from datetime

(optional, default: 1970-01-01T00:00:00Z) Earliest UTC datetime for returned records in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).

limit integer

(optional, default: 20, maximum: 100) Number of records returned.

offset integer

(optional, default: 0) Offset of the first record returned (i.e. how many records to skip from the beginning).

order string

(optional, default: chronological) Order of records returned. One of chronological (earliest to latest) or reverse_chronological (latest to earliest).

to datetime

(optional, default: current UTC datetime) Latest UTC datetime for returned records in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).

Example

  • List all dispute documents

Upload a document

- POST https://api.omise.co/disputes/{id}/documents

This endpoint allows you to send an HTTP multipart upload to add a dispute evidence document. Note that documents may only be added to an open dispute and document file size may not exceed 10MB. Returns the newly created document.

Request Parameters

Name Type Description
file string

(required) File for upload as document. Valid formats include PNG, JPG, and PDF.

Example

  • Create a document

Retrieve a document

- GET https://api.omise.co/disputes/{id}/documents/{document_id}

Returns the document matching :document_id.

Example

  • Retrieve a document

Destroy a document

- DELETE https://api.omise.co/disputes/{id}/documents/{document_id}

Destroys the document matching :document_id belonging to dispute matching :id. Dispute status must be open.

Example

  • Destroy a document