Bongo API
Back to Bongous.com
United Kingdom / English
Back to Documentation

ConnectProductInfo

public static ConnectProductInfo ( Object ConnectProductInfoRequest )
    Return: Object ConnectProductInfoResponse

Synch product database with Bongo. Provide us with basic item details and we take care of applying all the additional necessary information for like HSCode and Billable Weight to properly calculate all shipping related costs.

Section
Bongo Connect
Parameters
Object ConnectProductInfoRequest Required

Required object by the function

Length
String partnerKey Required

Required Key to access the functions of Connect API

45
String language Required

Defines the language in which the return error will be shown. Supported Languages.

2
Array items (Object ProductInfoDat ) Required

Set of products with their respective descriptions, ready to be recorded in the Master Book of Bongo International.

Return
Object ConnectProductInfoResponse

Return object of the function

Integer error

Numerical code error message.

String errorMessage

Text string describing the error message.

String errorMessageDetail

List of Insertion Errors

Examples (3)

download example code

[1] ConnectProductInfo1.PHP

<?php$client = new SoapClient("https://api.bongous.com/services/v4?wsdl");$request = (object)array(    'partnerKey' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',    'language' => 'en',    'items' => array(        array(            'productID' => '222222',            'description' => 'Descripcion de 22222',            'url' => 'https://api.bongous.com',            'imageUrl' => 'https://api.bongous.com/css/images/aspdotnet.gif',            'price' => '15.3',            'countryOfOrigin' => 'PE',            'hsCode' => 'sss',            'eccn' => 'sdfsd',            'hazFlag' => '0',            'licenseFlag' => 'CA,MX',            'importFlag' => 'CA,MX',            'productType' => '',            'itemInformation' => array (                array(                    'l' => '1.5',                    'w' => '12.3',                    'h' => '45.2',                    'wt' => '5.6'                )            )        ),        array(            'productID' => '111111',            'description' => 'sdsdsd',            'url' => 'api.bongous.com',            'imageUrl' => 'https://api.bongous.com/css/images/aspdotnet.gif',            'price' => '12.3',            'countryOfOrigin' => 'PE',            'hsCode' => 'sss',            'eccn' => 'sdfsd',            'hazFlag' => '1',            'licenseFlag' => 'CA,MX',            'importFlag' => 'CA,MX',            'productType' => '',            'itemInformation' => array (                array(                    'l' => '1.5',                    'w' => '12.3',                    'h' => '45.2',                    'wt' => '5.6'                )            )        ),        array(            'productID' => '111111',            'description' => 'Descripción de 111111',            'url' => 'https://api.bongous.com',            'imageUrl' => 'https://api.bongous.com/css/images/aspdotnet.gif',            'price' => '12.3',            'countryOfOrigin' => 'PE',            'hsCode' => 'sss',            'eccn' => 'sdfsd',            'hazFlag' => '0',            'licenseFlag' => 'CA,MX',            'importFlag' => 'CA,MX',            'productType' => '',            'itemInformation' => array (                array(                    'l' => '1.5',                    'w' => '12.3',                    'h' => '45.2',                    'wt' => '5.6'                ),                array(                    'l' => '1.5',                    'w' => '12.3',                    'h' => '45.2',                    'wt' => '5.6'                )            )        )    ));$response = $client->connectProductInfo($request);?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html>    <head>        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">        <title>PHP Page</title>    </head>    <body>        <h1>ConnectProductInfo</h1>        <br /><strong>error:</strong> <?php echo $response->error ?>        <br /><strong>errorMessage:</strong> <?php echo $response->errorMessage ?>        <br /><strong>errorMessageDetail:</strong> <?php echo $response->errorMessageDetail ?>    </body></html>

[2] ConnectProductInfo2.Java

<%@page contentType="text/html" pageEncoding="UTF-8"%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"   "http://www.w3.org/TR/html4/loose.dtd"><html>    <head>        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">        <title>JSP Page</title>    </head>    <body>        <h1>ConnectProductInfo</h1>        <%            ws.BongoServiceV4Service service = new ws.BongoServiceV4Service_Impl();            ws.BongoServiceV4Port port = service.getBongoServiceV4Port();            ws.CartonsDat carton = new ws.CartonsDat();            carton.setH(1.5f);            carton.setL(12.3f);            carton.setW(45.2f);            carton.setWt(5.6f);                        ws.CartonsDat[] itemInformation = new ws.CartonsDat[1];            itemInformation[0] = carton;            ws.ProductInfoDat ProductIn = new ws.ProductInfoDat();            ProductIn.setProductID("22710");            ProductIn.setDescription("Descripcion de 22222");            ProductIn.setUrl("https://api.bongous.com");            ProductIn.setImageUrl("https://api.bongous.com/css/images/aspdotnet.gif");            ProductIn.setPrice(15);            ProductIn.setCountryOfOrigin("PE");            ProductIn.setHsCode("sssss");            ProductIn.setEccn("sdsd");            ProductIn.setHazFlag(0);            ProductIn.setLicenseFlag("CA,MX");            ProductIn.setImportFlag("CA,MX");            ProductIn.setProductType(0);            ProductIn.setItemInformation(itemInformation);            ws.ProductInfoDat[] items = new ws.ProductInfoDat[1];            items[0] = ProductIn;            ws.ConnectProductInfoRequest cRequest = new ws.ConnectProductInfoRequest();            cRequest.setPartnerKey("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");            cRequest.setLanguage("es");            cRequest.setItems(items);            ws.ConnectProductInfoResponse cResponse = port.connectProductInfo(cRequest);            out.println("<br /><strong>Error:</strong> " + cResponse.getError());            out.println("<br /><strong>ErrorMessage:</strong> " + cResponse.getErrorMessage());            out.println("<br /><strong>ErrorMessageDetail:</strong> " + cResponse.getErrorMessageDetail());        %>    </body></html>

[3] ConnectProductInfo3.VBNET

Imports System.DataImports com.bongous.apiPartial Class _Default    Inherits System.Web.UI.Page    Protected Sub AddItems_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles AddItems.Click        Dim strCadena As String        Try            strCadena = Me.ValidarItem()            If Not String.IsNullOrEmpty(strCadena) Then                Me.lblresult.Text = "Error de Validacion :"                Me.lblresult.ForeColor = Drawing.Color.Red                Me.lblresult.Text = strCadena                Me.lblresult.ForeColor = Drawing.Color.Red            Else                Me.lblresult.Text = "error items"                If Not Me.AgregarItem Then                    Me.lblresult.Text = "Result :"                    Me.lblresult.ForeColor = Drawing.Color.Green                    Me.lblresult.Text = "- error add items"                    Me.lblresult.ForeColor = Drawing.Color.Green                Else                    Me.lblresult.Text = String.Empty                    Me.lblresult.Text = String.Empty                End If            End If        Catch ex As Exception            Me.lblresult.Text = "Error de Aplicacion :"            Me.lblresult.ForeColor = Drawing.Color.Blue            Me.lblresult.Text = ex.Message            Me.lblresult.ForeColor = Drawing.Color.Blue        End Try    End Sub    Private Function AgregarItem() As Boolean        Dim dtItems As DataTable        Dim drItem As DataRow        Try            dtItems = CType(Session("items"), DataTable)            drItem = dtItems.NewRow            'Object ProductInfoDat  --> items            drItem.Item("ProductId") = Me.productid.Text.Trim            drItem.Item("Description") = Me.description.Text.Trim            drItem.Item("Url") = Me.url.Text.Trim            drItem.Item("ImageUrl") = Me.imageUrl.Text.Trim            drItem.Item("price") = Single.Parse(Me.price.Text.Trim)            drItem.Item("countryOfOrigin") = Me.countryOfOrigin.Text.Trim            drItem.Item("hsCode") = Me.hsCode.Text.Trim            drItem.Item("eccn") = Me.eccn.Text.Trim            drItem.Item("hazFlag") = Integer.Parse(Me.hazFlag.Text.Trim)            drItem.Item("licenseFlag") = Me.licenseFlag.Text.Trim            drItem.Item("importFlag") = Me.importFlag.Text.Trim            drItem.Item("productType") = Integer.Parse(Me.productType.Text.Trim)            'Object CartonsDat  --> cartons            drItem.Item("l") = Single.Parse(Me.l.Text.Trim)            drItem.Item("w") = Single.Parse(Me.w.Text.Trim)            drItem.Item("h") = Single.Parse(Me.h.Text.Trim)            drItem.Item("wt") = Single.Parse(Me.wt.Text.Trim)            dtItems.Rows.Add(drItem)            dtItems.AcceptChanges()            Me.productid.Text = String.Empty            Me.description.Text = String.Empty            Me.url.Text = String.Empty            Me.imageUrl.Text = String.Empty            Me.price.Text = String.Empty            Me.countryOfOrigin.Text = String.Empty            Me.hsCode.Text = String.Empty            Me.eccn.Text = String.Empty            Me.hazFlag.Text = String.Empty            Me.licenseFlag.Text = String.Empty            Me.importFlag.Text = String.Empty            Me.productType.Text = String.Empty            Me.l.Text = String.Empty            Me.w.Text = String.Empty            Me.h.Text = String.Empty            Me.wt.Text = String.Empty            Me.gvItems.DataSource = dtItems            Me.gvItems.DataBind()            Return True        Catch ex As Exception            Throw        End Try    End Function    Private Function ValidarItem() As String        Dim strResultado As String        Dim sinValue As Single        Try            strResultado = String.Empty            'validation product id            If String.IsNullOrEmpty(Me.productid.Text.Trim) Then                strResultado &= "Please type <b>Product ID</b><br/>"            End If                        'validation price            If String.IsNullOrEmpty(Me.price.Text.Trim) Then                strResultado &= "Please type <b>Price</b><br/>"            Else                Try                    sinValue = Single.Parse(Me.price.Text.Trim)                Catch ex As Exception                    strResultado &= "price Product<b>is Incorrect</b><br/>"                End Try            End If            Return strResultado        Catch ex As Exception            Throw        End Try    End Function    Public Function getCartons() As CartonsDat()        Dim dtCartons As DataTable        Dim lstCartons() As CartonsDat        Try            dtCartons = CType(Session("cartons"), DataTable)            With dtCartons                ReDim lstCartons(.Rows.Count - 1)                For intContador As Integer = 0 To .Rows.Count - 1                    lstCartons(intContador) = New CartonsDat                    lstCartons(intContador).l = Single.Parse(.Rows(intContador).Item("l").ToString)                    lstCartons(intContador).w = Single.Parse(.Rows(intContador).Item("w").ToString)                    lstCartons(intContador).h = Single.Parse(.Rows(intContador).Item("h").ToString)                    lstCartons(intContador).wt = Single.Parse(.Rows(intContador).Item("wt").ToString)                Next            End With            Return lstCartons        Catch ex As Exception            lblresult.Text = ex.ToString        Finally            lstCartons = Nothing            dtCartons = Nothing        End Try    End Function    Public Function getItem() As ProductInfoDat()        Dim dtItems As DataTable        Dim lstItems() As ProductInfoDat        Try            dtItems = CType(Session("items"), DataTable)            With dtItems                ReDim lstItems(.Rows.Count - 1)                For intContador As Integer = 0 To .Rows.Count - 1                    lstItems(intContador) = New ProductInfoDat                    lstItems(intContador).productID = .Rows(intContador).Item("ProductId").ToString                    lstItems(intContador).description = .Rows(intContador).Item("description").ToString                    lstItems(intContador).url = .Rows(intContador).Item("url").ToString                    lstItems(intContador).imageUrl = .Rows(intContador).Item("imageUrl").ToString                    lstItems(intContador).price = Single.Parse(.Rows(intContador).Item("price").ToString)                    lstItems(intContador).countryOfOrigin = .Rows(intContador).Item("countryOfOrigin").ToString                    lstItems(intContador).hsCode = .Rows(intContador).Item("hsCode").ToString                    lstItems(intContador).eccn = .Rows(intContador).Item("eccn").ToString                    lstItems(intContador).hazFlag = .Rows(intContador).Item("hazFlag").ToString                    lstItems(intContador).licenseFlag = .Rows(intContador).Item("licenseFlag").ToString                    lstItems(intContador).importFlag = .Rows(intContador).Item("importFlag").ToString                    lstItems(intContador).productType = .Rows(intContador).Item("productType").ToString                    lstItems(intContador).licenseFlag = .Rows(intContador).Item("licenseFlag").ToString                    lstItems(intContador).importFlag = .Rows(intContador).Item("importFlag").ToString                    lstItems(intContador).itemInformation = Me.getCartons                Next            End With            Return lstItems        Catch ex As Exception            Throw        Finally            lstItems = Nothing            dtItems = Nothing        End Try    End Function    Private Function validateform() As String        Dim caderror As String        Try            caderror = String.Empty            If CType(Session("items"), DataTable) Is Nothing Then                caderror &= "Please type <b>Items</b> for ConnectLandedCostCalculator<br />"            Else                If CType(Session("items"), DataTable).Rows.Count = 0 Then                    caderror &= "- please type <b>Items</b> for  ConnectLandedCostCalculator<br />"                End If            End If            Return caderror        Catch ex As Exception            Throw        End Try    End Function    Protected Sub Process_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Process.Click        Dim objBongoApi As New BongoServiceV4Service        Dim objinput As New ConnectProductInfoRequest        Dim objresult As New ConnectProductInfoResponse        Try            objinput.partnerKey = Me.partnerkey.Text            objinput.language = Me.language.Text            objinput.items = Me.getItem            objresult = objBongoApi.ConnectProductInfo(objinput)            Me.lblresult.Text = "error: " & objresult.error & "<br/>" & _                           "errorMessage: " & objresult.errorMessage & "<br/>" & _                           "trackingLink: " & objresult.errorMessageDetail & "<br/>"        Catch ex As Exception            Me.lblresult.Text = ex.ToString        End Try    End Sub    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load        Dim dtItems As DataTable        Dim dtCartons As DataTable        Try            If Not Page.IsPostBack Then                dtItems = New DataTable                dtItems.Columns.Add(New DataColumn("ProductId", Type.GetType("System.String")))                dtItems.Columns.Add(New DataColumn("description", Type.GetType("System.String")))                dtItems.Columns.Add(New DataColumn("url", Type.GetType("System.String")))                dtItems.Columns.Add(New DataColumn("imageUrl", Type.GetType("System.String")))                dtItems.Columns.Add(New DataColumn("price", Type.GetType("System.String")))                dtItems.Columns.Add(New DataColumn("countryOfOrigin", Type.GetType("System.String")))                dtItems.Columns.Add(New DataColumn("hsCode", Type.GetType("System.String")))                dtItems.Columns.Add(New DataColumn("eccn", Type.GetType("System.String")))                dtItems.Columns.Add(New DataColumn("hazFlag", Type.GetType("System.String")))                dtItems.Columns.Add(New DataColumn("licenseFlag", Type.GetType("System.String")))                dtItems.Columns.Add(New DataColumn("importFlag", Type.GetType("System.String")))                dtItems.Columns.Add(New DataColumn("productType", Type.GetType("System.String")))                dtItems.Columns.Add(New DataColumn("l", Type.GetType("System.String")))                dtItems.Columns.Add(New DataColumn("w", Type.GetType("System.String")))                dtItems.Columns.Add(New DataColumn("h", Type.GetType("System.String")))                dtItems.Columns.Add(New DataColumn("wt", Type.GetType("System.String")))                Session("items") = dtItems                Session("cartons") = dtCartons                Me.gvItems.DataSource = dtItems                Me.gvItems.DataBind()            End If        Catch ex As Exception        Finally            dtItems = Nothing            dtCartons = Nothing        End Try    End SubEnd Class