Rashed Ehsan
Rashed Ehsan

Reputation: 119

XERO send Invoice through email

I have integrated XERO with my php(codeigniter) website, everything i have implemented is working just fine. I want to send the invoice through an email i have created.

I am using XeroOAuth.

//This line is working properly
$response = $this->XeroOAuth->request('GET', $this->XeroOAuth->url('Invoices/'.$invoiceId, 'core'), array(), "", 'pdf');


//but cant send email through xero api
$send_email = $this->XeroOAuth->request('POST', $this->XeroOAuth->url('Invoices/'.$invoiceId.'/Email', 'core'), array() );

As their documentation explain that, this line of code should trigger the xero send mail option, but its returning error 401

Upvotes: 2

Views: 472

Answers (1)

ABTanjir
ABTanjir

Reputation: 126

try using XERO PHP and you can easily send invoice using,

$invoice->sendMail();

Upvotes: 1

Related Questions