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

ConnectOrder

public static ConnectOrder ( Object ConnectOrderRequest )
    Return: Object ConnectOrderResponse

Send us details of your international orders for complete fullfillment.

Section
Bongo Connect
Parameters
Object ConnectOrderRequest Required

Input object required for the function.

Length
String orderNumber Required

Order number

100
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
String landedCostTransactionID Required

Landed cost transaction identifier

32
Array ordersInfo (Object OrderInformation ) Required

Set of descriptions of the orders to send.

String shipToBusiness Optional

Name of the receiving company

100
String shipToFirstName Required

Shipping name of the recipient

100
String shipToLastName Required

Lastname of the person receiving the shipment

100
String shipToAddress1 Required

First part of the address of the person or company receiving the shipment

255
String shipToAddress2 Optional

Second part of the address of the person or company receiving the shipment

255
String shipToAddress3 Optional

Third part of the address of the person or company receiving the shipment

250
String shipToCity Required

City name of the person or company receiving the shipment.

100
String shipToState Optional

State name of the person or company receiving the shipment

50
String shipToZip Optional

Postal code of the person or company receiving the shipment

15
String shipToCountry Required

Country name of the person or company  receiving the shipment.

2
String shipToPhone Optional

Telephone number of the person or company receiving the shipment

45
String shipToEmail Optional

Email address of the person or company receiving the shipment

60
String shipToTaxID Optional

Identifier taxes code of the person or company  receiving the shipment

25
Integer repackage Optional

Bongo will always repack

1
Integer dutyPaid Optional

This field is defined as: 0 = The shipping authority does not pay taxes for shipment, 1 = The shipping authority pays the taxes for shipment.

1
Integer insurance Optional

This field is defined as: 0 = No additional cost is charged by the shipping Loss and Damage Protection, 1 = Additional cost is charged by the shipping Loss and Damage Protection.

1
Integer emailCustomerTracking Optional

This field is defined to Bongo send or not the shipment tracking link directly to the client: 0 = No, 1 = Yes

1
Integer bongoCustomerService Optional

Defines whether the Bongous.com Live Chat (image and link) will appear on the shipping tracking page, possible values are: 0 = No, 1 = Yes.

1
String sellingStoreName Optional

Defines the company name to be displayed in the shipping tracking page.

100
String sellingStoreURL Optional

Defines the URL of the company to be displayed in the shipping tracking page.

250
String sellingStoreURLCS Optional

Defines the URL (as a link) customer service belonging to the company to be displayed in the shipping tracking page.

250
String sellingStoreURLImage Optional

Defines the company's image to display in the shipping tracking page

250
Return
Object ConnectOrderResponse

Return object of the function.

Integer error

Numerical code error message.

String errorMessage

Text string describing the error message.

String trackingLink

Link to the shipping tracking page

Examples (3)

download example code

[1] ConnectOrder1.PHP

<?php$client = new SoapClient("https://api.bongous.com/services/v4?wsdl");$request = (object)array(    'partnerKey' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', // please your partner key    'language' => 'en',    'orderNumber' => '4545456',    'landedCostTransactionID' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', // please your landed cost landedCostTransactionID    'ordersInfo' => array(        array(            'carrier' => '1',            'trackingNumber' => '',            'productID' => 'e2322',            'quantity' => '1',            'price' => '',        )    ),    'shipToBusiness' => '',    'shipToFirstName' => 'ss',    'shipToLastName' => 'sxd',    'shipToAddress1' => 'sssc',    'shipToAddress2' => 'ss',    'shipToAddress3' => '',    'shipToCity' => 'ASDAS',    'shipToState' => 'ascas',    'shipToZip' => '',    'shipToCountry' => 'PE',    'shipToPhone' => '',    'shipToEmail' => '',    'shipToTaxID' => '',    'repackage' => '',    'dutyPaid' => '',    'insurance' => '',    'emailCustomerTracking' => '',    'bongoCustomerService' => '',    'sellingStoreName' => '',    'sellingStoreURL' => '',    'sellingStoreURLCS' => '',    'sellingStoreURLImage' => '',);$response = $client->ConnectOrder($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>ConnectOrder</h1>        <br /><strong>error:</strong> <?php echo $response->error ?>        <br /><strong>errorMessage:</strong> <?php echo $response->errorMessage ?>        <br /><strong>trackingLink:</strong> <?php echo $response->trackingLink ?>    </body></html>

[2] ConnectOrder2.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>ConnectOrder</h1>        <%            ws.BongoServiceV4Service service = new ws.BongoServiceV4Service_Impl();            ws.BongoServiceV4Port port = service.getBongoServiceV4Port();            ws.OrderInformation orderIn = new ws.OrderInformation();            orderIn.setCarrier(1);            orderIn.setTrackingNumber("654654");            orderIn.setProductID("e132165");            orderIn.setQuantity(2);            orderIn.setPrice(12.5f);            ws.OrderInformation[] ordersInfo = new ws.OrderInformation[1];            ordersInfo[0] = orderIn;            ws.ConnectOrderRequest cRequest = new ws.ConnectOrderRequest();            cRequest.setPartnerKey("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");            cRequest.setLanguage("es");            cRequest.setOrderNumber("65465465");            cRequest.setLandedCostTransactionID("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");            cRequest.setOrdersInfo(ordersInfo);            cRequest.setShipToBusiness("");            cRequest.setShipToFirstName("ssdd");            cRequest.setShipToLastName("sxd");            cRequest.setShipToAddress1("sswwdw");            cRequest.setShipToAddress2("sdfds");            cRequest.setShipToAddress3("");            cRequest.setShipToCity("Lima");            cRequest.setShipToState("Lima");            cRequest.setShipToZip("");            cRequest.setShipToCountry("PE");            cRequest.setShipToPhone("");            cRequest.setShipToEmail("");            cRequest.setShipToTaxID("");            cRequest.setRepackage(0);            cRequest.setDutyPaid(0);            cRequest.setInsurance(0);            cRequest.setEmailCustomerTracking(0);            cRequest.setBongoCustomerService(0);            cRequest.setSellingStoreName("");            cRequest.setSellingStoreURL("");            cRequest.setSellingStoreURLCS("");            cRequest.setSellingStoreURLImage("");            ws.ConnectOrderResponse cResponse = port.connectOrder(cRequest);            out.println("<br /><strong>Error:</strong> " + cResponse.getError());            out.println("<br /><strong>ErrorMessage:</strong> " + cResponse.getErrorMessage());            out.println("<br /><strong>TrackingLink:</strong> " + cResponse.getTrackingLink());        %>    </body></html>

[3] ConnectOrder3.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 item"                    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            drItem.Item("ProductId") = Me.productid.Text.Trim            drItem.Item("Quantity") = Me.qty.Text.Trim            drItem.Item("Price") = Me.price.Text.Trim            drItem.Item("carrier") = Me.carrier.Text.Trim            drItem.Item("trackingNumber") = Me.trackingNumber.Text.Trim            dtItems.Rows.Add(drItem)            dtItems.AcceptChanges()            Me.productid.Text = String.Empty            Me.price.Text = String.Empty            Me.qty.Text = String.Empty            Me.carrier.Text = String.Empty            Me.trackingNumber.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 intValue As Integer        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 quantity            If String.IsNullOrEmpty(Me.qty.Text.Trim) Then                strResultado &= "Please type <b> Quantity</b><br/>"            Else                Try                    intValue = Integer.Parse(Me.qty.Text.Trim)                Catch ex As Exception                    strResultado &= "Qty Product<b>is Incorrect</b><br/>"                End Try            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 &= "Value Product<b>is Incorrect</b><br/>"                End Try            End If            'validation  carrier            If String.IsNullOrEmpty(Me.carrier.Text.Trim) Then                strResultado &= "Please type <b>carrier</b><br/>"            Else                Try                    intValue = Integer.Parse(Me.carrier.Text.Trim)                Catch ex As Exception                    strResultado &= "carrier Product<b>is Incorrect</b><br/>"                End Try            End If            'validation pricingAdjustmentPercentage            If String.IsNullOrEmpty(Me.trackingNumber.Text.Trim) Then                strResultado &= "Please type <b>trackingNumber</b><br/>"            End If            Return strResultado        Catch ex As Exception            Throw        End Try    End Function    Public Function getItem() As OrderInformation()        Dim dtItems As DataTable        Dim lstItems() As OrderInformation        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 OrderInformation                    lstItems(intContador).productID = .Rows(intContador).Item("ProductId").ToString                    lstItems(intContador).quantity = Integer.Parse(.Rows(intContador).Item("Quantity").ToString)                    lstItems(intContador).price = Single.Parse(.Rows(intContador).Item("Price").ToString)                    lstItems(intContador).carrier = Integer.Parse(.Rows(intContador).Item("carrier").ToString)                    lstItems(intContador).trackingNumber = .Rows(intContador).Item("trackingNumber").ToString                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 ConnectOrderRequest        Dim objresult As New ConnectOrderResponse        Try            objinput.partnerKey = Me.partnerkey.Text            objinput.landedCostTransactionID = Me.landedCostTransactionID.Text            objinput.orderNumber = Me.orderNumber.Text            objinput.shipToBusiness = Me.shipToBusiness.Text            objinput.shipToFirstName = Me.shipToFirstName.Text            objinput.shipToLastName = Me.shipToLastName.Text            objinput.shipToAddress1 = Me.shipToAddress1.Text            objinput.shipToAddress2 = Me.shipToAddress2.Text            objinput.shipToAddress3 = Me.shipToAddress3.Text            objinput.shipToState = Me.shipToState.Text            objinput.shipToZip = Me.shipToZip.Text            objinput.shipToCountry = Me.shipToCountry.Text            objinput.shipToPhone = Me.shipToPhone.Text            objinput.shipToEmail = Me.shipToEmail.Text            objinput.shipToTaxID = Me.shipToTaxID.Text            objinput.repackage = Me.repackage.Text            objinput.dutyPaid = Integer.Parse(Me.dutyPaid.Text)            objinput.insurance = Integer.Parse(Me.insurance.Text)            objinput.emailCustomerTracking = Integer.Parse(Me.emailCustomerTracking.Text)            objinput.bongoCustomerService = Integer.Parse(Me.bongoCustomerService.Text)            objinput.sellingStoreName = Me.sellingStoreName.Text            objinput.sellingStoreURL = Me.sellingStoreURL.Text            objinput.sellingStoreURLCS = Me.sellingStoreURLCS.Text            objinput.sellingStoreURLImage = Me.sellingStoreURLImage.Text            objinput.language = Me.language.Text            objinput.shipToCity = Me.shipToCity.Text            objinput.ordersInfo = Me.getItem            objresult = objBongoApi.ConnectOrder(objinput)            Me.lblresult.Text = "error: " & objresult.error & "<br/>" & _                           "errorMessage: " & objresult.errorMessage & "<br/>" & _                           "trackingLink: " & objresult.trackingLink & "<br/>"        Catch ex As Exception            Me.lblresult.Text = ex.ToString ' .InnerException.Message ' ex.Message.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        Try            If Not Page.IsPostBack Then                dtItems = New DataTable                dtItems.Columns.Add(New DataColumn("ProductId", Type.GetType("System.String")))                dtItems.Columns.Add(New DataColumn("Quantity", Type.GetType("System.String")))                dtItems.Columns.Add(New DataColumn("Price", Type.GetType("System.String")))                dtItems.Columns.Add(New DataColumn("carrier", Type.GetType("System.String")))                dtItems.Columns.Add(New DataColumn("trackingNumber", Type.GetType("System.String")))                Session("items") = dtItems                Me.gvItems.DataSource = dtItems                Me.gvItems.DataBind()            End If        Catch ex As Exception        Finally            dtItems = Nothing        End Try    End SubEnd Class