Skip to content

Upload a document

Request

Upload a document for a specific entity type (e.g., a PNR).

Security
Bearer
Bodymultipart/form-data
documentMetadataobject(DocumentMetadata)

Metadata related to document.

filestring, (binary)required

Contents of the document to be uploaded (PDF only). Accepts application/pdf or application/octet-stream.

documentMetadataStrstring

JSON string of DocumentMetadata - accepts application/octet-stream. Either documentMetadata or documentMetadataStr must be present.

curl --location 'https://api-ext-sboxmeta.partners.spotnana.com/v2/documents' \
  --header 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  --header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36' \
  --form 'file=@"/Path/to/file/document.pdf"' \
  --form 'documentMetadata="{
    \"documentType\": \"INVOICE\",
    \"entityType\": \"PNR\",
    \"entityId\": \"1234567890\",
    \"entityMetadata\": {
      \"travelType\": \"AIR\",
      \"invoiceMetadata\": {
        \"invoiceNumber\": \"ABCD-1234\"
      }
    },
    \"name\": \"Trip-Invoice-Test\"
  }";type=application/json'

Responses

OK

Bodyapplication/json
documentIdstring, (uuid)required

Unique identifier of the document.

Example:"f49d00fe-1eda-4304-ba79-a980f565281d"
documentMetadataobject(DocumentMetadata)required

Metadata related to document.

Response
{ "documentId": "f49d00fe-1eda-4304-ba79-a980f565281d", "documentMetadata": { "documentType": "VISA", "entityType": "PNR", "entityId": "123124", "entityMetadata": { … }, "name": "BoardingPass.pdf" } }