Skip to main content
Published: November 28 2005, 5:38:00 PMUpdated: November 28 2020, 1:47:11 PM

How to Combine Payments using AddOrder and SendInvoice

How to use Add Order and Send Invoice

This article describes how to test Add Order and Send Invoice for combined payments. The example here uses flat rate shipping services.

1. Create two items with flat rate shipping services. See Template 1 for a sample AddItem call. This template offers two flat rate shipping options, optional insurance, and sales tax for the state of California.
2. Purchase both items with the same buyer and use a shipping address from the state of California.
3. You will notice that when you call GetItemTransactions for each of these items, there will be a default shipping service selected populated. This is done in case the buyer does not select a service.
4. Now you can create a Seller Order to combine both items together. When creating the order, you need to re-specify the following information based on the combined items. Think of this step as created a new package, which contains all the items of the order. You need to re-specify details related to shipping, insurance and tax.
a. Shipping Options: You will need to re-specify shipping options for the order, which represent the shipping cost for all the items of the order. The shipping service cost should represent the cost to ship all items, and the additional shipping cost does not apply any more.
b. Tax: You will need to re-specify text for the order, which represent the tax amount for all the items of the order. When calculating the tax, make sure that the tax state matches that of the Shipping Address state.
c. Insurance: You will need to re-specify the insurance amount of the order, which represents the insurance amount for the entire order.
d. Payment Options: You can revise any payment options you wish to offer to the buyer.
e. Total Amount: You must enter the total amount for the transaction which includes the cost of the items plus shipping, tax and insurance.
f. Subtotal Amount: Enter the subtotal, which includes only the cost of the items

5. Once the order is created, the new values you have set will be displayed to a user when they go through eBay Checkout flow. Based on the shipping option selected by the user, the <ShippingServiceSelected> value will be updated to reflect the shipping service chosen by the buyer. Please note that eBay sets the <ShippingServiceSelected> to the Priority 1 shipping service by default, in case it is never set by the buyer.

6. If all the values in the order are correct, you can call Send Invoice, with only the Order ID. This will generate an invoice with all the current settings. SendInvoice does not support any additional parameters when used for Orders. Therefore all the information represented in the Invoice will be taken from the Order.

AddItemTemplate:

<?xml version="1.0" encoding="utf-8"?>
<AddItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<DetailLevel>ItemReturnDescription</DetailLevel>
<Version>437</Version>
<Item>
<BuyItNowPrice>10.0</BuyItNowPrice>
<Country>US</Country>
<Currency>USD</Currency>
<Description>Test Item Description</Description>
<ListingDuration>Days_1</ListingDuration>
<Location>San Jose, CA</Location>
<PaymentMethods>PersonalCheck</PaymentMethods>
<PrimaryCategory>
<CategoryID>357</CategoryID>
</PrimaryCategory>
<Quantity>1</Quantity>
<RegionID>0</RegionID>
<ReservePrice>5.0</ReservePrice>
<StartPrice>1.0</StartPrice>
<ShippingTermsInDescription>False</ShippingTermsInDescription>
<Title>Test Item with Flat Rate Shipping</Title>
<ShippingDetails>
<InsuranceFee currencyID="USD">15.00</InsuranceFee>
<InsuranceOption>Optional</InsuranceOption>
<PaymentInstructions>I will add up Shipping, Insurance, and Tax and send you an Inovice</PaymentInstructions>
<SalesTax>
<SalesTaxPercent>8.5</SalesTaxPercent>
<SalesTaxState>CA</SalesTaxState>
<ShippingIncludedInTax>false</ShippingIncludedInTax>
</SalesTax>
<ShippingServiceOptions>
<ShippingInsuranceCost currencyID="USD">0</ShippingInsuranceCost>
<ShippingService>UPSGround</ShippingService>
<ShippingServiceCost currencyID="USD">5</ShippingServiceCost>
<ShippingServiceAdditionalCost currencyID="USD">2</ShippingServiceAdditionalCost>
<ShippingServicePriority>1</ShippingServicePriority>
</ShippingServiceOptions>
<ShippingServiceOptions>
<ShippingInsuranceCost currencyID="USD">0</ShippingInsuranceCost>
<ShippingService>UPS3rdDay</ShippingService>
<ShippingServiceCost currencyID="USD">10</ShippingServiceCost>
<ShippingServiceAdditionalCost currencyID="USD">4</ShippingServiceAdditionalCost>
<ShippingServicePriority>2</ShippingServicePriority>
</ShippingServiceOptions>
</ShippingDetails>
</Item>
<RequesterCredentials>
<eBayAuthToken>testtoken</eBayAuthToken>
</RequesterCredentials>
</AddItemRequest>


AddOrder Template
<?xml version="1.0" encoding="utf-8"?>
<AddOrderRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<Version>437</Version>
<Order>
<CreatingUserRole>Seller</CreatingUserRole>
<PaymentMethods>PayPal</PaymentMethods>
<SubTotal currencyID="USD">20.00</SubTotal>
<Total currencyID="USD">31.70</Total>
<TransactionArray>
<Transaction>
<Item>
<ItemID>4504032539</ItemID>
</Item>
<TransactionID>0</TransactionID>
</Transaction>
<Transaction>
<Item>
<ItemID>4504032541</ItemID>
</Item>
<TransactionID>0</TransactionID>
</Transaction>
</TransactionArray>
<ShippingDetails>
<AllowPaymentEdit>true</AllowPaymentEdit>
<ApplyShippingDiscount>false</ApplyShippingDiscount>
<InsuranceOption>Optional</InsuranceOption>
<SalesTax>
<SalesTaxPercent>8.5</SalesTaxPercent>
<SalesTaxState>CA</SalesTaxState>
<ShippingIncludedInTax>false</ShippingIncludedInTax>
</SalesTax>
<ShippingServiceOptions>
<ShippingInsuranceCost currencyID="USD">30</ShippingInsuranceCost>
<ShippingService>UPSGround</ShippingService>
<ShippingServiceCost currencyID="USD">10</ShippingServiceCost>
<ShippingServicePriority>1</ShippingServicePriority>
</ShippingServiceOptions>
<ShippingServiceOptions>
<ShippingInsuranceCost currencyID="USD">30</ShippingInsuranceCost>
<ShippingService>UPS3rdDay</ShippingService>
<ShippingServiceCost currencyID="USD">20</ShippingServiceCost>
<ShippingServicePriority>2</ShippingServicePriority>
</ShippingServiceOptions>
<ThirdPartyCheckout>false</ThirdPartyCheckout>
<TaxTable/>
</ShippingDetails>
</Order>
<RequesterCredentials>
<eBayAuthToken>testtoken</eBayAuthToken>
</RequesterCredentials>
</AddOrderRequest>

Send Invoice Template
<?xml version="1.0" encoding="utf-8"?>
<SendInvoiceRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>testtoken</eBayAuthToken>
</RequesterCredentials>
<Version>399</Version>
<ErrorLanguage>en_US</ErrorLanguage>
<OrderID>11691</OrderID>
<TransactionID>0</TransactionID>
<CheckoutInstructions>test</CheckoutInstructions>
<EmailCopyToSeller>true</EmailCopyToSeller>
</SendInvoiceRequest>

How well did this answer your question?
Answers others found helpful