{"openapi":"3.0.0","servers":[{"description":"Test server","url":"https://services.nvalue.com.co/api/v1"},{"description":"SwaggerHub API Auto Mocking","url":"https://virtserver.swaggerhub.com/realtechltda/abc-pagos-api-express/1.0.0"}],"info":{"version":"1.0.0","title":"API Express ABCPagos","description":"API Express for the ABCPagos payment gateway"},"paths":{"/authenticate":{"post":{"tags":["Authenticate"],"description":"This endpoint is responsible for authenticating users by their username and password. It verifies the credentials and returns an authentication token upon successful verification.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string","example":"myUsername","description":"The 'username' field is the unique username or identifier for a user in the API. Ensure this field matches the user's registered username. Typically, it's an alphanumeric string."},"password":{"type":"string","format":"password","example":"********","description":"The 'password' field is a secure string used for user authentication. It should match the user's account password."}},"required":["username","password"]}}}},"responses":{"200":{"description":"Authentication successful","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/status"},"message":{"type":"string","example":"JWT Token created successfully. This token expires in 24 hours."},"data":{"type":"object","properties":{"token":{"type":"string","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"}}}}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"ERROR"},"message":{"type":"string","example":"Incomplete login data"},"error":{"type":"object","properties":{"code":{"type":"string","example":"BAD_REQUEST"},"description":{"type":"string","example":"Username or password cannot be null or empty"}}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"ERROR"},"message":{"type":"string","example":"Authentication failed"},"error":{"type":"object","properties":{"code":{"type":"string","example":"INVALID_CREDENTIALS"},"description":{"type":"string","example":"The username or password entered is not validy"}}}}}}}}}}},"/transactions":{"get":{"security":[{"bearerAuth":[]}],"tags":["Transactions"],"description":"To query transactions, it is essential to use the token as a query parameter in your request. This token, unique to each transaction, ensures accurate identification and retrieval of transaction data. It's important to note that the query might return one or multiple transactions. This is because the reference used to create transactions can be repeated, leading to multiple transactions associated with the same token. We recommend using a distinct reference for each transaction creation to avoid potential confusion and to ensure that the query returns a specific and intended result. Please ensure that your request includes the necessary Bearer token in the header for successful authentication and access to the transaction data.","operationId":"getTransactions","parameters":[{"name":"token","in":"query","required":true,"description":"Unique token in transaction","schema":{"type":"string"}}],"responses":{"200":{"description":"Transactions found","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/status"},"message":{"type":"string","example":"We have found 1 transactions associated with this token."},"data":{"type":"array","items":{"properties":{"transaction":{"$ref":"#/components/schemas/transaction"}}}},"error":{"type":"object"}}}}}},"401":{"description":"Transaction not found","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"ERROR"},"message":{"type":"string","example":"There are no results for these search criteria"},"data":{"type":"object"},"error":{"type":"object","properties":{"code":{"type":"string","example":"NOT_FOUND"},"description":{"type":"string","example":"No records found"}}}}}}}},"500":{"description":"internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"ERROR"},"message":{"type":"string","example":"Internal server error"},"data":{"type":"object"},"error":{"type":"object","properties":{"code":{"type":"string","example":"SERVER_ERROR"},"description":{"type":"string","example":"Unexpected error searching for these transaction"}}}}}}}}}},"post":{"security":[{"bearerAuth":[]}],"description":"To create a transaction, all fields are required to be filled accurately. Additionally, this operation requires a valid Bearer token, which should be obtained through the authentication process. Please ensure that the token is included in the header of your request for successful authorization. The absence of any required field or a valid Bearer token will result in the inability to process the transaction.","tags":["Transactions"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/createTransaction"}}}},"responses":{"201":{"description":"Transactions created","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/status"},"message":{"type":"string","example":"Transaction created successfully."},"data":{"type":"object","properties":{"transaction":{"type":"object","properties":{"token":{"type":"string","example":"f3fcd712246196fa2fb7c059dbb0c831"},"reference":{"type":"string","example":"123123123"},"status":{"$ref":"#/components/schemas/transactionStatus"},"amount":{"type":"number","example":1685100.0},"iva":{"type":"integer"},"description":{"type":"string","example":"Utility Bill Payment - ACME Corp Electricity, Invoice #123456, Billing Period: March 2023"},"paymentMethod":{"$ref":"#/components/schemas/paymentMethod"},"startDate":{"type":"string","example":"2023-11-20T18:44:43.0827412"},"redirectUrl":{"type":"string","example":"https://test.abcpagos.com/PSE/paymentProcessor?id_transaccion=123456"},"error":{"type":"object"}}}}}}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"ERROR"},"message":{"type":"string","example":"Bad Request"},"data":{"type":"object"},"error":{"type":"object","properties":{"code":{"type":"string","example":"REFERENCE_EXISTS"},"description":{"type":"string","example":"This reference already exists in our system"}}}}}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"createTransaction":{"type":"object","required":["reference","amount","iva","description","paymentMethod","customerData"],"properties":{"reference":{"type":"string","example":"123123123","description":"The 'reference' field is a numeric identifier for a specific transaction. It should be a unique number used to track and reference the transaction within the system. Ensure this field contains only numeric characters."},"amount":{"type":"number","example":100000,"description":"The 'amount' field represents the value of the transaction in Colombian currency (COP). It should be a numeric value indicating the total amount of the transaction."},"iva":{"type":"number","example":19000,"description":"The 'iva' field indicates the value of the 19% VAT (Value Added Tax) applied to the transaction in Colombia. It should be a numeric value calculated as 19% of the transaction amount. This field is essential for tax compliance and accurate financial reporting."},"description":{"type":"string","example":"Utility Bill Payment - ACME Corp Electricity, Invoice #123456, Billing Period: March 2023.","description":"The description field provides a brief, clear summary of the transaction. It should include relevant details that identify the nature or purpose of the transaction in a concise manner. This field is important for record-keeping and clarity in transaction logs."},"paymentMethod":{"$ref":"#/components/schemas/paymentMethod"},"customerData":{"$ref":"#/components/schemas/customerData"}}},"paymentMethod":{"type":"string","enum":["PSE","CREDIT_CARD"]},"customerData":{"type":"object","required":["legalIdType","legalId","fullName","email"],"properties":{"legalIdType":{"type":"string","enum":["CC","CE","NIT","TI","PP","IDC","CEL","RC","DE"],"description":"The 'legalIdType' field specifies the type of legal identification document used. Acceptable codes are: CC (Citizen ID) - CE (Foreign ID) - NIT (Tax Identification Number) - TI (Identity Card) -PP (Passport) - IDC (Identity Card) - CEL (Civil Registration) - RC (Civil Registry) - DE (Foreigner Identity Document). Choose the appropriate code corresponding to the user's identification document type"},"legalId":{"type":"string","example":"1234567890","description":"The 'legalId' field requires the actual identification number of the client as per the document type specified in the 'legalIdType' field. This should be a valid and current identification number."},"fullName":{"type":"string","example":"Juan Andres Rodríguez Sánchez","description":"The 'fullName' field should contain the complete legal name of the client as it appears on their official identification document. Include first name, middle name(s) if any, and last name."},"email":{"type":"string","example":"user@example.com","description":"The 'email' field requires the client's current email address. This should be a valid email format (e.g., user@example.com)."},"phone":{"type":"string","example":"3107894512","description":"The 'phone' field should contain the client's current telephone number, including the country and area codes if applicable. This number may be used for verification or contact purposes."}}},"transactionStatus":{"type":"string","enum":["STARTED","APPROVED","NOT_AUTHORIZED","FAILED","PENDING"],"description":"The 'transactionStatus' field indicates the current status of the transaction. Possible statuses are: STARTED: Transaction initiation is in progress. APPROVED: Transaction has been successfully authorized. NOT_AUTHORIZED: Transaction authorization failed. FAILED: Transaction could not be processed. PENDING: Transaction is pending resolution by the financial entity."},"status":{"type":"string","enum":["SUCCESS","ERROR"],"description":"The 'status' field indicates the overall outcome of an API action. It has two possible states: SUCCESS: The action was successfully completed. ERROR: The action encountered an issue and did not complete successfully. This field provides a quick reference to determine if the API operation was executed as intended."},"transaction":{"type":"object","properties":{"token":{"type":"string","example":"5D5FUukxXfA_M3mUUFd5iEn1rcPqVCp9YZWfc7t0RRZ8utZ0JhFqpH4rxeXP9_wLnjJllqpCvDBcJB70BuxxhmiVDJ0ZHNi3lDJkRw","description":"The 'token' field is a unique identifier generated after creating a transaction. This token is crucial for tracking, referencing, and managing the transaction throughout its lifecycle. Ensure the token is stored and used securely in subsequent operations related to the transaction."},"reference":{"type":"string","example":"123123123"},"status":{"$ref":"#/components/schemas/transactionStatus"},"amount":{"type":"number","example":1685100.0},"iva":{"type":"integer"},"description":{"type":"string"},"paymentMethod":{"$ref":"#/components/schemas/paymentMethod"},"originBank":{"type":"string","example":"BANCO CAJA SOCIAL","description":"The 'originBank' field specifies the originating bank for a transaction made using the PSE payment method. This should be the name or identifier of the bank from where the funds are being transferred. It is essential for processing and tracking the transaction within the PSE system."},"cycle":{"type":"integer","example":1,"description":"The 'cycle' field indicates the processing cycle assigned by the ACH entity for PSE payments. These cycles are categorized into ranges based on specific time frames and are numbered from 1 to 5. Each number corresponds to a distinct processing period within the day."},"cus":{"type":"string","example":"0987654321","description":"The 'cus' field is a unique tracking code or payment reference used within the bank for transactions made via the PSE platform. This code is essential for identifying and following up on specific PSE payments."},"installments":{"type":"integer","example":0,"description":"Indicates the number of installments in which the transaction payment is divided. A value of 1 indicates a single payment, while a larger number represents the total number of installments."},"cardBrand":{"type":"string","example":null,"description":"Represents the brand of the card used in the transaction. This field identifies the credit or debit card company (such as Visa, MasterCard, American Express, etc.)."},"network":{"type":"string","example":null,"description":"Identifies the network or processing system through which the transaction is conducted, such as Credibanco. This field is essential for determining the processing route and for tracking the transaction through the respective payment system."},"networkAuthorizationNumber":{"type":"string","example":null,"description":"This is the authorization number generated by the network or processing system (like Credibanco) for the transaction. It serves as a unique identifier for the transaction's authorization and is a key component for the verification and tracking of the transaction."},"startDate":{"type":"string","example":"2023-11-20T06:16:07","description":"The 'startDate' field specifies the LocalDateTime marking the start of the payment process. It Represents the exact date and time when the transaction begins."},"endDate":{"type":"string","example":"2023-11-20T06:17:12","description":"The 'endDate' field indicates the LocalDateTime when the payment is confirmed."},"accountingDate":{"type":"string","example":"2023-11-21","description":"The 'accountingDate' field is a LocalDate used for accounting purposes by the client, signifying a date relevant for financial records."},"redirectUrl":{"type":"string","example":"https://test.abcpagos.com/PSE/paymentProcessor?id_transaccion=123456","description":"The 'redirectUrl' field is the URL to which a user should be redirected post-transaction creation. This URL could return one error, if the reference exists and has been processed or it has started a transaction previously with the same reference."}}}}}}