Showing results for 
Search instead for 
Did you mean: 


I receive my token just fine, what are the next steps to set up the form fields for the post to


Do I call certain API's, a little confused by the docs on this REST interface?  


When I call :

$lineItem1 = new AnetAPI\LineItemType();




Is this really generating the XML to be sent.


Do I need to use the API to correctly generate the XML for AN to accept it?


I have had a working version som SIM for over 8 years and the conversion is causing lots of problems, I use REST interfaces on other interfaces and they usually create a code example of a start to finish, I have looked at the ones on GitHub, but they all seem to assume facts not in evidence!


I am hoping one of you experts can lend me a hand on this.









The API does the conversion for you when you set those objects. You do not have to use any special encoding or formatting that you wouldn't ordinarily use in your application. You still have to supply elements of the right type.  So $transactionRequest->setLineItems() will expect an array. But beyond doing type matching like this, it's business as usual.


As far as sending pure XML, it works.  I have never done it but you can. I personally find it much easier to use the SDK package, but if that works for you you can surely do it. 

All Star

Thanks for the feed back,

currently when my page returns I just get two


Order Summary


with two buttons


any Ideas? is there a typical order to call the API in?


So you are saying that when you call an Accept Hosted Payment Form you get a form that has only those fields?




function add_line_item($item_id,$name,$desc,$qty,$unit_price,$taxalbe=0)
           $lineItem1 = new AnetAPI\LineItemType();
           $lineItem1->setTaxable(0); // 1 Yes 0 for no
           $this->lineItems_ary[$this->liinc++] = $lineItem1;





ERROR: E00003 The element 'lineItem' in namespace 'AnetApi/xml/v1/sche
ma/AnetApiSchema.xsd' has invalid child element 'quantity' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. List of possible elements expected: 'itemId' in namespace 'Ane


So for your form you need to add settings to the hosted payment form. There are a bunch of them. Here is an example snippet of code that will get the email address field to populate.


$setting4->setSettingValue( "{\"showEmail\": true, \"requiredEmail\": true}");


You can add several values to any setting, given that the setting supports that value. 

Is there by chance a   list of these somewhere I could review or a typical list that people set?


Yes in the API docs for the hosted form.  


Here is a good place to start.



I think there are some also in the main API reference. Click the API tab at the top of this forum and then go to the link on the right for "Accept Suite".

That error reponse you are getting isn't something I can figure out, as I am not familiar with that syntax. Is that coldfusion you are using?