openapi: 3.2.0 info: title: Swittest API 🚀 Test API description: ' ### Prerequisites To use this API, you must have an active organization and an active user. If you don''t have an account yet, please contact us at [contact@switstack.io](mailto:contact@switstack.io). ### Roles - **Data**: Can get test suites, tests, configs and vcards. - **Full**: Can fully use swittest. ### Authentication To make authenticated requests, call `/auth/token` with your credentials and the appropriate grant type. An access token will be returned, which must be included in the request''s Authorization header using the Bearer prefix (`Authorization: Bearer `). ' version: 0.13.0 tags: - name: Test paths: /api/tests/{test_suite_name_or_index}/{test_name_or_index}: get: tags: - Test summary: Get Test operationId: get_test security: - OAuth2PasswordBearer: [] parameters: - name: test_suite_name_or_index in: path required: true schema: type: string title: Test Suite Name Or Index - name: test_name_or_index in: path required: true schema: type: string title: Test Name Or Index responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/TestSchema' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /api/tests/{test_suite_name_or_index}/{test_name_or_index}/config: get: tags: - Test summary: Get Test Config operationId: get_test_config security: - OAuth2PasswordBearer: [] parameters: - name: test_suite_name_or_index in: path required: true schema: type: string title: Test Suite Name Or Index - name: test_name_or_index in: path required: true schema: type: string title: Test Name Or Index responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ConfigSchema' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /api/tests/{test_suite_name_or_index}/{test_name_or_index}/vcard: get: tags: - Test summary: Get Test Vcard operationId: get_test_vcard security: - OAuth2PasswordBearer: [] parameters: - name: test_suite_name_or_index in: path required: true schema: type: string title: Test Suite Name Or Index - name: test_name_or_index in: path required: true schema: type: string title: Test Name Or Index responses: '200': description: Successful Response content: application/json: schema: anyOf: - type: array items: type: string - type: 'null' title: Response Get Test Vcard Api Tests Test Suite Name Or Index Test Name Or Index Vcard Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /api/tests/{test_suite_name_or_index}/{test_selection}: post: tags: - Test summary: Run Tests description: 'This endpoint runs one or more tests from a specified test suite. The response is streamed in real-time using Server-Sent Events (SSE) to provide continuous updates on the test execution status. Possible test selection values: - A single test name
- An index: 1036
- A list of indexes: 0, 99, 1036
- A range: 0-5
- A list of ranges: 0-5, 15-40
- A combination of ranges and indexes: 0-5, 8, 9, 15-40
- Select all tests with the value all

Verbose mode levels: - Level 0: Status and errors only
- Level 1: Level 0 + payment data and log data sets
- Level 2: Level 1 + parsed authorization TLV in payment data
- Level 3: Level 2 + parsed DF8129, DF8115, and DF8116 tags
' operationId: run_tests security: - OAuth2PasswordBearer: [] parameters: - name: test_suite_name_or_index in: path required: true schema: type: string title: Test Suite Name Or Index - name: test_selection in: path required: true schema: type: string title: Test Selection requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/RunTestSchema' responses: '200': description: Successful Response content: text/event-stream: itemSchema: type: object properties: data: type: string event: type: string id: type: string retry: type: integer minimum: 0 '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /api/tests: post: tags: - Test summary: Run Custom Test description: 'Verbose mode levels: - Level 0: Status and errors only
- Level 1: Level 0 + payment data and log data sets
- Level 2: Level 1 + parsed authorization TLV in payment data
- Level 3: Level 2 + parsed DF8129, DF8115, and DF8116 tags
' operationId: run_custom_test requestBody: content: application/json: schema: $ref: '#/components/schemas/RunCustomTestSchema' required: true responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/TestResultSchema' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - OAuth2PasswordBearer: [] components: schemas: CRListSchema: properties: name: type: string title: Name crs: items: type: string type: array title: Crs additionalProperties: false type: object required: - name - crs title: CRListSchema ToolEnum: type: string enum: - swittest - fime - gallit title: ToolEnum TestSchema: properties: name: type: string title: Name description: anyOf: - type: string - type: 'null' title: Description version: type: string title: Version date: type: string format: date title: Date poi_config: $ref: '#/components/schemas/POIConfigSchema' payments: items: $ref: '#/components/schemas/PaymentSchema' type: array title: Payments vcard: anyOf: - items: type: string type: array - type: 'null' title: Vcard ics: anyOf: - items: type: string type: array - type: 'null' title: Ics ics_not: anyOf: - items: type: string type: array - type: 'null' title: Ics Not environment: $ref: '#/components/schemas/EnvironmentSchema' additionalProperties: false type: object required: - name - version - date - poi_config - payments - environment title: TestSchema HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError CAPKAlgorithmType: type: string enum: - RSA title: CAPKAlgorithmType RunCustomTestSchema: properties: settings: $ref: '#/components/schemas/SettingsSchema' probe: type: boolean title: Probe default: false check_expectations: type: boolean title: Check Expectations default: true verbose: type: integer title: Verbose default: 0 test: $ref: '#/components/schemas/CustomTestSchema' config: $ref: '#/components/schemas/ConfigSchema' additionalProperties: false type: object required: - settings - test - config title: RunCustomTestSchema CAPKSchema: properties: name: anyOf: - type: string maxLength: 255 minLength: 1 examples: - CAPK name - type: 'null' title: Name rid: type: string maxLength: 10 minLength: 10 title: Rid examples: - A000000004 index: type: string maxLength: 2 minLength: 2 title: Index examples: - EF hash_type: $ref: '#/components/schemas/CAPKHashType' default: UNDEFINED algorithm_type: $ref: '#/components/schemas/CAPKAlgorithmType' default: RSA modulus: type: string maxLength: 1024 minLength: 1 title: Modulus examples: - A191CB87473F29349B5D60A88B3EAEE0973AA6F1A082F358D849FDDFF9C091F899EDA9792CAF09EF28F5D22404B88A2293EEBBC1949C43BEA4D60CFD879A1539544E09E0F09F60F065B2BF2A13ECC705F3D468B9D33AE77AD9D3F19CA40F23DCF5EB7C04DC8F69EBA565B1EBCB4686CD274785530FF6F6E9EE43AA43FDB02CE00DAEC15C7B8FD6A9B394BABA419D3F6DC85E16569BE8E76989688EFEA2DF22FF7D35C043338DEAA982A02B866DE5328519EBBCD6F03CDD686673847F84DB651AB86C28CF1462562C577B853564A290C8556D818531268D25CC98A4CC6A0BDFFFDA2DCCA3A94C998559E307FDDF915006D9A987B07DDAEB3B exponent: type: string maxLength: 6 minLength: 2 title: Exponent examples: - '03' hash: type: string minLength: 1 title: Hash expires_at: anyOf: - type: string format: date - type: 'null' title: Expires At additionalProperties: false type: object required: - rid - index - modulus - exponent - hash title: CAPKSchema ExpectationsPartSchema: properties: intermediate_signals: anyOf: - items: $ref: '#/components/schemas/IntermediateSignalSchema' type: array - type: 'null' title: Intermediate Signals data_record: anyOf: - $ref: '#/components/schemas/ExpectationsDataSchema' - type: 'null' discretionary_data: anyOf: - $ref: '#/components/schemas/ExpectationsDataSchema' - type: 'null' user_interface_request_data: anyOf: - $ref: '#/components/schemas/UserInterfaceRequestDataSchema' - type: 'null' outcome_parameter_set: anyOf: - $ref: '#/components/schemas/OutcomeParameterSetSchema' - type: 'null' error_indication: anyOf: - $ref: '#/components/schemas/ErrorIndicationSchema' - type: 'null' transaction_data: anyOf: - $ref: '#/components/schemas/ExpectationsDataSchema' - type: 'null' additionalProperties: false type: object title: ExpectationsPartSchema SettingsSchema: properties: poi_id: type: string format: uuid title: Poi Id org_admin_email: type: string format: email title: Org Admin Email org_admin_password: type: string title: Org Admin Password user_machine_client_id: type: string title: User Machine Client Id user_machine_client_secret: type: string title: User Machine Client Secret additionalProperties: false type: object required: - poi_id - org_admin_email - org_admin_password - user_machine_client_id - user_machine_client_secret title: SettingsSchema CAPKScopeSchema: properties: capks: additionalProperties: $ref: '#/components/schemas/CAPKSchema' type: object title: Capks capk_list: $ref: '#/components/schemas/CAPKListSchema' additionalProperties: false type: object required: - capks - capk_list title: CAPKScopeSchema BINConfigSchema: properties: name: type: string title: Name bin_lists: items: type: string type: array title: Bin Lists additionalProperties: false type: object required: - name - bin_lists title: BINConfigSchema EMVListSchema: properties: name: type: string title: Name emvs: items: type: string type: array title: Emvs additionalProperties: false type: object required: - name - emvs title: EMVListSchema EMVSchema: properties: name: anyOf: - type: string maxLength: 255 minLength: 1 examples: - EMV name - type: 'null' title: Name technology_type: $ref: '#/components/schemas/EMVTechnologyType' default: CONTACTLESS kernel: type: string maxLength: 2 minLength: 1 title: Kernel examples: - 0F aid: type: string maxLength: 32 minLength: 1 title: Aid examples: - A0000000041010 transaction_type: $ref: '#/components/schemas/EMVTransactionType' default: '00' asf: type: boolean title: Asf default: true tlv: type: string minLength: 1 title: Tlv examples: - 5F200F4D696B65204A6F686E20536D697468 additionalProperties: false type: object required: - kernel - aid - tlv title: EMVSchema CRSchema: properties: name: anyOf: - type: string maxLength: 255 minLength: 1 examples: - CR name - type: 'null' title: Name rid: type: string maxLength: 10 minLength: 10 title: Rid examples: - A000000004 index: type: string maxLength: 2 minLength: 2 title: Index examples: - '00' serial_number: type: string maxLength: 6 minLength: 6 title: Serial Number examples: - 3F70D8 additionalProperties: false type: object required: - rid - index - serial_number title: CRSchema TestStatusEnum: type: string enum: - NOT RUN - PASS - NON CONCLUSIVE - FAIL title: TestStatusEnum CAPKHashType: type: string enum: - UNDEFINED - SHA1 - SHA256 title: CAPKHashType CRScopeSchema: properties: crs: additionalProperties: $ref: '#/components/schemas/CRSchema' type: object title: Crs cr_list: $ref: '#/components/schemas/CRListSchema' additionalProperties: false type: object required: - crs - cr_list title: CRScopeSchema SchemeEnum: type: string enum: - mastercard - amex - discover - jcb - cup - rupay - eftpos - cpace title: SchemeEnum IntermediateSignalSchema: properties: user_interface_request_data: anyOf: - $ref: '#/components/schemas/UserInterfaceRequestDataSchema' - type: 'null' outcome_parameter_set: anyOf: - $ref: '#/components/schemas/OutcomeParameterSetSchema' - type: 'null' error_indication: anyOf: - $ref: '#/components/schemas/ErrorIndicationSchema' - type: 'null' transaction_data: anyOf: - $ref: '#/components/schemas/ExpectationsDataSchema' - type: 'null' additionalProperties: false type: object title: IntermediateSignalSchema ErrorIndicationSchema: properties: l1: anyOf: - type: string enum: - OK - TIME OUT ERROR - TRANSMISSION ERROR - PROTOCOL ERROR - type: 'null' title: L1 l2: anyOf: - items: type: string enum: - OK - CARD DATA MISSING - CAM FAILED - STATUS BYTES - PARSING ERROR - MAX LIMIT EXCEEDED - CARD DATA ERROR - MAGSTRIPE NOT SUPPORTED - NO PPSE - PPSE FAULT - EMPTY CANDIDATE LIST - IDS READ ERROR - IDS WRITE ERROR - IDS DATA ERROR - IDS NO MATCHING AC - TERMINAL DATA ERROR type: array - type: 'null' title: L2 l3: anyOf: - type: string enum: - OK - TIME OUT - STOP - AMOUNT NOT PRESENT - type: 'null' title: L3 status_word: anyOf: - type: string maxLength: 4 minLength: 4 pattern: ^([0-9a-fA-F]{2})+$ - type: 'null' title: Status Word message_on_error: anyOf: - type: string enum: - CARD READ OK - TRY AGAIN - APPROVED - APPROVED - SIGN - DECLINED - ERROR - OTHER CARD - INSERT CARD - SEE PHONE - AUTHORISING - PLEASE WAIT - CLEAR DISPLAY - N/A - PROCESSING ERROR - type: 'null' title: Message On Error additionalProperties: false type: object title: ErrorIndicationSchema ValidationError: properties: loc: items: anyOf: - type: string - type: integer type: array title: Location msg: type: string title: Message type: type: string title: Error Type input: title: Input ctx: type: object title: Context type: object required: - loc - msg - type title: ValidationError EMVTechnologyType: type: string enum: - CONTACT - CONTACTLESS title: EMVTechnologyType EMVTransactionType: type: string enum: - '00' - '01' - '02' - 09 - '17' - '20' - '21' - '93' title: EMVTransactionType CAPKListSchema: properties: name: type: string title: Name capks: items: type: string type: array title: Capks additionalProperties: false type: object required: - name - capks title: CAPKListSchema EMVConfigSchema: properties: name: type: string title: Name emv_nominal_list: type: string title: Emv Nominal List emv_failsafe_list: anyOf: - type: string - type: 'null' title: Emv Failsafe List additionalProperties: false type: object required: - name - emv_nominal_list title: EMVConfigSchema BINListSchema: properties: name: type: string title: Name bins: items: type: string type: array title: Bins additionalProperties: false type: object required: - name - bins title: BINListSchema OutcomeParameterSetSchema: properties: status: anyOf: - items: type: string enum: - APPROVED - DECLINED - ONLINE REQUEST - END APPLICATION - SELECT NEXT - TRY ANOTHER INTERFACE - TRY AGAIN - N/A type: array - type: 'null' title: Status start: anyOf: - type: string enum: - A - B - C - D - N/A - type: 'null' title: Start online_response_data: anyOf: - type: string const: N/A - type: 'null' title: Online Response Data cvm: anyOf: - type: string enum: - NO CVM - OBTAIN SIGNATURE - ONLINE PIN - CONFIRMATION CODE VERIFIED - N/A - type: 'null' title: Cvm ui_request_on_outcome_present: anyOf: - type: boolean - type: 'null' title: Ui Request On Outcome Present ui_request_on_restart_present: anyOf: - type: boolean - type: 'null' title: Ui Request On Restart Present data_record_present: anyOf: - type: boolean - type: 'null' title: Data Record Present discretionary_data_present: anyOf: - type: boolean - type: 'null' title: Discretionary Data Present receipt: anyOf: - type: string enum: - N/A - 'YES' - type: 'null' title: Receipt alternate_interface_preference: anyOf: - type: string const: N/A - type: 'null' title: Alternate Interface Preference field_off_request: anyOf: - type: string pattern: ^([0-9a-fA-F]{2}|N/A)$ - type: 'null' title: Field Off Request removal_timeout: anyOf: - type: string pattern: ^[0-9a-fA-F]{2}$ - type: 'null' title: Removal Timeout additionalProperties: false type: object title: OutcomeParameterSetSchema TestResultSchema: properties: status: $ref: '#/components/schemas/TestStatusEnum' results: additionalProperties: true type: object title: Results default: {} type: object required: - status title: TestResultSchema ExpectationsDataSchema: properties: tags: title: Tags tags_present: anyOf: - items: type: string maxLength: 6 minLength: 2 pattern: ^([0-9a-fA-F]{2})+$ type: array - type: 'null' title: Tags Present tags_not_present: anyOf: - items: type: string maxLength: 6 minLength: 2 pattern: ^([0-9a-fA-F]{2})+$ type: array - type: 'null' title: Tags Not Present additionalProperties: false type: object title: ExpectationsDataSchema ExpectationsSchema: properties: restart: anyOf: - $ref: '#/components/schemas/RestartSchema' - type: 'null' authorization: anyOf: - $ref: '#/components/schemas/ExpectationsPartSchema' - type: 'null' completion: anyOf: - $ref: '#/components/schemas/ExpectationsPartSchema' - type: 'null' additionalProperties: false type: object title: ExpectationsSchema TypeEnum: type: string enum: - l2 - l3 title: TypeEnum EMVScopeSchema: properties: emvs: additionalProperties: $ref: '#/components/schemas/EMVSchema' type: object title: Emvs emv_lists: additionalProperties: $ref: '#/components/schemas/EMVListSchema' type: object title: Emv Lists emv_config: $ref: '#/components/schemas/EMVConfigSchema' additionalProperties: false type: object required: - emvs - emv_lists - emv_config title: EMVScopeSchema PaymentSchema: properties: randoms: anyOf: - items: type: string pattern: ^([0-9a-fA-F]{2})+$ type: array - type: 'null' title: Randoms trd: anyOf: - patternProperties: ^([0-9a-fA-F]{2})+$: anyOf: - type: string pattern: ^([0-9a-fA-F]{2})+$ - type: string pattern: ^[0-9YMD]{6}$ - type: string pattern: ^[0-9HMS]{6}$ - type: string maxLength: 0 minLength: 0 propertyNames: maxLength: 6 minLength: 2 type: object - type: 'null' title: Trd authorization_response: anyOf: - type: string pattern: ^([0-9a-fA-F]{2})+$ - type: 'null' title: Authorization Response expectations: anyOf: - $ref: '#/components/schemas/ExpectationsSchema' - type: 'null' additionalProperties: false type: object title: PaymentSchema UserInterfaceRequestDataSchema: properties: message_identifier: anyOf: - items: type: string enum: - CARD READ OK - TRY AGAIN - APPROVED - APPROVED - SIGN - DECLINED - ERROR - OTHER CARD - INSERT CARD - SEE PHONE - AUTHORISING - PLEASE WAIT - CLEAR DISPLAY - N/A - PROCESSING ERROR - PRESENT CARD type: array - type: 'null' title: Message Identifier status: anyOf: - type: string enum: - NOT READY - IDLE - READY TO READ - PROCESSING - CARD READ SUCCESSFULLY - PROCESSING ERROR - N/A - type: 'null' title: Status hold_time: anyOf: - type: string maxLength: 6 minLength: 6 pattern: ^([0-9]{2})+$ - type: 'null' title: Hold Time language_preference: anyOf: - type: string maxLength: 16 minLength: 16 pattern: ^([0-9a-fA-F]{2})+$ - type: 'null' title: Language Preference additionalProperties: false type: object title: UserInterfaceRequestDataSchema ConfigSchema: properties: bin_scope: anyOf: - $ref: '#/components/schemas/BINScopeSchema' - type: 'null' capk_scope: anyOf: - $ref: '#/components/schemas/CAPKScopeSchema' - type: 'null' cr_scope: anyOf: - $ref: '#/components/schemas/CRScopeSchema' - type: 'null' emv_scope: $ref: '#/components/schemas/EMVScopeSchema' poi_config: $ref: '#/components/schemas/POIConfigSchema' additionalProperties: false type: object required: - emv_scope - poi_config title: ConfigSchema POIConfigSchema: properties: name: type: string title: Name bin_config: anyOf: - type: string - type: 'null' title: Bin Config capk_list: anyOf: - type: string - type: 'null' title: Capk List cr_list: anyOf: - type: string - type: 'null' title: Cr List emv_config: type: string title: Emv Config additionalProperties: false type: object required: - name - emv_config title: POIConfigSchema RestartSchema: properties: outcome_parameter_set: anyOf: - $ref: '#/components/schemas/OutcomeParameterSetSchema' - type: 'null' error_indication: anyOf: - $ref: '#/components/schemas/ErrorIndicationSchema' - type: 'null' additionalProperties: false type: object title: RestartSchema RunTestSchema: properties: settings: $ref: '#/components/schemas/SettingsSchema' probe: type: boolean title: Probe default: false check_expectations: type: boolean title: Check Expectations default: true verbose: type: integer title: Verbose default: 0 sync_run: type: boolean title: Sync Run default: false additionalProperties: false type: object required: - settings title: RunTestSchema CustomEnvironmentSchema: properties: tool: anyOf: - $ref: '#/components/schemas/ToolEnum' - type: 'null' type: anyOf: - $ref: '#/components/schemas/TypeEnum' - type: 'null' scheme: $ref: '#/components/schemas/SchemeEnum' test_suite_version: anyOf: - type: string - type: 'null' title: Test Suite Version additionalProperties: false type: object required: - scheme title: CustomEnvironmentSchema BINScopeSchema: properties: bins: additionalProperties: $ref: '#/components/schemas/BINSchema' type: object title: Bins bin_lists: additionalProperties: $ref: '#/components/schemas/BINListSchema' type: object title: Bin Lists bin_config: $ref: '#/components/schemas/BINConfigSchema' additionalProperties: false type: object required: - bins - bin_lists - bin_config title: BINScopeSchema BINSchema: properties: name: anyOf: - type: string maxLength: 255 minLength: 1 examples: - BIN name - type: 'null' title: Name min_range: type: integer title: Min Range examples: - 0 max_range: type: integer title: Max Range examples: - 99999999 additionalProperties: false type: object required: - min_range - max_range title: BINSchema CustomTestSchema: properties: name: type: string title: Name description: anyOf: - type: string - type: 'null' title: Description version: type: string title: Version date: type: string format: date title: Date poi_config: $ref: '#/components/schemas/POIConfigSchema' payments: items: $ref: '#/components/schemas/PaymentSchema' type: array title: Payments vcard: anyOf: - items: type: string type: array - type: 'null' title: Vcard ics: anyOf: - items: type: string type: array - type: 'null' title: Ics ics_not: anyOf: - items: type: string type: array - type: 'null' title: Ics Not environment: anyOf: - $ref: '#/components/schemas/CustomEnvironmentSchema' - type: 'null' additionalProperties: false type: object required: - name - version - date - poi_config - payments title: CustomTestSchema EnvironmentSchema: properties: tool: $ref: '#/components/schemas/ToolEnum' type: $ref: '#/components/schemas/TypeEnum' scheme: $ref: '#/components/schemas/SchemeEnum' test_suite_version: type: string title: Test Suite Version additionalProperties: false type: object required: - tool - type - scheme - test_suite_version title: EnvironmentSchema securitySchemes: OAuth2PasswordBearer: type: oauth2 flows: password: scopes: {} tokenUrl: auth/token