### Get User API Request Example Source: https://developer.spotnana.com/integration/api/api-test-admin-access.md This example demonstrates how to use the `get user` API to review the administrator profile. It shows how to make a GET request with an authorization header. ```APIDOC ## GET /v2/users/{userId} ### Description Retrieves the details of a specific user profile. ### Method GET ### Endpoint /v2/users/ ### Query Parameters - **includeInactive** (boolean) - Optional - Specifies whether to include inactive users in the results. ### Headers - **Authorization** (string) - Required - Bearer token for authentication. ### Response #### Success Response (200) - **Details** (object) - Contains the user profile information. ### Request Example ```bash curl -i -X GET \ "https://api-ext-sboxmeta.partners.spotnana.com/v2/users/?includeInactive=true" \ -H "Authorization: Bearer " ``` ### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### Create User Source: https://developer.spotnana.com/spotnana/user_creation_workflow.md Creates a new user profile on the Spotnana platform, requiring essential business and organizational information. ```APIDOC ## POST /v2/users/ ### Description Create a new user profile on the Spotnana platform. This endpoint requires the user's persona and references to their business information, including the legal entity and organization. ### Method POST ### Endpoint /v2/users/ ### Parameters #### Request Body - **persona** (string) - Required - The persona of the user. - **businessInfo** (object) - Required - Business information for the user. - **legalEntityRef** (object) - Required - Reference to the legal entity. - **id** (string) - Required - The ID of the legal entity from step 2. - **organizationRef** (object) - Required - Reference to the organization. - **id** (string) - Required - The ID of the company from step 1 (can be used as `orgId`). ### Response #### Success Response (200) - **userId** (string) - The unique identifier of the newly created user. ``` -------------------------------- ### Get Event Summaries Source: https://developer.spotnana.com/releases/changelog_before_april2025.md Retrieves summaries for various events. The response details updates to booking guidelines for rail, car, hotel, and air travel, as well as general start and end times. ```APIDOC ## POST /v2/events/summaries ### Description Retrieves summaries for various events. The response details updates to booking guidelines for rail, car, hotel, and air travel, as well as general start and end times. ### Method POST ### Endpoint /v2/events/summaries ### Response #### Success Response (200) - The response indicates updates to the following paths: - `tripEventSummaries.travelerEventSummary.bookingGuidelines.railBookingGuideLine.departureBookingWindow.endDateTime.description` - `tripEventSummaries.travelerEventSummary.bookingGuidelines.railBookingGuideLine.departureBookingWindow.startDateTime.description` - `tripEventSummaries.travelerEventSummary.bookingGuidelines.railBookingGuideLine.arrivalBookingWindow.endDateTime.description` - `tripEventSummaries.travelerEventSummary.bookingGuidelines.railBookingGuideLine.arrivalBookingWindow.startDateTime.description` - `tripEventSummaries.travelerEventSummary.bookingGuidelines.carBookingGuideLine.dropoffBookingWindow.endDateTime.description` - `tripEventSummaries.travelerEventSummary.bookingGuidelines.carBookingGuideLine.dropoffBookingWindow.startDateTime.description` - `tripEventSummaries.travelerEventSummary.bookingGuidelines.carBookingGuideLine.pickupBookingWindow.endDateTime.description` - `tripEventSummaries.travelerEventSummary.bookingGuidelines.carBookingGuideLine.pickupBookingWindow.startDateTime.description` - `tripEventSummaries.travelerEventSummary.bookingGuidelines.hotelBookingGuideLine.checkoutBookingWindow.endDateTime.description` - `tripEventSummaries.travelerEventSummary.bookingGuidelines.hotelBookingGuideLine.checkoutBookingWindow.startDateTime.description` - `tripEventSummaries.travelerEventSummary.bookingGuidelines.hotelBookingGuideLine.checkinBookingWindow.endDateTime.description` - `tripEventSummaries.travelerEventSummary.bookingGuidelines.hotelBookingGuideLine.checkinBookingWindow.startDateTime.description` - `tripEventSummaries.travelerEventSummary.bookingGuidelines.airBookingGuideLine.departureBookingWindow.endDateTime.description` - `tripEventSummaries.travelerEventSummary.bookingGuidelines.airBookingGuideLine.departureBookingWindow.startDateTime.description` - `tripEventSummaries.travelerEventSummary.bookingGuidelines.airBookingGuideLine.arrivalBookingWindow.endDateTime.description` - `tripEventSummaries.travelerEventSummary.bookingGuidelines.airBookingGuideLine.arrivalBookingWindow.startDateTime.description` - `tripEventSummaries.travelerEventSummary.endDateTime.description` - `tripEventSummaries.travelerEventSummary.startDateTime.description` ``` -------------------------------- ### Create User API Source: https://developer.spotnana.com/integration/api/api-add-users-to-company.md Use the 'create user' API to onboard users to your company. This endpoint is essential for adding new employees or partners to your organization within the Spotnana platform. ```APIDOC ## POST /openapi/usersapi/users/createuser ### Description Creates a new user within the company. This is the primary method for onboarding users to your organization. ### Method POST ### Endpoint /openapi/usersapi/users/createuser ### Parameters #### Request Body - **persona** (string) - Required - The role or persona of the user (e.g., EMPLOYEE). - **personalInfo** (object) - Optional - Contains personal details of the user. - **title** (string) - Optional - User's title (e.g., MS). - **gender** (string) - Optional - User's gender. - **name** (object) - Required - User's full name. - **given** (string) - Required - User's first name. - **middle** (string) - Optional - User's middle name. - **family1** (string) - Required - User's last name. - **dob** (object) - Optional - Date of birth. - **iso8601** (string) - Optional - Date of birth in ISO 8601 format (YYYY-MM-DD). - **email** (string) - Optional - User's personal email address. - **addresses** (array) - Optional - List of user's addresses. - **addressLines** (array) - Optional - Street address lines. - **locality** (string) - Optional - City or locality. - **administrativeArea** (string) - Optional - State or administrative area. - **postalCode** (string) - Optional - Postal or ZIP code. - **regionCode** (string) - Optional - Country region code. - **isDefault** (boolean) - Optional - Indicates if this is the default address. - **emergencyContact** (object) - Optional - Emergency contact details. - **name** (string) - Optional - Emergency contact's name. - **relation** (string) - Optional - Relationship to the user. - **phoneNumbers** (array) - Optional - List of emergency contact phone numbers. - **type** (string) - Optional - Phone number type (e.g., MOBILE). - **countryCode** (integer) - Optional - Country calling code. - **isoCountryCode** (string) - Optional - ISO country code. - **nationalNumber** (integer) - Optional - National phone number. - **businessInfo** (object) - Optional - Contains business-related information. - **email** (string) - Optional - User's business email address. Recommended as a primary identifier. - **employeeId** (string) - Optional - Unique employee identifier. - **workerType** (string) - Optional - Type of worker (e.g., EMPLOYEE). - **organizationRef** (object) - Required - Reference to the organization. - **id** (string) - Required - The ID of the organization. - **legalEntityRef** (object) - Required - Reference to the legal entity. - **id** (string) - Required - The ID of the legal entity. ### Request Example ```json { "persona": "EMPLOYEE", "personalInfo": { "title": "MS", "gender": "FEMALE", "name": { "given": "Rachel", "middle": "Anne", "family1": "Torres" }, "dob": { "iso8601": "1988-03-22" }, "email": "rachel.torres@example.com", "addresses": [ { "addressLines": ["450 Lexington Avenue"], "locality": "New York", "administrativeArea": "NY", "postalCode": "10017", "regionCode": "US", "isDefault": true } ], "emergencyContact": { "name": "Marco Torres", "relation": "SPOUSE", "phoneNumbers": [ { "type": "MOBILE", "countryCode": 1, "isoCountryCode": "US", "nationalNumber": 2125550187 } ] } }, "businessInfo": { "email": "rachel.torres@acmecorp.com", "employeeId": "EMP-20391", "workerType": "EMPLOYEE", "organizationRef": { "id": "a3f8c1d2-7b45-4e29-9f61-8c3d2e1a5b74" }, "legalEntityRef": { "id": "d7e2b309-1c84-4f73-a562-3e9f1d8c7a20" } } } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier of the newly created user. #### Response Example ```json { "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479" } ``` ``` -------------------------------- ### Get Office Source: https://developer.spotnana.com/openapi/companyapi/offices This endpoint gets an office by ID. ```APIDOC ## GET /v2/companies/{companyId}/legal-entities/{legalEntityId}/offices/{officeId} ### Description This endpoint gets an office by ID. ### Method GET ### Endpoint /v2/companies/{companyId}/legal-entities/{legalEntityId}/offices/{officeId} ``` -------------------------------- ### Get user roles Source: https://developer.spotnana.com/openapi/usersapi/users This endpoint gets user roles. ```APIDOC ## GET /v2/users/{userId}/roles ### Description This endpoint gets user roles. ### Method GET ### Endpoint /v2/users/{userId}/roles ``` -------------------------------- ### Create User Source: https://developer.spotnana.com/releases/changelog_before_march2025.md Creates a new user. ```APIDOC ## POST /v2/users ### Description Creates a new user in the system. ### Method POST ### Endpoint /v2/users ### Request Example ```json { "externalId": { "description": "Description for the new user's external ID" } } ``` ``` -------------------------------- ### Get user Source: https://developer.spotnana.com/openapi/usersapi/users This endpoint gets user details for user ID. ```APIDOC ## GET /v2/users/{userId} ### Description This endpoint gets user details for user ID. ### Method GET ### Endpoint /v2/users/{userId} ``` -------------------------------- ### AirInitiateBookingRequest Source: https://developer.spotnana.com/_bundle/openapi/AirApi.json?download= Request object to initiate a flight booking, containing travel, traveler, and payment source details. ```APIDOC ## AirInitiateBookingRequest ### Description Request object to initiate a flight booking, containing travel, traveler, and payment source details. ### Parameters #### Request Body - **initiateBookingWorkflowIds** (InitiateBookingWorkflowIds) - Workflow IDs for initiating the booking. - **travelers** (array[AirBookTravelerInfo]) - Information about the travelers. - **bookingCharges** (array[BookingCharge]) - Details of booking charges. - **bookingContact** (BookingContact) - The booking contact for the itinerary. Airlines send update and change information to this contact. - **useExistingBooking** (boolean) - Use an existing booking if available to initiate. ``` -------------------------------- ### Create Office Source: https://developer.spotnana.com/openapi/companyapi/offices This endpoint creates an office. ```APIDOC ## POST /v2/companies/{companyId}/legal-entities/{legalEntityId}/offices ### Description This endpoint creates an office. ### Method POST ### Endpoint /v2/companies/{companyId}/legal-entities/{legalEntityId}/offices ``` -------------------------------- ### Get event Source: https://developer.spotnana.com/openapi/eventapi/events Get event details for the specified event ID. ```APIDOC ## GET /v2/events/{eventId} ### Description Get event details for the specified event ID. ### Method GET ### Endpoint /v2/events/{eventId} #### Path Parameters - **eventId** (string) - Required - The ID of the event to retrieve. ``` -------------------------------- ### Create Hotel Booking with Loyalty Points Source: https://developer.spotnana.com/guides/hotel_guides/hotel_loyalty_guide.md Use the `otherCoinage` field to specify loyalty points for hotel bookings. This example shows how to book with Brex points. ```json // ... payload truncated for focus "amount": { "amount": 800.00, "currencyCode": "GBP", "convertedAmount": 1000.00, "convertedCurrency": "USD", "otherCoinage": [ { "coinageCode": "BREX_POINTS", "amount": 100000, "conversionRate": 0.008, "preferredCurrencyConversionRate": 0.01 } ] } ``` -------------------------------- ### Get event Source: https://developer.spotnana.com/openapi/eventapi.md Get event details for the specified event ID. ```APIDOC ## GET /v2/events/{eventId} ### Description Get event details for the specified event ID. ### Method GET ### Endpoint /v2/events/{eventId} #### Path Parameters - **eventId** (string) - Required - The unique identifier of the event. ``` -------------------------------- ### HTML Frontend Integration with Spotnana Iframe Source: https://developer.spotnana.com/integration/iframe/iframe-frontend-setup.md This HTML code demonstrates how to integrate the Spotnana iframe into your frontend. It includes a button to launch the iframe and handles the token exchange process via postMessage. ```html Spotnana Embed

Spotnana Integration

``` -------------------------------- ### Get PNR Source: https://developer.spotnana.com/openapi/tripapi.md This endpoint gets PNR for a given trip ID and PNR ID. ```APIDOC ## GET /v3/trips/{tripId}/pnrs/{pnrId} ### Description This endpoint gets PNR for a given trip ID and PNR ID. ### Method GET ### Endpoint /v3/trips/{tripId}/pnrs/{pnrId} #### Path Parameters - **tripId** (string) - Required - The ID of the trip. - **pnrId** (string) - Required - The ID of the PNR. ``` -------------------------------- ### Get trip details Source: https://developer.spotnana.com/openapi/tripapi/trips This endpoint gets trip details for a given trip ID. ```APIDOC ## Get trip details ### Description This endpoint gets trip details for a given trip ID. ### Method GET ### Endpoint /v3/trips/{tripId}/detail ### Parameters #### Path Parameters - **tripId** (string) - Required - The ID of the trip to retrieve details for. ### Response #### Success Response (200) - **refundPolicy** (object) - Description of refund policy. - **exchangePolicy** (object) - Description of exchange policy. Note: For air bookings made via Travelfusion (i.e., pnrs.data.sourceInfo.bookingSource: TRAVEL_FUSION) the refundPolicy and exchangePolicy fields will be empty. ### Response Example (Schema not provided in source) ``` -------------------------------- ### Initiate Booking Response Source: https://developer.spotnana.com/openapi/airapi/air/airinitiatebooking.md Details of a successful booking initiation. ```APIDOC ## Response 200 (application/json) ### Fields - **initiateBookingResponseId** (string) - Required - Initiated booking's reference id Example: "CuwDQ2hCa09HVTJZemsyWVRFNFlUUm" - **paymentSourcePrePaymentInformation** (array) - Optional - - **paymentSourceId** (string) - Required - Unique identifier identifying this payment source. Example: "f49d00fe-1eda-4304-ba79-a980f565281d" - **paymentRequestId** (string) - Required - Payment source initialization request id Example: "XHY675ER7Y2" - **additionalInformation** (object) - Optional - Payment source specific additional pre-payment information needed to initialize payment provider - **loyaltyAccountNumber** (string) - Optional - Loyalty account number in case rewards program is used - **loyaltyProgramName** (string) - Optional - Loyalty program name in case rewards program is used - **canStoreCreditCard** (boolean) - Optional - Is payment provider allowed to store user's credit card information ``` -------------------------------- ### Get user personal info Source: https://developer.spotnana.com/openapi/usersapi/users This endpoint gets user personal info by user ID. ```APIDOC ## GET /v2/users/{userId}/personal-info ### Description This endpoint gets user personal info by user ID. ### Method GET ### Endpoint /v2/users/{userId}/personal-info ``` -------------------------------- ### Create Hotel Booking Source: https://developer.spotnana.com/spotnana/hotel_booking_workflow.md Create a new hotel booking with traveler details, payment information, and contact information. Requires `bookingKey` from the price verification step. ```APIDOC ## Create a hotel booking ### Description Create a new hotel booking. ### Method POST ### Endpoint /v2/hotel/create-pnr ### Parameters #### Request Body - **bookingKey** (string) - Required - The key obtained after price verification. - **tripId** (string) - Optional - An existing trip ID or use the create trip API. - **travelers** (array) - Required - Details about the travelers. - **paymentDetails** (object) - Required - Payment information. - **contactInfo** (object) - Required - Point of contact details. ### Request Example ```json { "bookingKey": "booking-key-123", "tripId": "trip-id-456", "travelers": [], "paymentDetails": {}, "contactInfo": {} } ``` ### Response #### Success Response (200) - **pnrId** (string) - The PNR ID of the booking. - **pnrStatus** (string) - The status of the PNR. - **externalPnrId** (string) - The PNR ID from the GDS or supplier. ``` -------------------------------- ### Get user business info Source: https://developer.spotnana.com/openapi/usersapi/users This endpoint gets user business info by user ID. ```APIDOC ## GET /v2/users/{userId}/business-info ### Description This endpoint gets user business info by user ID. ### Method GET ### Endpoint /v2/users/{userId}/business-info ``` -------------------------------- ### Upload Document with Node.js (native fetch) Source: https://developer.spotnana.com/_bundle/openapi/DocumentApi.json?download= This example demonstrates uploading a document using Node.js's native `fetch` API, available in Node 18+. It utilizes `Blob` for file handling and automatically sets the `Content-Type` for multipart data. ```JavaScript import fs from "fs"; import path from "path"; async function uploadDocument() { const filePath = "/Path/to/file/document.pdf"; // Read file as a buffer const fileBuffer = fs.readFileSync(filePath); // Create FormData const formData = new FormData(); // Add file using Blob (Node 18+) formData.append( "file", new Blob([fileBuffer], { type: "application/pdf" }), "document.pdf" ); // Metadata object const metadata = { documentType: "INVOICE", entityType: "PNR", entityId: "1234567890", entityMetadata: { travelType: "AIR", invoiceMetadata: { invoiceNumber: "ABCD-1234" } }, name: "Trip-Invoice-Test" }; // Add metadata JSON string formData.append("documentMetadata", JSON.stringify(metadata)); // Make request using native fetch const response = await fetch( "https://api-ext-sboxmeta.partners.spotnana.com/v2/documents", { method: "POST", headers: { Authorization: "Bearer " // Don't set Content-Type — fetch will add the multipart boundary automatically }, body: formData } ); const result = await response.text(); console.log(result); } uploadDocument().catch(console.error); ``` -------------------------------- ### Get Async Event Job Status Source: https://developer.spotnana.com/openapi/eventapi/events Get current details of an async event job. ```APIDOC ## POST /v2/events/jobs/status ### Description Get current details of an async event job. ### Method POST ### Endpoint /v2/events/jobs/status ``` -------------------------------- ### AirInitiateBookingResponse Source: https://developer.spotnana.com/_bundle/openapi/AirApi.json?download= Response object after initiating a flight booking, providing a reference ID and pre-payment information. ```APIDOC ## AirInitiateBookingResponse ### Description Response object after initiating a flight booking, providing a reference ID and pre-payment information. ### Response #### Success Response (200) - **initiateBookingResponseId** (string) - The reference ID for the initiated booking. Example: "CuwDQ2hCa09HVTJZemsyWVRFNFlUUm". - **paymentSourcePrePaymentInformation** (array[PaymentSourcePrePaymentInformation]) - Pre-payment information from the payment source. ``` -------------------------------- ### Create user Source: https://developer.spotnana.com/openapi/usersapi/users This endpoint is used to create user profiles in Spotnana. This is typically used by partner companies to onboard user profiles of their customer organizations. ```APIDOC ## POST /v2/users ### Description This endpoint is used to create user profiles in Spotnana. This is typically used by partner companies to onboard user profiles of their customer organizations. ### Method POST ### Endpoint /v2/users ``` -------------------------------- ### Get Async Event Job Details Source: https://developer.spotnana.com/_bundle/openapi/EventApi.json?download= Get current details of an async event job ```APIDOC ## POST /v2/events/jobs/status ### Description Get current details of an async event job ### Method POST ### Endpoint /v2/events/jobs/status ### Request Body - **body** (AsyncJobDetailRequest) - Required ### Response #### Success Response (200) - **response** (AsyncJobDetailResponse) - Async job details. ``` -------------------------------- ### Updates - Event API: GET /v2/events/payment-sources Source: https://developer.spotnana.com/releases/changelog_before_may2025.md Updates to the get payment sources endpoint for Event API. ```APIDOC ## GET /v2/events/payment-sources ### Description Retrieves payment sources for events. ### Method GET ### Endpoint /v2/events/payment-sources ### Response #### Success Response (200) - **paymentSources** (object) - Contains a list of payment sources. - **paymentSource** (object) - Details of a payment source. - **unusedCreditDescriptor** (object) - Descriptor for unused credits. - **unusedCreditInfo** (object) - Information about unused credits. - **paymentSourceId** (string) - Identifier for the payment source of unused credits. ``` -------------------------------- ### Initiate Booking Source: https://developer.spotnana.com/spotnana/air_booking_workflow.md Initiate the booking process for a trip. Requires IDs from previous steps and traveler details. ```APIDOC ## Initiate Booking ### Description Initiate the booking process for a trip. Requires IDs from previous steps and traveler details. ### Method POST ### Endpoint /v2/air/initiate-booking ### Parameters #### Request Body - **initiateBookingWorkflowIds** (object) - Required - Contains `checkoutResponseId` from Step 4 and `seatMapResponseId` from Step 5. - Traveler details. - **bookingCharges** (object) - Details of booking charges. - **bookingContact** (object) - Contact information for the booking. ### Response #### Success Response (200) - **initiateBookingResponseId** (string) - Identifier for the initiated booking. ``` -------------------------------- ### List Templates Source: https://developer.spotnana.com/spotnana/spd_create_spdevent_workflow.md Lists all available templates for a company. This is an optional first step to find a template to use. ```APIDOC ## List Templates ### Description List all the templates that have been created for a company. This is an optional step to find a template to use for creating an SPD trip. ### Method POST ### Endpoint /v2/event-templates/list ### Parameters #### Request Body - **companyId** (string) - Required - The ID of the company for which to list templates. - **offset** (integer) - Optional - The number of templates to skip before starting to collect the result set. - **limit** (integer) - Optional - The maximum number of templates to return. ### Response #### Success Response (200) - **templates** (array) - A list of template objects, each containing `templateId` and event details. ### Request Example ```json { "companyId": "your_company_id", "offset": 0, "limit": 10 } ``` ### Response Example ```json { "templates": [ { "templateId": "tpl_abc123", "eventName": "Conference 2024", "description": "Annual company conference" } ] } ``` ``` -------------------------------- ### Get Flight Checkout Details Source: https://developer.spotnana.com/spotnana/air_booking_workflow.md Get checkout related information for a selected itinerary. Requires `searchId` and `itineraryId`. ```APIDOC ## Get Flight Checkout Details ### Description Get checkout related information for a selected itinerary. Requires `searchId` and `itineraryId`. ### Method POST ### Endpoint /v2/air/flight-checkout ### Parameters #### Request Body - **searchId** (string) - Required - The search identifier. - **itineraryId** (string) - Required - The identifier of the selected itinerary. ### Response #### Success Response (200) - **checkoutResponseId** (string) - Identifier for the checkout response. - Baggage information. - Ancillaries. - Other checkout parameters. - Supported payment options. ``` -------------------------------- ### Get user's external ID Source: https://developer.spotnana.com/openapi/usersapi/users This endpoint gets user's external ID by user ID. ```APIDOC ## GET /v2/users/{userId}/external-id ### Description This endpoint gets user's external ID by user ID. ### Method GET ### Endpoint /v2/users/{userId}/external-id ``` -------------------------------- ### POST /v2/air/initiate-booking Source: https://developer.spotnana.com/releases/changelog_before_may2025.md Initiates a booking process for air travel. This update includes support for a new payment method. ```APIDOC ## POST /v2/air/initiate-booking ### Description Initiates a booking process for air travel. This update includes support for a new payment method. ### Method POST ### Endpoint /v2/air/initiate-booking ### Request Body - `bookingCharges.paymentMethod.selectedPaymentSource.amount.otherCoinage.coinageCode` (string) - Added support for `CUSTOM_VIRTUAL_PAYMENT`. - `bookingCharges.paymentMethod.selectedPaymentSource.rawPaymentSource.totalFare.otherCoinage.coinageCode` (string) - Added support for `CUSTOM_VIRTUAL_PAYMENT`. - `bookingCharges.amount.tax.otherCoinage.coinageCode` (string) - Added support for `CUSTOM_VIRTUAL_PAYMENT`. - `bookingCharges.amount.base.otherCoinage.coinageCode` (string) - Added support for `CUSTOM_VIRTUAL_PAYMENT`. ```