Árvore de páginas

Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

CONTEÚDO

  1. Visão Geral
  2. Exemplo de utilização
  3. Configuração do Adapter MATA040
  4. Exemplos de mensagem EAI - JSON
  5. Tags
  6. Processamento de campos sem tags e/ou customizados
  7. Pontos de Entrada
  8. Tabelas utilizadas

01. VISÃO GERAL

        Configuração do Adapter Seller com formatos diferentes (XML,JSON).

02.

...

CONFIGURAÇÃO DO ADAPTER MATA040

Exemplo de configuração do adapter Seller no formato JSON.

...

Quando utilizado o Adapter Seller (MATA040) obrigatoriamente, devem ter a mesma configuração do formato de arquivo (XML,JSON).  

03. CONFIGURAÇÃO DO ADAPTER MATA030

No modulo SIGACFG (Configurador) Ambiente > Schedule > Adapter EAI > Incluir MATA040

       

...

03. EXEMPLOS DE MENSAGEM EAI - JSON

Expandir
titleExemplos de arquivo JSON
Deck of Cards
idTags
effectTypefade
Card
id1
labelEnvio
effectTypefade
Bloco de código
languageyml
themeMidnight
firstline1
titleJSON de envio (GET)
linenumberstrue
{
   "Header":{
      "UUID":"436601c4b72d51be-51c995fe-eff29dac-2ee243d0-b678a055b9b83ecf110a0813",
      "Type":"BusinessMessage",
      "SubType":"event",
      "Event":"upsert",
      "Transaction":"CUSTOMERVENDORSELLER",
      "StandardVersion":"1.000",
      "Version":"2.002001",
      "SourceApplication":"P1212310T1",
      "CompanyId":"T1",
      "BranchId":"D MG 01 ",
      "Enterprise":"D ",
      "BusinessUnit":"MG ",
      "ProductName":"Protheus",
      "ProductVersion":"12",
      "GeneratedOn":"2025-0304-25T1809T19:1200:36Z49Z",
      "DeliveryType":"Async"
   },
   "Content":{
      "CompanyId":"T1",
      "BranchId":"D MG 01 ",
      "CompanyInternalId":"T1|D MG 01 ",
      "Code":"FTC009VEND01",
      "StoreId":"01",
      "InternalId":"T1|D MG|FTC009|01|CVEND01",
      "ShortNameName":"CT009VENDEDOR -INTEGRACAO IncluirJSON",
      "NameShortName":"IncluiVEND - EnvioINT EAI JSON - CT009",
      "TypeActive":1"0",
      "StrategicCustomerTypeLogin":"1000773",
      "EntityTypeRepresentativeType":1"I",
      "RegisterDatePersonalIdentification":"1990-03-0163407313000189",
      "RegisterSituationSalesChargeInformation":"Active",
{
         "GovernmentalInformationCustomerVendorInternalId":["T1|D MG|VEND01|01|F",
         {"SalesChargeInterface":"S"
      },
      "NameAddress":"INSCRICAO ESTADUAL",{
            "ScopeAddress":"StateRUA A, 1",
            "IdDistrict":"860883954180BAIRRO TESTE",
         },"City":{
         {   "Description":"SAO PAULO"
         },
   "Name":"INSCRICAO MUNICIPAL",      "State":{
            "ScopeStateCode":"MunicipalSP",
            "IdStateInternalId":"260325SP",
            },"StateDescription":"SAO PAULO"
         {}
      },
      "NameZipCode":"CNPJ02511000",
      "CommunicationInformation":{
         "ScopePhoneDDD":"Federal011",
            "IdPhoneNumber":"77337553000169123456789",
         }"FaxDDD":"",
         {
   "FaxNumber":"123456789",
         "NameFaxNumberExtension":"SUFRAMA",
            "ScopeHomePage":"FederalTESTE.COM.BR",
            "IdEmail":"202503260[email protected]"
         },
         {
            "Name":"INSCRICAO RURAL",
            "Scope":"State",
            "Id":"11223344"
         },
         {
            "Name":"RG",
            "Scope":"Federal",
            "Id":"11223345"
         }
      ],
      "Segment":[
         {
            "Name":"Segment1",
            "InternalId":"T1||000001",
            "CodeERP":"000001",
            "Description":"Industria Quimica\/Resinas\/Tintas\/Sinteticos"
         },
         {
            "Name":"Segment2",
            "InternalId":"T1||000002",
            "CodeERP":"000002",
            "Description":"Industria Faramaceutica\/Veterinaria"
         },
         {
            "Name":"Segment3",
            "InternalId":"T1||000003",
            "CodeERP":"000003",
            "Description":"Industria Refino Petroleo\/Destilacao Alcool"
         },
         {
            "Name":"Segment4",
            "InternalId":"T1||000004",
            "CodeERP":"000004",
            "Description":"Industria Plasticos"
         },
         {
            "Name":"Segment5",
            "InternalId":"T1||000005",
            "CodeERP":"000005",
            "Description":"Industria Textil"
         },
         {
            "Name":"Segment6",
            "InternalId":"T1||000006",
            "CodeERP":"000006",
            "Description":"Industria Vestuario\/Confeccoes"
         },
         {
            "Name":"Segment7",
            "InternalId":"T1||000007",
            "CodeERP":"000007",
            "Description":"Industria Informatica"
         },
         {
            "Name":"Segment8",
            "InternalId":"T1||000008",
            "CodeERP":"000008",
            "Description":"Industria Nautica"
         }
      ],
      "FreightType":{
         "Code":"C",
         "Description":"CIF"
      },
      "Carrier":{
         "CodeERP":"FAT001",
         "InternalId":"T1|D MG|FAT001",
         "Description":"TRANSPORTADORA FATURAMENTO PADRAO"
      },
      "Address":{
         "Address":"RUA TESTE",
         "Number":"1",
         "Complement":"CASA 1",
         "City":{
            "CityCode":"3550308",
            "CityInternalId":"3550308",
            "CityDescription":"SAO PAULO"
         },
         "District":"SANTANA",
         "State":{
            "StateCode":"SP",
            "StateInternalId":"SP",
            "StateDescription":"SAO PAULO"
         },
         "Country":{
            "CountryCode":"105",
            "CountryInternalId":"105",
            "CountryDescription":"BRASIL"
         },
         "Region":{
            "RegionCode":"001",
            "RegionInternalId":"T1||001",
            "RegionDescription":"NORTE"
         },
         "ZIPCode":"02510000",
         "POBox":"C1058"
      },
      "ShippingAddress":{
         "Address":"RUA TESTE",
         "Number":"2",
         "Complement":"BLOCO A",
         "City":{
            "CityCode":"3550308",
            "CityDescription":"SAO PAULO"
         },
         "District":"SANTANA",
         "State":{
            "StateCode":"SP"
         },
         "ZIPCode":"04278050"
      },
      "ListOfCommunicationInformation":[
         {
            "PhoneNumber":"551112345678",
            "FaxNumber":"87654321",
            "HomePage":"www.teste.com.br",
            "Email":"[email protected]"
         }
      ],
      "ListOfContacts":[
         {
            "ContactInformationName":"TESTE"
         }
      ],
      "BillingInformation":{
         "Address":{
            "Address":"RUA TESTE",
            "Number":"3",
            "Complement":"",
            "District":"IPIRANGA",
            "ZIPCode":"04278050",
            "City":{
               "CityDescription":"SAO PAULO"
            },
            "State":{
               "StateCode":"SP"
            }
         }
      },
      "VendorInformation":{
         "VendorType":{
            "Code":"FAT001",
            "VendorInformationInternalID":"T1|D MG|FAT001"
         }
      },
      "PaymentConditionCode":"030",
      "PaymentConditionInternalId":"T1|D MG 01|030",
      "PriceListHeaderItemCode":"001",
      "PriceListHeaderItemInternalId":"T1|D MG|001",
      "CreditInformation":{
         "CreditLimit":1
      },
      "Taxpayer":"1"
   }
}
Card
id2
labelRecebimento
effectTypefade
}
}
Card
id2
labelRecebimento
effectTypefade
Bloco de código
languagejs
themeMidnight
firstline1
titleJSON de Recebimento (POST)
linenumberstrue
{
   "Header":{
      "ProductVersion":"12
Bloco de código
languagejs
themeMidnight
firstline1
titleJSON de Recebimento (POST)
linenumberstrue
{
   "Header":{
      "UUID":"DSERFAT-31227-15931641-JSON-FTAG0101",
      "Type":"BusinessMessage",
      "SubType":"event",
      "Event":"upsert",
      "Transaction":"CUSTOMERVENDOR",
      "StandardVersion":"1.000",
      "Version":"2.000",
      "SourceApplication":"environment",
      "CompanyId":"T1",
      "BranchId":"D MG 01",
      "Enterprise":"D",
      "BusinessUnit":"MG",
      "ProductName":"PROTHEUS",
      "ProductVersion":"12",
      "GeneratedOn":"2025-03-31T00:20:27Z",
      "DeliveryType":"sync"
   },
   "Content":{
      "CompanyId":"T1",
      "BranchId":"D MG 01",
      "CompanyInternalId":"T1|D MG 01",
      "Code":"FTAG01",
      "StoreId":"01",
      "InternalId":"T1|D MG|FTAG01|01|C",
      "ShortName":"CLIENTE FTAG01",
      "Name":"CADASTRO CLIENTE FTAG01",
      "Type":1,
      "StrategicCustomerType":"3",
      "EntityType":2,
      "RegisterDate":"1999-01-04",
      "RegisterSituation":"Active",
      "GovernmentalInformation":[
         {
            "Name":"INSCRICAO ESTADUAL",
            "Scope":"State",
            "Id":"860883954180"
         },
         {
            "Name":"INSCRICAO MUNICIPAL",
            "Scope":"Municipal",
            "Id":"260325"
         },
         {
            "Name":"CNPJ",
            "Scope":"Federal",
            "Id":"77337553000169"
         },
         {
            "Name":"SUFRAMA",
            "Scope":"Federal",
            "Id":"202503260"
         },
         {
            "Name":"RG",
            "Scope":"Federal",
            "Id":"11223345"
         },
         {
            "Name":"INSCRICAO RURAL",
            "Scope":"State",
            "Id":"11223344"
         }
      ],
      "Segment":[
         {
            "Name":"Segment1",
            "InternalId":"T1||000001",
            "CodeERP":"000001",
            "Description":"Industria Quimica\/Resinas\/Tintas\/Sinteticos"
         },
         {
            "Name":"Segment2",
            "InternalId":"T1||000002",
            "CodeERP":"000002",
            "Description":"Industria Faramaceutica\/Veterinaria"
         },
         {
            "Name":"Segment3",
            "InternalId":"T1||000003",
            "CodeERP":"000003",
            "Description":"Industria Refino Petroleo\/Destilacao Alcool"
         },
         {
            "Name":"Segment4",
            "InternalId":"T1||000004",
            "CodeERP":"000004",
            "Description":"Industria Plasticos"
         },
         {
            "Name":"Segment5",
            "InternalId":"T1||000005",
            "CodeERP":"000005",
            "Description":"Industria Textil"
         },
         {
            "Name":"Segment6",
            "InternalId":"T1||000006",
            "CodeERP":"000006",
            "Description":"Industria Vestuario\/Confeccoes"
         },
         {
            "Name":"Segment7",
            "InternalId":"T1||000007",
            "CodeERP":"000007",
            "Description":"Industria Informatica"
         },
         {
            "Name":"Segment8",
            "InternalId":"T1||000008",
            "CodeERP":"000008",
            "Description":"Industria Nautica"
         }
      ],
      "FreightType":{
         "Code":"S",
         "Description":"Sem frete"
      },
      "Carrier":{
         "CodeERP":"FAT001",
         "InternalId":"T1|D MG|FAT001",
         "Description":"TRANSPORTADORA FATURAMENTO PADRAO"
      },
      "Address":{
         "Address":"RUA TESTE",
         "Number":"1",
         "Complement":"CASA 10",
         "City":{
            "CityCode":"3550308",
            "CityInternalId":"3550308",
            "CityDescription":"SAO PAULO"
         },
         "District":"VILA MADALENA",
         "State":{
            "StateCode":"SP",
            "StateInternalId":"SP",
            "StateDescription":"SAO PAULO"
         },
         "Country":{
            "CountryCode":"105",
            "CountryInternalId":"105",
            "CountryDescription":"BRASIL"
         },
         "Region":{
            "RegionCode":"001",
            "RegionInternalId":"T1||001",
            "RegionDescription":"NORTE"
         },
         "ZIPCode":"05417110",
         "POBox":"C1058"
      },
      "ShippingAddress":{
         "Address":"RUA TESTE",
         "Number":"2",
         "Complement":"BLOCO A",
         "City":{
            "CityCode":"3550308",
            "CityDescription":"SAO PAULO"
         },
         "District":"IPIRANGA",
         "StateBranchId":{
"D MG     01 ",
      "StateCodeCompanyId":"SPT1",
         }"Enterprise":"D ",
         "ZIPCodeBusinessUnit":"04278050MG ",
      }"DeliveryType":"Sync",
      "ListOfCommunicationInformationType":["BusinessMessage",
         { "SourceApplication":"MASTERSALES",
      "ProductName":"PROTHEUS",
      "PhoneNumberTransaction":"551112342467SELLER",
      "StandardVersion":"1.000",
      "FaxNumberVersion":"123424682.001",
      "UUID":"DSERFAT-31253-12345678-ADDFIELDS-01",
      "HomePageSubType":"www.teste.com.brEvent",
      "Event":"Upsert",
       "EmailGeneratedOn":"[email protected]2025-04-04T10:05:01Z"
   },
      }"Content":{
      ]"CompanyId":"T1",
      "ListOfContactsCompanyInternalId":[
   "T1|D MG 01 ",
      {
     "BranchId":"D MG 01 ",
       "ContactInformationNameCode":"TESTEVEND02",
         }
"InternalId":"T1|D MG      ]|VEND02",
      "BillingInformationShortName":{
"VEND INT JSON 2",
      "AddressName":{"VENDEDOR INTEGRACAO JSON 2",
      "Active":"0",
      "AddressSellerPassword":"RUA12345 TESTE",
      "RepresentativeType":"I",
      "NumberZipCode":"5002511000",
            "ComplementPersonalIdentification":"12361830618000173",
      "SalesChargeInformation":{
         "DistrictSalesChargeInterface":"IPIRANGAS",
            "ZIPCodeCustomerVendorInternalId":"04278050",01|02|003|04"
      },
      "CityLogin":{"USERORIGEM",
      "Address":{
         "CityDescriptionAddress":"SAO PAULO"AV BRAS LEME, 1000",
            },
  "District":"CASA VERDE",
          "StateCity":{
               "StateCodeDescription":"SPSAO PAULO"
            },
         }"State":{
      },
      "VendorInformationStateCode":{
         "VendorType":{"SP",
            "CodeStateDescription":"FTEAI2SAO PAULO",
            "VendorInformationInternalIDStateInternalId":"T1|D MG 01 |FTEAI2SP"
         }
      },
      "PaymentConditionCodeCommunicationInformation":"030",
{
         "PaymentConditionInternalIdPhoneNumber":"T1|D44557788 MG 01|030",
      "PriceListHeaderItemCode":"001",
         "PriceListHeaderItemInternalIdFaxNumber":"T1|D MG|001",
44557788       "CreditInformation":{,
         "CreditLimitHomePage":1"www.teste.com.br",
         "MaturityCreditLimitPhoneDDD":"2099-10-01011",
         },"Email":"[email protected]"
      "Taxpayer":"1"}
   }
}


0504. Tags

Deck of Cards
idTags
effectTypefade
Card
id1
labelJSON
effectTypefade
Senha para uso no dispositivos HandHeld.SENHACNPJ/CPF vendedorCGCCEP ao registro Protheus (A3_CEP).
ElementoDescriçãoObservação
BusinessContent
CompanyIdEmpresaO campo é preenchido com valor de referência do De/Para de Empresa.
CompanyInternalIdInternalId da empresaO campo é preenchido com valor de referência do De/Para de Empresa e Filial.
BranchIdFilialO campo é preenchido com valor de referência do De/Para de Filial.
CodeCódigo do Vendedor

Código referente ao registro Protheus (A3_COD).

InternalIdInternalId do VendedorO campo é preenchido com valor de referência do De/Para de Vendedores (SA3).
ShortNameNome Reduzido do VendedorCódigo referente ao registro Protheus (A3_NREDUZ).
NameNome do VendedorCódigo referente ao registro Protheus (A3_NOME).
ActiveBloqueia o VendedorCódigo referente ao registro Protheus (A3_MSBLQL).
LoginCódigo de UsuárioCódigo referente ao registro Protheus (A3_CODUSR).SellerPassword
RepresentativeTypeTipo de RepresentanteCódigo referente ao registro Protheus (A3_
TIPO).
PersonalIdentificationCNPJ/CPF do vendedorRepresentativeTypeTipo de RepresentanteCódigo referente ao registro Protheus (A3_TIPOCGC).PersonalIdentification
ZipCode
CEP do
VendedorCódigo referente ao registro Protheus (A3_
CEP).ZipCode
SalesChargeInformation

CustomerVendorInternalId

Código do Vendedor como Fornecedor e Loja 

Código referente

ao De/Para (XXF).

Para utilização deve possuir o Adapter CUSTOMERVENDOR (MATA020) cadastrado.

Código

SalesChargeInformation

CustomerVendorInternalId

Código do Vendedor como Fornecedor e Loja 

Código referente ao registro Protheus (A3_FORNECE e A3_LOJA).

SalesChargeInterfaceForma de Pagamento

Código referente ao registro Protheus (A3_GERASE2).

Address
AddressEndereço do VendedorCódigo referente ao registro Protheus (A3_END).
DistrictBairro do VendedorCódigo referente ao registro Protheus (A3_BAIRRO).
Address > City
DescriptionMunicípio do VendedorCódigo referente ao registro Protheus (A3_MUN).
Address > State
StateCodeEstado do VendedorCódigo referente ao registro Protheus (A3_EST).
StateInternalIdInternalId do Estado do VendedorCódigo referente ao registro Protheus (A3_EST).
StateDescriptionDescrição do EstadoDescrição do estado (Tabela 12 da SX5).
CommunicationInformation
PhoneDDDCódigo do DDDCódigo referente ao registro Protheus (A3_DDDTEL).
PhoneNumberNúmero do TelefoneCódigo referente ao registro Protheus (A3_TEL).
FaxDDDCódigo do DDD do FAXUsado apenas na mensagem de envio com conteúdo em branco.
FaxNumberNúmero do FAX do VendedorCódigo referente ao registro Protheus (A3_FAX).
FaxNumberExtensionExtensão do Número de FAXUsado apenas na mensagem de envio com conteúdo em branco.
HomePageHome-PageCódigo referente ao registro Protheus (A3_HPAGE).
EmailE-MailCódigo referente ao registro Protheus (A3_EMAIL).

...

05. PROCESSAMENTO DE CAMPOS SEM TAGS E/OU CUSTOMIZADOS


Para o processamento de campos sem tag, sejam eles customizados ou padrão, acesse o link abaixo para obter maiores informações sobre o processo para
integrar os campos, sem a necessidade de customizar o Protheus.

...

Gravação da tabela AI0:Será controlada apenas pelo parâmetro MV_MVCSA1 = .T..
Aviso
titleInformações adicionais
  1. Campos sem tag - mensagem de recebimento (SA1 e AI0SA3):
    • Os campos sem tag a serem gravados na tabela SA1 e AI0 SA3 são de responsabilidade do cliente, assim como o conteúdo a ser gravado nesses campos;
    Tabela AI0 - Inclusão:
    • Não é necessário enviar código de cliente e loja no processo de inclusão; esses dados são exigidos apenas em alterações.gravado nesses campos;
  2. Exclusões na seção "AddFields":
    • Os campos Log de Inclusão (A1A3_USERLGI), Log de Alteração (A1A3_USERLGA) e os campos já tagueados não serão incluídos na seção "AddFields".

06. PONTOS DE ENTRADA

07. TABELAS UTILIZADAS

  • XX4 - Adapters EAI

  • SA1 SA3 - Cadastro de ClientesVendedores