pay invoices from API

2 REPLIES
Partner MaheshSpadez
2 Posts
Partner
Australia
MaheshSpadez

2Posts

0Kudos

0Solutions

Re: pay invoices from API

I emailed. but if you provide piece of code how to post payment in myob API will sovle. 

MYOB Staff Post DeveloperJack
65 Posts
MYOB Staff Post
Australia
DeveloperJack
MYOB Staff Post

65Posts

21Kudos

7Solutions

Re: pay invoices from API

Hi there @MaheshSpadez,

An ApiCommunicationException has an 'errors' field that includes more detail about the error. Specifically, it contains the JSON error details in the HTTP response from the API. If you have trouble understanding error messages in that exception/response the best course of action is to reach out to the developers@myob.com support team where we can help offer some specific advice for your case.

Cheers,

Jack

Jack Skinner
MYOBapi Evangelist

Are you a developer? Check out http://developer.myob.com
Looking for an Add-on? Check out http://myob.com/addons/
Partner MaheshSpadez
2 Posts
Partner
Australia
MaheshSpadez

2Posts

0Kudos

0Solutions

pay invoices from API

Hi, 

I want to pay invoices from API, follwoing thigs I am doing:

creating object of  CustomerPayment Services

selecting one entity, right now just first one for hack of development.

then setting the payment property. but Update method giveing error. 

Please help me, code is below

 

 

var PayInvoice = new MYOB.AccountRight.SDK.Services.Sale.CustomerPaymentService(APIConfiguration, null, KeyService);

 

var payThis = PayInvoice.GetRange(CompanyFile, "", CompanyCredential).Items.FirstOrDefault();
payThis.UID = new Guid();

payThis.AmountReceived = 5.00M;
payThis.DepositTo = DepositTo.UndepositedFunds;
payThis.PaymentMethod = "Cash";
payThis.ReceiptNumber = "12345678";
payThis.Memo = "Memo";


payThis.Date = Convert.ToDateTime("2018-01-10 11:33:02");
payThis.Created = Convert.ToDateTime("2018-01-10 11:33:02");
payThis.LastModified = Convert.ToDateTime("2018-01-10 11:33:02");

PayInvoice.Update(CompanyFile, payThis, CompanyCredential,ErrorLevel.IgnoreWarnings);

 

I channged the funciton and set UpdateEx 

   PayInvoice.UpdateEx(CompanyFile, payThis, CompanyCredential, ErrorLevel.WarningsAsErrors);

now communicaiton error is comming. 

Please help

 

 

 

Didn't find your answer here?
Try using advanced search to find a post more easily Advanced Search
or
Get the conversation started and make a new post Start a Post