openapi: 3.2.0 info: version: v1.0.0 title: XETA Expense API description: XE Travel API - Manage your trips and associated expenses. servers: - url: https://xeta-api.xe.com/v1 tags: - name: Expense paths: /expense: get: responses: '200': description: 200 response content: application/json: schema: $ref: '#/components/schemas/ExpenseList' '400': description: 400 response content: application/json: schema: $ref: '#/components/schemas/XetaError' '500': description: 500 response content: application/json: schema: $ref: '#/components/schemas/XetaError' security: - xeta-drupal-authorizer: [] tags: - Expense post: responses: '200': description: 200 response content: application/json: schema: $ref: '#/components/schemas/Expense' '400': description: 400 response content: application/json: schema: $ref: '#/components/schemas/XetaError' '500': description: 500 response content: application/json: schema: $ref: '#/components/schemas/XetaError' security: - xeta-drupal-authorizer: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/Expense' required: true tags: - Expense /expense/{expenseId}: get: parameters: - name: expenseId in: path required: true schema: type: string responses: '200': description: 200 response content: application/json: schema: $ref: '#/components/schemas/Expense' '400': description: 400 response content: application/json: schema: $ref: '#/components/schemas/XetaError' '500': description: 500 response content: application/json: schema: $ref: '#/components/schemas/XetaError' security: - xeta-drupal-authorizer: [] tags: - Expense put: parameters: - name: expenseId in: path required: true schema: type: string responses: '200': description: 200 response content: application/json: schema: $ref: '#/components/schemas/Expense' '400': description: 400 response content: application/json: schema: $ref: '#/components/schemas/XetaError' '500': description: 500 response content: application/json: schema: $ref: '#/components/schemas/XetaError' security: - xeta-drupal-authorizer: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/Expense' required: true tags: - Expense delete: parameters: - name: expenseId in: path required: true schema: type: string responses: '200': description: 200 response '400': description: 400 response content: application/json: schema: $ref: '#/components/schemas/XetaError' '500': description: 500 response content: application/json: schema: $ref: '#/components/schemas/XetaError' security: - xeta-drupal-authorizer: [] tags: - Expense components: schemas: ExpenseExpenseInvitationsItem: type: object required: - amount - expenseId - friendId - id - lastModifiedDate - userId properties: createdBy: type: integer description: Id of the user who created this entity. createdDate: type: integer description: Timestamp of when this entity was created. lastModifiedBy: type: integer description: Id of the user who last modified this entity. lastModifiedDate: type: integer description: Timestamp of when this entity was last modified. id: type: integer description: Unique identifier. invitationStatusName: type: string description: Status of the invitation. enum: - ACCEPTED - PENDING - REJECTED - DELETED userId: type: integer description: Id of the user who sent this invitation. friendId: type: integer description: Id of the user the expense was shared with. expenseId: type: integer description: Id of the expense that was shared. amount: type: number description: The amount of the expense that was split with the friend. description: An entity used to share expenses with other users. ExpenseList: title: ExpenseList type: array description: Expense List object items: $ref: '#/components/schemas/Expense' XetaErrorValidationErrorsItem: type: object required: - code - message properties: code: type: string description: Unique error code. enum: - SIZE - 'NULL' - DIGIT - REQUIRED - UNEXPECTED - TRIP - EXPENSE - EMAIL message: type: string description: Verbose error description. field: type: string description: Field that triggered the validation error. description: An entity used to represent validation errors. ExpenseUserExpense: type: object required: - budgetCategoryId - expenseId - lastModifiedDate - userId properties: createdBy: type: integer description: Id of the user who created this entity. createdDate: type: integer description: Timestamp of when this entity was created. lastModifiedBy: type: integer description: Id of the user who last modified this entity. lastModifiedDate: type: integer description: Timestamp of when this entity was last modified. userId: type: integer description: Id of the user in this relationship. expenseId: type: integer description: Id of the expense in this relationship. budgetCategoryId: type: integer description: Id of the budget category the associated expense is categorized under. description: An entity used to associate an expense and a user. Expense: type: object required: - fromAmount - fromCurrencyCode - id - incurredDate - lastModifiedDate - margin - midMarketRate - name - rate - toCurrencyCode - tripExpense - usdMidMarketRate - userExpense properties: createdBy: type: integer description: Id of the user who created this entity. createdDate: type: integer description: Timestamp of when this entity was created. lastModifiedBy: type: integer description: Id of the user who last modified this entity. lastModifiedDate: type: integer description: Timestamp of when this entity was last modified. id: type: integer description: Unique identifier. name: type: string description: Expense name. minLength: 1 maxLength: 191 pattern: ^.*\S+.*$ fromAmount: type: number description: Foreign amount spent. toAmount: type: number description: Local amount spent. usdToAmount: type: number description: Local amount spent in USD. splitAmount: type: number description: Local amount shared. paymentMethodName: type: string description: Method used to pay for the expense. enum: - BANK_TRANSFER - CASH - CREDIT_CARD - DEBIT_CARD - MOBILE_PAYMENT - TRAVELERS_CHEQUE merchant: type: string description: Name of the merchant the expense was made made at. maxLength: 191 fromCurrencyCode: type: string description: ISO 4217 foreign currency code. minLength: 3 maxLength: 3 pattern: ^.*\S+.*$ toCurrencyCode: type: string description: ISO 4217 local currency code. minLength: 3 maxLength: 3 pattern: ^.*\S+.*$ midMarketRate: type: number description: Mid-market rate from the foreign currency to the local currency. rate: type: number description: Overriden rate from the foreign currency to the local currency. usdMidMarketRate: type: number description: Mid-market rate from the local currency to USD. margin: type: number description: Percentage increase in rate. note: type: string description: Arbitrary notes attached to an expense. maxLength: 65535 incurredDate: type: integer description: Timestamp of when this expense was incurred. userExpense: $ref: '#/components/schemas/ExpenseUserExpense' tripExpense: $ref: '#/components/schemas/ExpenseTripExpense' expenseInvitations: type: array description: List of invitations sent to share this expense. items: $ref: '#/components/schemas/ExpenseExpenseInvitationsItem' title: Expense description: An entity used to record expenses. ExpenseTripExpense: type: object required: - expenseId - lastModifiedDate - tripId properties: createdBy: type: integer description: Id of the user who created this entity. createdDate: type: integer description: Timestamp of when this entity was created. lastModifiedBy: type: integer description: Id of the user who last modified this entity. lastModifiedDate: type: integer description: Timestamp of when this entity was last modified. tripId: type: integer description: Id of the trip in this relationship. expenseId: type: integer description: Id of the expense in this relationship. description: An entity used to associate an expense and a trip. XetaError: type: object properties: code: type: string description: Unique error code. enum: - OPTIMISTIC_LOCK - ENTITY_NOT_FOUND - ROUTE_NOT_FOUND - JSON - VALIDATION - UNAUTHORIZED - FORBIDDEN - UNEXPECTED - ENTITY_EXISTS - TOO_MANY_REQUESTS message: type: string description: Verbose error description. validationErrors: type: array description: Verbose validation errors. items: $ref: '#/components/schemas/XetaErrorValidationErrorsItem' title: Xeta Error description: An entity used to represent all errors. securitySchemes: xeta-drupal-authorizer: type: apiKey name: Cookie in: header x-amazon-apigateway-authtype: custom