How to send and retrieve documents?
This article covers how to send documents (for EDI communication or as PDFs) and how to consult documents and their states through the API. This endpoint allows you to send documents, either for EDI communication or by sending PDFs. To send a document, send the following request: "documentType": "Generic", "postalCode": "string", "inboundPath": "string", "testOutboundPath": "string", "name": "string", This request returns all the documents sent. You can set the top and skip parameters, which allow you to define the number of documents you want to get. To retrieve sent documents, send the following request: It is possible to obtain a specific document via its identifier. This identifier is returned by the Send Documents request, above. To retrieve a specific document, send the following request: This request returns the documents to be received, in "To Export" state. After this request, all the exported documents will be in "Exported" state. To retrieve received documents, send the following request:Send documents
Type POST Production https://yet.cegid.cloud/EDIV2/api/v1.3/External/Transaction/Outbound Testing https://st.yet.cegid.cloud/EDIV2/api/v1.3/External/Transaction/Outbound Body {
"mainDocument": { // required IF EDI communication
"content": "", // byte[] base64 string
"extension": "xml", // string: xml
"fileName": "", // string
"fileTag": "document", // string: document
"fileType": "xml", // string: xml|pdf|txt
"mimeType": "text/xml", // string: text/xml|application/pdf
"id": "",
"createdAt": "" // datetime
},
"mainDocumentPdf": { // required IF sending PDF
"content": "", // byte[] in base64 string
"extension": "pdf", // string: pdf
"fileName": "", // string
"fileTag": "document", // string: document
"fileType": "pdf", // string: pdf
"mimeType": "application/pdf", // string: application/pdf
"id": "",
"createdAt": "" // datetime
},
"attachmentsLits": [ // optional
{
"content": "", // byte[] base64 string
"extension": "pdf", // string: pdf|xml|zip|txt
"fileName": "", // string
"fileTag": "Attachment", // string: Attachment
"fileType": "pdf", // string: pdf|xml|zip|txt
"mimeType": "application/pdf",
"id": "",
"createdAt": "" // datetime
}
]
}Response 201 Created:
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"docType": "string",
"docNumber": "string",
"docDate": "2025-02-23T15:43:04.887Z",
"docDescription": "string",
"buyerGln": "string",
"deliveryGln": "string",
"invoiceToGln": "string",
"supplierGln": "string",
"b2centity": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "string",
"codeIdentifier": "string",
"email": "string",
"mobilePhone": "string",
"contacts": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "string",
"email": "string",
"enable": true,
"mobilePhone": "string",
"sendMailType": "CC"
}
]
},
"documentType": "Generic",
"documentExtenion": "EDI",
"comercialRelation": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"senderOrganization": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"communicationType": "AS2",
"integrationType": "EDI",
"documentExtension": "EDI",
"b2bformat": "PRI",
"erpProviderId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"identifier": "string",
"inboundPath": "string",
"outboundPath": "string",
"name": "string",
"invoiceRepository": true,
"autoComercialRelation": true,
"mainDeliveryPlace": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6","code": "string",
"name": "string",
"address": "string",
"city": "string",
"country": "string",
"postalCode": "string",
"vatNumber": "string"
},
"organizationInfo": {
"billingCommission": true,
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "string",
"vatNumber": "string",
"organizationType": "string"
}
},
"receiverOrganization": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"communicationType": "AS2",
"integrationType": "EDI",
"documentExtension": "EDI",
"b2bformat": "PRI",
"erpProviderId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"identifier": "string",
"inboundPath": "string",
"outboundPath": "string",
"name": "string",
"invoiceRepository": true,
"autoComercialRelation": true,
"mainDeliveryPlace": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"code": "string",
"name": "string",
"address": "string",
"city": "string",
"country": "string",
"postalCode": "string",
"vatNumber": "string"
},
"organizationInfo": {
"billingCommission": true,
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "string",
"vatNumber": "string",
"organizationType": "string"
}
},
"van": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "string",
"username": "string",
"password": "string",
"inboundPath": "string",
"outboundPath": "string",
"ssl": "string",
"port": "string",
"testName": "string",
"testUsername": "string",
"testPassword": "string",
"testInboundPath": "string",
"testOutboundPath": "string",
"testSSL": "string",
"testPort": "string",
"endPointUrl": "string",
"useWs": true
},
"active": true,
"isOnTeste": true,
"mapName": "string",
"isPDFMandatory": true,
"isJasminSync": true,
"layoutReceiver": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"organization": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"communicationType": "AS2",
"integrationType": "EDI",
"documentExtension": "EDI",
"b2bformat": "PRI",
"erpProviderId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"identifier": "string",
"inboundPath": "string",
"outboundPath": "string",
"name": "string",
"invoiceRepository": true,
"autoComercialRelation": true,
"mainDeliveryPlace": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"code": "string",
"name": "string",
"address": "string",
"city": "string",
"country": "string",
"vatNumber": "string"
},
"organizationInfo": {
"billingCommission": true,
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "string",
"vatNumber": "string",
"organizationType": "string"
}
},
"layoutDocument": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"layoutId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"documentTypeEnum": "Generic",
"direction": true,
"mapa": "string",
"formatTypeEnum": "XML",
"segmento": "string",
"separator": "string",
"senderStart": "string",
"senderEnd": "string",
"receiverStart": "string",
"receiverEnd": "string",
"documentTypeStart": "string",
"documentTypeEnd": "string",
"documentTypeFileCode": "string",
"numberStart": "string",
"numberEnd": "string",
"dateStart": "string",
"dateEnd": "string",
"dateFormat": "string",
"bpPreExecution": "string",
"bpPosExecution": "string",
"layout": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "string",
"description": "string",
"layoutDocuments": [
"string"
]
},
"van": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "string",
"username": "string",
"password": "string",
"outboundPath": "string",
"ssl": "string",
"port": "string",
"testName": "string",
"testUsername": "string",
"testPassword": "string",
"testInboundPath": "string",
"testOutboundPath": "string",
"testSSL": "string",
"testPort": "string",
"endPointUrl": "string",
"useWs": true
}
},
"layoutDefault": true
},
"layoutSender": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"organization": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"communicationType": "AS2",
"integrationType": "EDI",
"documentExtension": "EDI",
"b2bformat": "PRI",
"erpProviderId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"identifier": "string",
"inboundPath": "string",
"outboundPath": "string",
"name": "string",
"invoiceRepository": true,
"autoComercialRelation": true,
"mainDeliveryPlace": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"code": "string",
"name": "string",
"address": "string",
"city": "string",
"country": "string",
"postalCode": "string",
"vatNumber": "string"
},
"organizationInfo": {
"billingCommission": true,
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "string",
"vatNumber": "string",
"testSSL": "string",
"testPort": "string",
"endPointUrl": "string",
"useWs": true
}
},
"layoutDefault": true
}
},
"van": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "string",
"username": "string",
"password": "string",
"inboundPath": "string",
"outboundPath": "string",
"ssl": "string",
"port": "string",
"testName": "string",
"testUsername": "string",
"testPassword": "string",
"testInboundPath": "string",
"testOutboundPath": "string",
"testSSL": "string",
"testPort": "string",
"endPointUrl": "string",
"useWs": true
},
"transactionState": "PendingParser",
"transactionType": "QuickInvoice",
"organizationOwner": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"communicationType": "AS2",
"integrationType": "EDI",
"documentExtension": "EDI",
"b2bformat": "PRI",
"erpProviderId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"identifier": "string",
"inboundPath": "string",
"outboundPath": "string",
"name": "string",
"invoiceRepository": true,
"autoComercialRelation": true,
"mainDeliveryPlace": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"code": "string",
"address": "string",
"city": "string",
"country": "string",
"postalCode": "string",
"vatNumber": "string"
},
"organizationInfo": {
"billingCommission": true,
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "string",
"vatNumber": "string",
"organizationType": "string"
}
},
"alreadySent": true,
"direction": true,
"createdAt": "2025-02-23T15:43:04.888Z",
"documentDetails": "string"
}
409 Conflict or 500 Internal Server Error:
{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string",
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
}Get sent documents
Type GET Production https://yet.cegid.cloud/EDIV2/api/v1.3/External/Transaction?$count=true&$top=100&$skip=100 Testing https://st.yet.cegid.cloud/EDIV2/api/v1.3/External/Transaction?$count=true&$top=100&$skip=100 Response 200 Ok:
[
{
"transactionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"files": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"fileType": "JSON",
"fileTag": "CertificateContractSent",
"content": "string",
"extension": "string",
"mimeType": "string",
"fileName": "string",
"createdAt": "2025-02-23T15:45:02.788Z"
}
]
}
]
404 Not Found or 500 Internal Server Error:
{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string",
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
}Get a specific document
Type GET Production https://yet.cegid.cloud/EDIV2/api/v1.3/External/Transaction/{{transactionId}} Testing https://st.yet.cegid.cloud/EDIV2/api/v1.3/External/Transaction/{{transactionId}} Route params transactionId: “guid” // ID of the created document Response 200 Ok: Same response 4.1
404 Not Found or 500 Internal Server Error:
{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string",
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
}Received documents
Type GET Production https://yet.cegid.cloud/EDIV2/api/v1.3/External/Transaction/ExportAll Testing https://st.yet.cegid.cloud/EDIV2/api/v1. 3/External/Transaction/ExportAll Response 200 OK
[
{
"transactionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"files": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"fileType": "JSON",
"fileTag": "CertificateContractSent",
"content": "string",
"extension": "string",
"mimeType": "string",
"fileName": "string",
"createdAt": "2025-02-23T15:46:42.018Z"
}
]
}
]
404 Not Found or 500 Internal Server Error:
{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string",
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
}