getMerchantInfo()->setEmail()` with the third party merchant email you retrieved from Step 2. $invoice = new Invoice(); // ### Invoice Info // Fill in all the information that is // required for invoice APIs $invoice ->setMerchantInfo(new MerchantInfo()) ->setBillingInfo(array(new BillingInfo())) ->setNote("Medical Invoice 16 Jul, 2013 PST") ->setPaymentTerm(new PaymentTerm()); // ### Merchant Info // A resource representing merchant information that can be // used to identify merchant $invoice->getMerchantInfo() // This would be the email address of third party merchant. ->setEmail($thirdPartyMerchant) ->setFirstName("Dennis") ->setLastName("Doctor") ->setbusinessName("Medical Professionals, LLC") ->setAddress(new InvoiceAddress()); // ### Address Information // The address used for creating the invoice $invoice->getMerchantInfo()->getAddress() ->setLine1("1234 Main St.") ->setCity("Portland") ->setState("OR") ->setPostalCode("97217") ->setCountryCode("US"); // ### Billing Information // Set the email address for each billing $billing = $invoice->getBillingInfo(); $billing[0] ->setEmail("sample@buy.com"); $billing[0]->setBusinessName("Jay Inc") ->setAdditionalInfo("This is the billing Info") ->setAddress(new InvoiceAddress()); $billing[0]->getAddress() ->setLine1("1234 Main St.") ->setCity("Portland") ->setState("OR") ->setPostalCode("97217") ->setCountryCode("US"); // ### Items List // You could provide the list of all items for // detailed breakdown of invoice $items = array(); $items[0] = new InvoiceItem(); $items[0] ->setName("Sutures") ->setQuantity(100) ->setUnitPrice(new Currency()); $items[0]->getUnitPrice() ->setCurrency("USD") ->setValue(5); $invoice->getPaymentTerm() ->setTermType("NET_45"); // For Sample Purposes Only. $request = clone $invoice; try { // ### Use Refresh Token obtained from Step 1. $invoice->updateAccessToken($refreshToken, $apiContext); // ### Create Invoice // Create an invoice by calling the invoice->create() method // with a valid ApiContext (See bootstrap.php for more on `ApiContext`) $invoice->create($apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY ResultPrinter::printError("Create Third Party Invoice", "Invoice", null, $request, $ex); exit(1); } // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY ResultPrinter::printResult("Create Third Party Invoice", "Invoice", $invoice->getId(), $request, $invoice); // ### Send Invoice try { // ### Send Invoice $invoice->send($apiContext); $invoice = Invoice::get($invoice->getId(), $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY ResultPrinter::printError("Send Third Party Invoice", "Invoice", null, $request, $ex); exit(1); } // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY ResultPrinter::printResult("Send Third Party Invoice", "Invoice", $invoice->getId(), $request, $invoice); return $invoice;