WebPOS - XML Specifications - Electronic Invoice Panama V9
WebPOS - XML Specifications - Electronic Invoice Panama V9
INVOICE PANAMA
9
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
This manual and the technical information contained in this document is protected under international
copyright laws. It is only allowed to use it under the authorization of WebPOS for the integration of
client systems with fiscal printers or the electronic invoice system of Panama, using WebPOS products.
The use of this information to copy, reverse engineer, or develop products, using this information, that
compete with WebPOS products is prohibited.
Page | 2
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
Contents
Vesion log .................................................................................................................................................. 5
Introduction .............................................................................................................................................. 6
Supported formats .................................................................................................................................... 8
Description of the WebPOS XML Structure ................................................................................................ 9
Description of each of the XML elements: ............................................................................................. 9
Xml file declaration: .......................................................................................................................... 9
XML file with a single document: ....................................................................................................... 9
XML file with multiple documents to process: ................................................................................... 9
XML format description table .............................................................................................................. 10
Examples of documents with the XML structure. .................................................................................... 16
XML example for an Invoice document. ............................................................................................. 16
XML example for a Credit Note document. ........................................................................................ 18
XML example for a Debit Note document. ......................................................................................... 19
XML example with multiple documents contained in it. .................................................................... 20
Send Methods ......................................................................................................................................... 22
API RESTful .......................................................................................................................................... 22
WebService SOAP ................................................................................................................................ 22
Shared Folder ...................................................................................................................................... 22
Note: Files must be saved using the UTF-8 encoding ....................................................................... 22
Filenames for the sending methods: FTP, Email, Shared Folder: ...................................................... 22
FTP over TLS......................................................................................................................................... 23
Email .................................................................................................................................................... 23
Sending WebPOS format XML files through an email account that is monitored by the WebPOS
service. ................................................................................................................................................ 23
Direct Database ................................................................................................................................... 23
Return values........................................................................................................................................... 24
• WebService SOAP........................................................................................................................ 24
• API RESTful .................................................................................................................................. 24
• Archivo de resultado en carpeta centralizada en un servidor..................................................... 24
• FTPS ............................................................................................................................................. 24
Page | 3
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
Page | 4
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
Vesion log
Version Publication date Changes
1 2022-03-01 Initial versión
6 2022-04-26 APIs revised
7 2022-05-05 CUFE length 66 characters
8 2022-01-28 Se adicionan campos para informar los totales
Retenciones
Tipos de pago e información de cuotas en Nodo FEPA
9 2023-06-01 Update of agreement technical sheet of Panama.
Page | 5
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
Introduction
The WebPOS integration solution allows you to integrate your ERP system with the electronic invoice
system of Panama and other countries in the region such as the Dominican Republic, Ecuador, Costa Rica,
quickly and reducing the programming and development effort by up to 90%. %. Once the integration has
been carried out for a country, it is possible to replicate the development and, with small variations,
comply with the regulations in another country.
Another benefit is that it allows you to change from the fiscal printer scheme to an electronic invoice in
an orderly and gradual manner.
Our electronic invoice interface is in charge of receiving the information from your system in a simplified
way and transforming it to the specifications of the government, applying the electronic signature and
sending it, following the established security parameters, complying with all the requirements. of the
electronic invoicing system implemented in the country.
Glossary:
Page | 6
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
Azure DC
Azure
ActivityLog Alerts Monitoring
WebPOS FE Solution
@ Oracle Cloud
Page | 7
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
Supported formats
Our platform supports the following formats:
This manual focuses on the WebPOS XML format. If you wish to explore another format, you can
request the corresponding manual.
Note: You need to choose a format to integrate your system and the delivery method to communicate
with the interface.
Page | 8
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
</Range>
Note: Upper and lower case letters must be respected, as they are expressed in this manual. In XML
nomenclature, data containing any of the following characters must be handled and replaced by the
corresponding string:
& must be replaced by & (including the semicolon at the end)
“ must be replaced by "
< must be replaced by <
> must be replaced by >
In general, the data that can have these special characters are: CustomerName, CustomerRUC,
CustomerAddress, AddInfo, Item Desc, Item Comments.
Page | 9
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
FX=Export invoice
FI= Import invoice
FP= Local purchase Invoice
FZ=Free Zone Invoice
FY=Foreing Operation Invoice
<DocNumber>100001</DocNumber> Mandatory Alphanumeric 30 System document number. This
number will become the system
reference number. The E.I. sequence
number will be handled by the
interface and will be mapped to this
number.
<InvoiceNumber>100001</InvoiceNumber> Optional Alphanumeric 30 If it is not included, a Generic Credit
if the or Debit Note will be generated.
document is Only for type C or D documents.
credit or debit Invoice number affected by the
note credit or debit note. The system will
look for the CUFE number registered
in the system. If it is a fiscal printer
invoice, you must enter the
complete fiscal number and the date
in the following field
InvoiceNumberRefDate.
<InvoiceNumberRefDate>yyyy-MM-dd Mandatory Fecha Only for type C or D documents.
HH:mm:ss</InvoiceNumberRefDate> if the affected Date of the affected invoice
reference
invoice was
not issued by
Page | 10
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
the SFEP
system
<DocDate>2018-05-25 20:30:00</DocDate> Optional Date of the Fecha de emisión en formato yyyy-
document MM-dd HH:mm:ss. Si no se envía se
toma la fecha y hora de recepción.
<CustomerName>COSUMIDOR FINAL</CustomerName> Mandatory Alphanumeric 150 The value within this element is
Optional for consumer invoices and
Mandatory for all other document
types. It must contain the company
name of the byer.
<CustomerRUC></CustomerRUC> Mandatory Alphanumeric 26 It must contain the RUC, Tax ID, VAT
if it is not a ID or personal ID of the buyer. The
final consumer DV is not necessary since the Ruc
invoice will be validated and the DV will be
brought. This field can be left empty
for end consumer invoices.
If DocType=FP ,customerType
should be 07
<CustomerAddress>Punta Optional/Man Alphanumeric 100 Buyer's address, it is Optional for
Pacifica</CustomerAddress> datory end consumer invoices and
depending of Mandatory for the other types.
type
<CustomerLocationCod>8-8-8<CustomerLocationCod> Optional Alphanumeric 20 Panamanian location code.
(Optional)
<Email>[email protected]</Email> Optional Alphanumeric 150 Buyer's email. To send your
electronic invoice. Supports
Page | 11
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
up to 3 emails separated by
commas.
<FePa> Optional Section for additional fields
of SFEP.
<iNatOp>1</iNatOp> Mandatory for Integer 1 Mandatory for Free Zone Invoices
Free Zone And it can have the following values:
Invoices Accepted 1 Sale
values 2 Export
1: Venta 3 Re-Export
Mandatory for 2: Exportación 4 Foreign Source Sale
Foreign 3: Re-
Transaction exportación, Mandatory for Foreign Transaction
Invoices 4: Venta de Invoices
fuente And it can have the following values:
extranjera 4 Foreign Source Sale
10:
Transferencia/T
raspaso
11: Devolución
12:
Consignación
13: Remesa
14: Entrega
gratuita
20: Compra
21: Importación
Page | 12
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
</PagPlazos>
</FePa> Close the FePa section
<AddInfo> Optional Open additional information section.
<Line Id=”1”>Pedido:12345</Line> Optional Alphanumeric 100 Additional Information Line
<Line Id=”2”>Vendedor:01</Line> Optional Alphanumeric 100 Additional Information Line
</AddInfo> Up to 50 lines of 100
characters each
<Items> Mandatory Invoice detail section
<Item Code=”100001” Qty=”1.00” Desc=”Product Mandatory Item element attributes:
Description” Price=”10.50” Tax=”2”
Comments=”Additional description” dperc=”10%” Id: Line sequence number.
damt=”0” bcode=”” Cat1Code=”4000” /> Code:Code for products or service
Qty :quantity. Uo to 6 decimals.
<Item … /> Desc:Description (up to 500
<Item … /> characters).
<Item … /> Price:Unit price. up to 6 decimals.
Page | 13
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
Page | 14
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
01=sale to representative
02=sale to final consumer
03=sale to government
04=vehicle fleet sale
99=other
VhModOpDesc: description if
VhModOp is equals to 99 (others).
(10 a 50 characters)
VhVin: VIN of the vehicule (17
characters)
VhColorCod: internal code of the
manufacturer color of the vehicle. (1
to 4 characters)
VhFuel: fuel type.
01=gasoline
02=diesel
03=ethanol
08=electric
09=gasoline/electric
99=other
VhFuelDesc=fuel description if
VhFuel is 99.
VhMotorNbr: motor number. 1 to
21 characters.
VhType:
1=motorcycle
2=bus,
3=truck,
4=sedan,
5=truck,
6=pickup,
7. Mini Pick-Up,
8. Pick Up Grua,
9. Pick Cabina Sencilla,
10. Pick Up Cabina y Media,
11. Pick- Up Doble Cabina,
12. Sedan Híbrido,
13. Microbus,
14. Mini Bus,
15. Mini Microbus,
16. Busito,
17. Hatcback,
18. Mini Panel,
19. Panel,
20. Convertible,
21. Coupe,
22: Coupe Convertible,
23. Mini Car,
24. Motorscooter,
25. Mototriciclo;
26. Scooter,
27. Triciclo,
28. Limosina,
29. Mini Vans,
30. Van,
31. Trailer,
Page | 15
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
VhUse:
1=commercial,
2=private,
3= Diplomatica,
4=Oficial,
5: Especial
Page | 16
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
<POSCod>001</POSCod>
<DocType>F</DocType>
<DocNumber>10001</DocNumber>
<CustomerName>Cliente X & Y</CustomerName>
<CustomerRUC>111111-1-111111 DV00</CustomerRUC>
<CustomerType>04</CustomerType>
<CustomerAddress>San Francisco</CustomerAddress>
<Email>[email protected]</Email>
<AddInfo>
<Line Id="1">Numero de pedido: 12345</Line>
<Line Id="2">Entrega en sitio</Line>
</AddInfo>
<Items>
<Item Id="1" Qty="10.00" Code="P001" Desc="Producto ITBMS 7%" Price="10.0000" Tax="1" Com
ments="La propiedad price es precio unitario" dperc="10%" bcode="" />
<Item Id="2" Qty="10.00" Code="P002" Desc="Producto ITBMS 0% Exento" Price="10.0000" Tax=
"0" Comments="El descuento se aplica por % o por monto total de descuento son excluyentes" dam
t="20.00" bcode="" />
</Items>
<Discount amt="0.00" perc="00.00%" />
<Payments>
<Payment Id="1" type="01" amt="176.30" Desc1="EFECTIVO" />
</Payments>
<Trailer>
<Line Id="1">Información al final</Line>
<Line Id="2">Información al final</Line>
</Trailer>
</FiscalDoc>
Page | 17
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
Page | 18
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
Page | 19
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
Page | 20
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
<CustomerAddress>San Francisco</CustomerAddress>
<Email>[email protected]</Email>
<AddInfo>
<Line Id="1">Numero de pedido: 12345</Line>
<Line Id="2">Entrega en sitio</Line>
</AddInfo>
<Items>
<Item Id="1" Qty="10.00" Code="P001" Desc="Producto ITBMS 7%" Price="10.0000" Tax="1" Com
ments="La propiedad price es precio unitario" dperc="10%" bcode="" />
<Item Id="2" Qty="10.00" Code="P002" Desc="Producto ITBMS 0% Exento" Price="10.0000" Tax=
"0" Comments="El descuento se aplica por % o por monto total de descuento son excluyentes" dam
t="20.00" bcode="" />
</Items>
<Discount amt="0.00" perc="00.00%" />
<Payments>
<Payment Id="1" type="01" amt="176.30" Desc1="EFECTIVO" />
</Payments>
<Trailer>
<Line Id="1">Información al final</Line>
<Line Id="2">Información al final</Line>
</Trailer>
</FiscalDoc>
</Range>
Note: Only use the multiple file format for batch operations.
Page | 21
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
Send Methods
There are different shipping methods available such as:
• API RESTful
• Webservice SOAP
• Shared folder
• FTPS
• Email
• Database: direct connection to: MSSQL, Oracle, MySQL, AS400, SQLite, Informix, DB2, etc.
API RESTful
The Rest API methods are provided by the "WebPOS Cloud APIs" platform and allow the use of POST
methods to send invoice files in XML, JSON, SAP iDoc XML and TXT formats. Additionally GET methods to
download transformed and signed XML, PDF, QR of electronic invoice and return values.
- OAUTH 2.0
- ApiKey
If you are thinking of sending via web services to our Cloud, we recommend API REST since it is the latest
technology and the latest security standards are implemented.
WebService SOAP
As described above, except that legacy SOAP messages are used and in each call it is necessary to send
the credentials to validate access to the system.
If you decide on this method for sending XMLs, please check the WSDL in https://fepatest-
api.webposonline.com/wsfepa.asmx
Shared Folder
Sending WebPOS format XML files to a local folder on your premises.
Page | 22
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
• Hyphen
• Serial: 0001001. The serial is made up of the branch code (4 characters) 0001, followed
by the code of the issuing point in the branch (3 characters) 001. For example, for
branch number 2 and issuing point 3 within the branch, it would be: 0002003.
• Hyphen
• Document number: It is the number of the invoice, credit note or debit note in your
system.
• Extension xml
For example:
F-0001001-10000.xml
Email
Sending WebPOS format XML files through an email account that is monitored by the WebPOS service.
Direct Database
Allows the reading of transactions through a view of the database (Header, Detail, Forms of Payment) of
your system through the WebPOS DB Connector tool which allows you to connect to any type of MS SQL
database, Oracle, MySQL, AS400, DB2, Informix, etc. And execute SQL commands for reading and
INSERT or UPDATE commands for writing the returns.
Page | 23
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
Return values.
There are several ways to obtain the return values, the developer must decide which of them is the one
that best suits the needs:
• WebService SOAP: to consult the return structure, PDF of fiscal printer or electronic
invoice, signed XML for the case of FE, QR content and image for the case of FE.
• API RESTful: the GetResultFe method is consumed for electronic invoice to get the results.
The URLs for the API environments are defined in the RESTful API section.
• Archivo de resultado en carpeta centralizada en un servidor: For this
option, a WebPOS service is installed on a server that performs the downloads and stores the
result files in a folder. One for each document, following the nomenclature described above.
• FTPS: files can be sent to FTP securely using TLS 1.2.
• Base de datos: Direct write or update to MSSQL, Oracle, AS400, MySQL, Informix, DB2, etc.
databases. A WebPOS service is installed that downloads the results and executes SQL
commands to write or update a table in the database.
• WebHook: are configurable events that are fired to call a SOAP or Http POST method in real
time with the response JSON or XML format. This allows the integration of applications in real
time that require the result of the electronic invoice. Only calls to methods that are under
secure protocol HTTPS TLS are allowed.
Page | 24
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
Page | 25
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
validation or check
IssuedType 2 or 4
Contingency
ConfirmationNbr string 9 9-digit random This is a random
confirmation number number that is
assigned for
security as part
of the CUFE
DgiResp string NVARCHAR(MAX) Response of the validation
with the PAC service
Msg string NVARCHAR(MAX) Additional messages
wasDuplicated bool If the systemRef already
exists in the WebPOS
Database and it is not
rejected
IssuedType integer 1 Type of issue: Normal or 1: Normal
in contingency Contributor
2: Contingency
Contributor
3: Normal end
consumer
4: Contingency
end consumer
XmlFeSigned string NVARCHAR(MAX) Xml transformed signed
QrContent string NVARCHAR(1024) QR contento f the E.I.
QrB64 string NVARCHAR(MAX) QR Image in base 64 string
Base 64
DgiErrMsg string NVARCHAR(MAX) Error messages results of
the validation
PrintInfo Object Special object to obtain This field will be
the text of a receipt only present if
formatted at 48 columns. the customer
(retail) request that.
ExecTime long Time of execution
miliseconds
Page | 26
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
Page | 27
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
WebServices SOAP
The format used for SOAP is XML. The response from the Web methods will also be returned in XML.
The security used for this type of message is the use of the WebPOS license key and an ApiKey. The Api
Key can be managed or changed by the user in the WebPOS portal.
WSDL:
https://fepa-api.webposonline.com/wsfepa.asmx?wsdl
Page | 28
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
Sample SendFileToProcess:
Page | 29
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
</FiscalDoc>]]></fepa:fileStr>
</fepa:data>
</fepa:SendFileToProcess>
</soapenv:Body>
</soapenv:Envelope>
Please check the link https://fepatest-api.webposonline.com/wsfepa.asmx for the full list of methods.
Page | 30
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
1. OAUTH 2.0: authentication is done only once, based on a username and password provided
by WebPOS that gives you access to the portal. When authenticating, a valid token is obtained
for a period of time that will be used in the following calls to the Rest API methods.
2. ApiKey: In this scheme, the license code for the company and an API access key are provided.
The ApiKey is a UUID associated with the company in the WebPOS system. Both must be sent in
each call to the Rest API methods.
Note: The developer must decide which authentication method best suits the company's security
policies.
Authentication
Host: https://fepatest-api.webposonline.com/Token
Method: POST
Headers:
Content-Type: text/html; charset=utf-8
Accept: application/json
RequestBody:
username={username}&password={userPassword}&grant_type=password
Response:
{"access_token":"kBKqCinqZPBbfVgDrpbENwlt2D3pkCc5-
IV7RM5DCnTg6PUfZ7nBjG602M5es1GdaSc8xi1QGy_sMDJDHRFikVQ6SaXvYj4dCJ-
zWKDRYbfMifE4OxXvsbtl98WZFBS6OT1wBmtn6Db15At265FBNkI-
kKD1Kh4XIsos_RITMqVhwcKiE8q4cuFgZQIAbIr8KEckulrbiifemUL3m1Zjfv3Legnpce
DcpinmTgoZzJY6PP9_j-Ehddgj-V_eChiyy02VH6rQsyAUUedeUuitweefuP9lOXAOO-
0rVpGn2ftzDpKtvl6-GiP5KnN8jwbcE74TAnsUqwbyXi9oqHu-
Gsuh2C5rURI_Wc3nTM2h9Wr_hPt86wN8yoQ1quVYZPTKjvt6zmfvsYgL3_8cp_L44xQ5Bv
-NdVsMMW_gODellKqUvadp-HMfJO159SX_YNHsx1PNZJxm36vhRCjaW2VAzK-
mnzr5Nxsikbjw5t66mJ_PP_-uWCEQk-
CHFBCWpVxv0kD2UGByYX_9qudYj6Sxl","token_type":"bearer","expires_in":86
400,"userName":"{username}",".issued":"Fri, 06 Dec 2019 22:16:02
GMT",".expires":"Fri, 07 Dec 2019 22:16:02 GMT"}
Notes:
- This method is only used for OAUTH 2.0 authentication and to get
the token used for the other methods.
- User credentials will be provided by WebPOS.
Page | 31
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
Note: For more information about the APIs you can visit https://developer.webposonline.com
Utilice Headers:
Content-Type: text/plain
Authorization: Bearer {token}
Page | 32
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
Notes:
1. Use the URL corresponding to the environment you are using and add the path of the service
you want to invoke.
2. The /Token service must be invoked and the user and password credentials must be passed to
receive a Token for the following calls to the services.
3. In each call to a service with the authentication type OAuth must be included in the header
Authorization Bearer {token}
4. The Token has an expiration date. Before each call you must check the expiration date and time
and if it is expired you must call the /Token service and obtain a new one.
Page | 33
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
Page | 34
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
Page | 35
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
"emailTo":
"string",
"emailCc":
"string"
}
GetUbics /api/fepa/ak/v1/getUbics/{apiKey} Test or GET ApiKey It is used to
Production obtain a list of
Provinces,
Districts and
corregimientos
GetPaises /api/fepa/ak/v1/getPaises/{apiKey} Test or GET ApiKey To obtain a list
Production of countries
with their ISO
codes
GetCPBSfams /api/fepa/ak/v1/GetCPBSfams/{apiKey} Test or GET ApiKey To obtain the
Production Panamanian
family of
categories of
goods and
services
GetCPBSegs /api/fepa/ak/v1/GetCPBSsegs/{apiKey} Test or GET ApiKey To obtain the
Production segments of
Panamanian
categories of
goods and
services
Page | 36
© 2020 WebPOS Panamá
Todos los derechos reservados.
Tel. (507) 392-3020
[email protected]
Notes:
1. Use the URL corresponding to the environment you are using and add the path of the service
you want to invoke.
2. In each call the ApiKey must be sent.
3. The ApiKey can be changed for security reasons, by the user at any time by accessing their user
profile.
4. The {companyLicCod} and {apiKey} parameters are provided by WebPOS.
5. Use a tool like Postman to test the APIs or SOAP UI to test SOAP web services.
Page | 37