Joseph Anderson
Joseph Anderson

Reputation: 4144

eBay SDK Add Order Transaction Id

I am using the eBay SOAP SDK Sample. I am trying to add an order, but it asks me for a transaction Id. How do I obtain a transaction Id? I entered the number 1 and it says it cannot find it. I just signed up today and my store is empty.

        private void BtnAddOrder_Click(object sender, System.EventArgs e)
    {
        try
        {
            TxtOrderId.Text = "";

            AddOrderCall apicall = new AddOrderCall(Context);


            OrderType order = new OrderType();
            order.TransactionArray = new TransactionTypeCollection();
            order.ShippingDetails = new ShippingDetailsType();
            order.PaymentMethods = new BuyerPaymentMethodCodeTypeCollection();

            TransactionType tr1 = new TransactionType();
            tr1.Item = new ItemType();
            tr1.Item.ItemID = TxtItemIdOne.Text;
            tr1.TransactionID = TxtTransactionIdOne.Text;
            order.TransactionArray.Add(tr1);

            TransactionType tr2 = new TransactionType();
            tr2.Item = new ItemType();
            tr2.Item.ItemID = TxtItemIdTwo.Text;
            tr2.TransactionID = TxtTransactionIdTwo.Text;
            order.TransactionArray.Add(tr2);

            order.ShippingDetails.PaymentInstructions = TxtPaymentInstructions.Text;
            ShippingServiceOptionsType shpopt = new ShippingServiceOptionsType();
            shpopt.ShippingService = CboShipSvc.SelectedItem.ToString();
            shpopt.ShippingServicePriority = 1;

            order.ShippingDetails.ShippingServiceOptions = new ShippingServiceOptionsTypeCollection();
            shpopt.ShippingServiceCost = new AmountType();
            shpopt.ShippingServiceCost.currencyID = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site);

            if (TxtShipCost.Text.Length > 0) 
            {
                shpopt.ShippingServiceCost.Value = Convert.ToDouble(TxtShipCost.Text);
            }
            order.ShippingDetails.ShippingServiceOptions.Add(shpopt);

            order.Total = new AmountType();
            order.Total.currencyID = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site);
            if (TxtTotal.Text.Length > 0)
                order.Total.Value = Convert.ToDouble(TxtTotal.Text);
            order.CreatingUserRole = (TradingRoleCodeType) Enum.Parse(typeof(TradingRoleCodeType), CboRole.SelectedItem.ToString());

            order.PaymentMethods.AddRange(new BuyerPaymentMethodCodeType[] {BuyerPaymentMethodCodeType.PaymentSeeDescription});

            string orderid = apicall.AddOrder(order);


            TxtOrderId.Text = orderid;

        }
        catch(Exception ex)
        {
            MessageBox.Show(ex.Message);
        }

    }

Upvotes: 1

Views: 373

Answers (1)

SH-
SH-

Reputation: 1642

This call is used to join two Orders so the Buyer can pay together. See this AddOrder Reference. It is asking you for the Transaction Id's from your store to join into one order. If it can not find the Transaction Id then you have likely entered an non-existent one. In your case that is almost definitely the case. ( Transaction Ids are 9 digit strings if I remember correctly).

What I think your looking for is this, PlaceOffer Reference. Your going to need to have some items though.

Good Luck with Ebay API.

Upvotes: 1

Related Questions