{"openapi":"3.0.0","info":{"version":"1.1.0","title":"ACBrTEF API","description":"API para interação com ACBrTEF"},"servers":[{"url":"http://{host}:{port}/{version}","variables":{"host":{"default":"localhost"},"port":{"default":"9000"},"version":{"default":"v1"}}}],"paths":{"/config":{"get":{"description":"Returns the actual Configuration","responses":{"200":{"description":"Returns the actual Configuration","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Configuration"}}}}}},"post":{"description":"Save or Update the Configuration. Every item in the Body is optional:\nwhatever is omitted keeps its currently configured value, there is no\nneed to send the whole object for a partial update.","parameters":[{"name":"save","in":"query","description":"If True, save the new configuration to disk","required":false,"schema":{"type":"boolean","default":true}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Configuration"}}}},"responses":{"201":{"description":"Configuration Saved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Configuration"}}}},"202":{"description":"Configuration Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Configuration"}}}},"400":{"description":"Invalid Body Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/files":{"get":{"description":"Returns the full path for the Files in use by the API","responses":{"200":{"description":"Returns the full path for the Files in use by the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Files"}}}}}}},"/status":{"get":{"description":"Returns the current Service Status","responses":{"200":{"description":"Returns the current Service Status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Status"}}}}}},"post":{"description":"Starts or Stops the EFT and/or the HTTP Server, according to the\nitem(s) informed in the Body. 'eftInited' and 'httpInited' are\nindependent and optional: inform only what you want to change, the\nomitted item keeps its current state.\n\nWarning: sending \"httpInited\": false on a request that arrives\nthrough the HTTP Server itself will bring down the Server that is\nhandling that same request.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Status"}}}},"responses":{"200":{"description":"Status Updated, returns the current Service Status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Status"}}}},"400":{"description":"Invalid Body Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/operation":{"post":{"description":"Starts a EFT Operation","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionDataInput"}}}},"responses":{"206":{"description":"EFT Operation Started","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandFlow"}}}},"400":{"description":"Invalid Body Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"406":{"description":"EFT Library Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"EFT operation already started","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"description":"Continues a EFT Operation Flow","parameters":[{"name":"flow","in":"query","required":false,"description":"Direction for EFT flow, 1-Continue, 0-Cancel, -1-Back","schema":{"type":"integer","default":1}},{"name":"lastResponse","in":"query","required":false,"description":"The captured Response from Last Flow Step","schema":{"type":"string"}},{"name":"validated","in":"query","required":false,"schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"EFT Operation finished and successfully approved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionDataOutput"}}}},"206":{"description":"EFT Operation next Step Flow","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandFlow"}}}},"401":{"description":"EFT Operation finished successfully but not approved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionDataOutput"}}}},"406":{"description":"EFT Library Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"408":{"description":"EFT Operation TimeOut","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"412":{"description":"Wrong sequence call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"499":{"description":"EFT Operation Canceled by Operator","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"description":"Abort a running Operation. Useful to abort Operation when EFT is waiting for user interaction on PinPad","responses":{"406":{"description":"EFT Library Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"EFT transaction was aborted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionDataOutput"}}}},"412":{"description":"Wrong sequence call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/resolve":{"post":{"description":"Confirm or Undo the a Pending Transction","parameters":[{"name":"transactionUniqueId","in":"query","required":true,"description":"A unique Identifier generated by the POS Application for this transaction.","schema":{"type":"string"}},{"name":"status","in":"query","required":true,"schema":{"$ref":"#/components/schemas/OperationStatus"}}],"responses":{"200":{"description":"EFT Pending transaction was Resolved"},"400":{"description":"Invalid Params","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Informed transaction not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"406":{"description":"EFT Library Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"Exception":{"type":"string","description":"Class Exception Error"},"Message":{"type":"string","description":"Error Messaga"}}},"OperationType":{"type":"string","nullable":false,"enum":["tefopNenhuma","tefopPagamento","tefopAdministrativo","tefopTesteComunicacao","tefopVersao","tefopFechamento","tefopCancelamento","tefopReimpressao","tefopPrePago","tefopPreAutorizacao","tefopConsultaSaldo","tefopConsultaCheque","tefopPagamentoConta","tefopRelatResumido","tefopRelatSintetico","tefopRelatDetalhado"]},"OperationStatus":{"type":"integer","nullable":false,"description":"Used on /resolve endpoint. Describe the final Status for a Pending Transaction 0 - Automatic Success, 1 - Manual Success, 2 - Printing Error, 3 - Dispenser Error, 4 - Miscellaneous Error","enum":[0,1,2,3,4]},"CardType":{"type":"string","nullable":true,"enum":["teftcNaoDefinido","teftcCredito","teftcDebito","teftcVoucher","teftcFrota","teftcPrivateLabel","teftcOutros"]},"FinancingType":{"type":"string","nullable":true,"enum":["tefmfNaoDefinido","tefmfAVista","tefmfParceladoEmissor","tefmfParceladoEstabelecimento","tefmfPredatado","tefmfCreditoEmissor"]},"PaymentMode":{"type":"string","nullable":true,"enum":["tefmpNaoDefinido","tefmpCartao","tefmpDinheiro","tefmpCheque","tefmpCarteiraVirtual"]},"WalletUserIdType":{"type":"string","nullable":false,"enum":["wuidOutro","wuidQRCode","wuidCPF"]},"TransactionDataInput":{"type":"object","required":["operation","transactionPosId"],"properties":{"operation":{"$ref":"#/components/schemas/OperationType"},"operationId":{"type":"string","description":"operationId, if informed API will use it instead of 'operation'"},"transactionPosId":{"type":"string","description":"A unique Identifier generated by the POS Application for this transaction."},"amount":{"type":"integer","description":"Operation value. Mandatory if the operation is of the 'tefopPagamento' or 'tefopCancelamento', last 2 digits are decimal"},"currencyCode":{"type":"integer","description":"Currency code, according to ISO4217. Mandatory if the operation has the “amount” parameter.","default":986},"boardingTax":{"type":"integer","description":"Boarding Tax (optional), last 2 digits are decimal"},"serviceTax":{"type":"integer","description":"Service Tax (optional), last 2 digits are decimal"},"provider":{"type":"string","description":"The EFT Provider Code or Short Name"},"cardType":{"$ref":"#/components/schemas/CardType"},"finType":{"$ref":"#/components/schemas/FinancingType"},"paymentMode":{"$ref":"#/components/schemas/PaymentMode"},"installments":{"type":"integer","default":1,"description":"Number of instalments, used when 'finType' is 'tefmfParceladoEmissor' or 'tefmfParceladoEstabelecimento'"},"predatedDate":{"type":"string","format":"date"},"taxId":{"type":"string","description":"The merchant Tax ID (Brazilian CNPJ)"},"billNumber":{"type":"string","description":"Document Code number from Bank, for  Bill Payment in Admin transactions"},"phoneNumber":{"type":"string","description":"The phone number for Admin Recharge transactions"},"posId":{"type":"string","description":"The Point of capture number by EFT provider"},"originalAuthorizationCode":{"type":"string","description":"The original transaction authorization code, for 'tefopCancellation' operations"},"originalTransactionDateTime":{"type":"string","format":"date-time","description":"The Original Transaction Date & Time, for 'tefopCancellation' operations"},"originalTransactionUniqueId":{"type":"string","description":"The Original Transaction Unique Id, for 'tefopCancellation' operations"},"additionalPosData1":{"type":"string","description":"Additional data relevant to automation - 1"},"additionalPosData2":{"type":"string","description":"Additional data relevant to automation - 2"},"additionalPosData3":{"type":"string","description":"Additional data relevant to automation - 3"}}},"CommandType":{"type":"string","nullable":false,"enum":["tefcmdNenhum","tefcmdExibirMensagem","tefcmdExibirAlerta","tefcmdExibirQRCode","tefcmdPerguntarMenu","tefcmdPerguntarCampo","tefcmdLerCodBarras"]},"InputDataType":{"type":"string","nullable":false,"description":"Input Chars allowed","enum":["tedApenasLeitura","tedTodos","tedNumerico","tedAlfabetico","tedAlfaNum"]},"DataValidation":{"type":"string","nullable":false,"description":"Validation routine","enum":["valdNenhuma","valdNaoVazio","valdDigMod10","valdCPF","valdCNPJ","valdCPFouCNPJ","valdMesAno","valdDiaMesAno","valdDuplaDigitacao","valdSenhaGerente","valdSenhaLojista","valdSenhaTecnica"]},"BarCodeInputMode":{"type":"string","nullable":false,"description":"Used only when 'command' is 'cmd_ask_barcode'","enum":["tbQualquer","tbDigitado","tbLeitor"]},"DisplayOutput":{"type":"string","nullable":false,"description":"Indicate the monitor Screen to show the message","enum":["telaTodas","telaOperador","telaCliente"]},"CommandFlow":{"type":"object","required":["command"],"properties":{"commandStep":{"type":"integer","description":"Command interaction number, used for GET synchronization"},"command":{"$ref":"#/components/schemas/CommandType"},"title":{"type":"string","description":"Content of Message or QRCode Data or Title of Question Window or Menu"},"display":{"$ref":"#/components/schemas/DisplayOutput"},"menuItems":{"type":"array","items":{"type":"string"}},"mask":{"type":"string","description":"Mask for data capture"},"inputDataType":{"$ref":"#/components/schemas/InputDataType"},"maxLen":{"type":"integer","description":"Maximum character size for strings input. If it is -1 ignore it"},"minLen":{"type":"integer","description":"Minimum character size for strings input. If it is -1 ignore it"},"valMax":{"type":"integer","description":"Maximum Value for numeric input. If it is -1 ignore it, last 2 digits are decimal"},"msgValMaxError":{"type":"string","description":"error message to show, if inputted  Value is greater than 'valMax'"},"valMin":{"type":"integer","description":"Minimun Value for numeric input. If it is -1 ignore it, last 2 digits are decimal"},"msgValMinError":{"type":"string","description":"error message to show, if inputted  Value is less than 'valMin'"},"hideInput":{"type":"boolean","default":false,"description":"If True dont echo typed chars"},"dataValidation":{"$ref":"#/components/schemas/DataValidation"},"msgValidationError":{"type":"string","description":"error message to show, if validation fails"},"titleRetype":{"type":"string","description":"Title to show, when Retyping and for satisfy 'dataValidation' is 'valRetype'"},"nullable":{"type":"boolean","default":false},"initialValue":{"type":"string","description":"Initial prompt Value. To allow the operator just confirm it"},"shortCut":{"type":"boolean","description":"If 'true', should use Short cut keys when 'command' is 'cmd_ask_options'"},"barCodeInputMode":{"$ref":"#/components/schemas/BarCodeInputMode"},"autoCloseTime":{"type":"integer","description":"Time in Milliseconds, to automatically close a alert message when 'command' is 'cmd_show_alert'. Ignore if it is -1","default":-1}}},"TransactionDataOutput":{"type":"object","required":["operation"],"properties":{"transactionPosId":{"type":"string","description":"A unique Identifier generated by the POS Application for this transaction."},"transactionResult":{"type":"string","description":"Transaction Result Code"},"resultMessage":{"type":"string","description":"Message with description of the result."},"authorizerResponse":{"type":"string","description":"Response code of the transaction, coming from the acquiring network."},"amount":{"type":"integer","description":"Operation value. Mandatory if the operation is of the 'tefopPagamento' or 'tefopCancelamento', last 2 digits are decimal"},"currencyCode":{"type":"integer","description":"Currency code, according to ISO4217. Mandatory if the operation has the “amount” parameter.","default":986},"requiresConfirmation":{"type":"boolean","description":"If 'true' a call to /resolve endpoint, must be done"},"transactionUniqueId":{"type":"string","description":"Transaction Unique Id, to inform as parameter in /resolve endpoint"},"cashbackAmount":{"type":"integer","description":"Cash back, if it occurred on transaction, last 2 digits are decimal"},"discountAmount":{"type":"integer","description":"Discount Amount, if it occurred on transaction, last 2 digits are decimal"},"balanceVoucher":{"type":"integer","description":"Balance of the voucher card, last 2 digits are decimal"},"dueAmount":{"type":"integer","description":"Due Amount, last 2 digits are decimal"},"fiscalDocument":{"type":"string","description":"A Fiscal Document number, define by POS Application for this transaction."},"transactionNsu":{"type":"string","description":"Provider NSU number for this transaction"},"terminalNsu":{"type":"string","description":"EFT NSU number for this transaction"},"authorizationCode":{"type":"string","description":"Provider Authorization Code for this transaction"},"merchantId":{"type":"string","description":"The Merchant Id on EFT environment"},"merchantName":{"type":"string","description":"The Merchant Name on EFT environment"},"posId":{"type":"string","description":"The Point of capture number by EFT provider"},"transactionDateTime":{"type":"string","format":"date-time"},"installments":{"type":"integer","default":1,"description":"Number of instalments, informed on transaction"},"predatedDate":{"type":"string","format":"date"},"finType":{"$ref":"#/components/schemas/FinancingType"},"provider":{"type":"string","description":"The EFT Provider Code or Name"},"providerName":{"type":"string","description":"The EFT Provider Full Name"},"cardType":{"$ref":"#/components/schemas/CardType"},"cardEntryMode":{"type":"string","description":"Card entry mode"},"maskedPan":{"type":"string","description":"Card number, truncated or masked."},"defaultMaskedPan":{"type":"string","description":"Masked card number in the format BIN + *** + 4 last digits Ex 543211 ****** 9876"},"cardholderVerificationMode":{"type":"string","description":"Password verification mode."},"cardName":{"type":"string","description":"Name of the card or card issuer."},"defaultCardName":{"type":"string","description":"Product description standard flag related to BIN."},"cardholderName":{"type":"string","description":"Cardholder name used."},"aid":{"type":"string","description":"Card application used during the transaction."},"printReceipts":{"type":"integer","default":0,"description":"Recipts Included; 0-None, 1-Costumer, 2- Merchant, 3-Both"},"fullReceipt":{"type":"array","items":{"type":"string"},"description":"Full Receipt, one line per array item"},"merchantReceipt":{"type":"array","items":{"type":"string"},"description":"The Merchant Receipt, if it doesn't exist use \"fullReceipt\""},"cardholderReceipt":{"type":"array","items":{"type":"string"},"description":"Differentiated Receipt for the card holder, if it doesn't exist use \"fullReceipt\""},"shortReceipt":{"type":"array","items":{"type":"string"},"description":"Reduced Receipt for the card holder, if it doesn't exist use \"cardholderReceipt\""},"graphicReceiptExists":{"type":"boolean","description":"Indicates the existence of graphic Receipt format."},"merchantGraphicReceipt":{"type":"string","description":"The Graphic Merchant Receipt"},"cardholderGraphicReceipt":{"type":"string","description":"The Graphic Card Holder Receipt"},"pendingTransactionExists":{"type":"boolean","description":"Indicates the existence of a pending transaction."},"originalTransactionAmount":{"type":"integer","description":"If there is a Pending Transacation, this is the original amount, last 2 digits are decimal"},"originalTransactionDateTime":{"type":"string","format":"date-time","description":"If there is a Pending Transacation, this is the original date time"},"originalAuthorizationCode":{"type":"string","description":"If there is a Pending Transacation, this is the original authorization code"},"originalTransactionUniqueId":{"type":"string","description":"If there is a Pending Transacation, this is the original Unique Id for it"},"paymentMode":{"$ref":"#/components/schemas/PaymentMode"},"walletUserId":{"$ref":"#/components/schemas/WalletUserIdType"}}},"Status":{"type":"object","description":"Current Service Status. On POST, informs the desired state:\nevery item is optional, whatever is omitted keeps its current state\ninstead of being Started/Stopped.","properties":{"eftInited":{"type":"boolean","description":"Whether the EFT is initialized. On POST, the desired state for the EFT"},"httpInited":{"type":"boolean","description":"Whether the HTTP Server is active (absent on the LIB build). On POST, the desired state for the HTTP Server"},"startedAt":{"type":"string","format":"date-time","description":"When the Service was started","readOnly":true},"uptimeSeconds":{"type":"integer","description":"Seconds elapsed since the Service was started","readOnly":true}}},"ApplicationConfig":{"type":"object","description":"Configuração da Sw.House e das características do Programa de Automação Comercial","required":["appName","appVersion","appDeveloperName","appDeveloperTaxId"],"properties":{"appName":{"type":"string","description":"Point of Sale Application Name"},"appVersion":{"type":"string","description":"Application Version"},"appDeveloperName":{"type":"string","description":"Application producer Name"},"appDeveloperTaxId":{"type":"string","description":"Application producer Tax ID (Brazilian CNPJ)"},"appParams":{"type":"string","description":"Additional Application Parameters (free format, optional)"},"allowCashback":{"type":"boolean","description":"Indicates whether Automation supports CashBack functionality.","default":false},"allowDiscount":{"type":"boolean","description":"Indicates whether Automation supports Discount functionality.","default":false},"allowDueAmount":{"type":"boolean","description":"Indicates whether Automation supports the use of the total voucher balance to discount the purchase amount.","default":false},"useShortReceipt":{"type":"boolean","description":"Indicates whether Automation prefers a Short Receipt for customer","default":false},"isSelfChekout":{"type":"boolean","description":"Indicates whether Automation runs in a Self CheckOut environment","default":false},"currencyCode":{"type":"integer","description":"Currency code, according to ISO4217.","default":986},"pinPadMessage":{"type":"string","description":"Message to be shown on the PinPad (optional)"},"language":{"type":"integer","description":"0 - Portugues, 1 - Ingles, 2 - Espanhol","default":0}}},"MerchantConfig":{"type":"object","description":"Shopkeeper information","required":["taxId","companyName"],"properties":{"taxId":{"type":"string","description":"Merchant Tax ID (Brazilian CNPJ)"},"companyName":{"type":"string","description":"Merchant Social Name"}}},"TerminalConfig":{"type":"object","description":"EFT Terminal Configuration","required":["eftTerminalCode"],"properties":{"environment":{"type":"integer","description":"0 - Developer, 1 - Production","default":0},"serverAddress":{"type":"string","description":"EFT provider Server Address (optional, provider dependent)"},"eftMerchantCode":{"type":"string","description":"The Merchant Code assigned by the EFT provider (not used by PayGo)"},"eftStoreCode":{"type":"string","description":"The Store Code assigned by the EFT provider (not used by PayGo)"},"eftTerminalCode":{"type":"string","description":"The Point of Capture code assigned by the EFT provider for this machine"},"eftParams":{"type":"string","description":"Additional EFT Parameters (free format, provider dependent)"},"operatorLogin":{"type":"string","description":"The Operator Login Name (not used by PayGo)"},"password":{"type":"string","description":"The Operator/Terminal Password (provider dependent, optional)"},"pinPadPort":{"type":"integer","description":"The PinPad Serial Port number (0 = autodetect)","default":0},"pathWorkFolder":{"type":"string","description":"Work folder used by the EFT Library (optional)"}}},"Configuration":{"type":"object","description":"ACBrTEF API Configuration. Every top-level and nested item is optional\non POST: whatever is omitted keeps its currently configured value.","properties":{"applicationConfig":{"$ref":"#/components/schemas/ApplicationConfig"},"merchantConfig":{"$ref":"#/components/schemas/MerchantConfig"},"terminalConfig":{"$ref":"#/components/schemas/TerminalConfig"},"eftModel":{"type":"integer","description":"The EFT Model from ACBrTEFAPI:\n0 - tefApiNenhum, 1 - tefApiPayGoWeb, 2 - tefApiCliSiTEF, 3 - tefApiElgin,\n4 - tefStoneAutoTEF, 5 - tefAditumAPI, 6 - tefScopeAPI, 7 - tefDestaxaAPI,\n8 - tefTPag, 9 - tefEquals, 10 - tefDirectPin, 11 - tefTXT, 12 - tefAuttar","default":0},"timeOut":{"type":"integer","description":"Milliseconds to TimeOut the Operation Flow","default":30000},"logLevel":{"type":"integer","description":"Log Level, 0 - No Log, 1 - Basic, 2 - Complete, 3 - Paranoic","default":2},"qrCodeDisplay":{"type":"integer","default":1,"description":"Where QRCode should be displayed:\n0 - Not Supported, 1 - Auto (try PinPad first), 2 - PinPad, 3 - Application"},"confirmTransactionsAutomatically":{"type":"boolean","default":true,"description":"If True, Transacations will be confirmed automatically"},"confirmPendingTransactionsAutomatically":{"type":"boolean","default":false,"description":"If True, Pending Transactions will always be confirmed automatically"},"tcpPort":{"type":"integer","default":9000,"description":"ACBrTEF API TCP port to listen"},"useSSL":{"type":"boolean","default":false,"description":"If True, the HTTP Server will require HTTPS (TLS)"},"threadSleep":{"type":"integer","default":10,"description":"Sleep time, during Threads Waiting loop"}}},"Files":{"type":"object","description":"Full Path for Files in use for TEF API","properties":{"config":{"type":"string","description":"Config File"},"log":{"type":"string","description":"The actual Log File"}}}}}}