I am trying to create a sales order using the Acumatica Web Service API. I have been able to pass all the required fields except the Payment Settings. Our installation uses the Authorize.NET (PX.CCProcessing.AuthorizeNetTokenizedProcessing) add-in. Is it possible to interact with the Authorize.NET add-in through the API by creating a new payment method and authorizing payment so that the employees can work the order from within Acumatica and capture the payment there.
Below is the code I am using to create my sales order. I am not sure the structure to use in order to activate the "Create New Payment Profile ID" action through the API itself. Through the GUI, it opens a popup window that copies the card to Authorize.Net and saves a Payment Profile ID record within Acumatica.
SO301000Content SO301000 = context.SO301000GetSchema();
context.SO301000Clear();
SO301000Content[] SO30100content = context.SO301000Submit
(
new Command[]
{
//add header info
new Value { Value = "SO", LinkedCommand = SO301000.OrderSummary.OrderType },
new Value { Value = "<NEW>", LinkedCommand = SO301000.OrderSummary.OrderNbr },
new Value { Value = "999999", LinkedCommand = SO301000.OrderSummary.Customer },
//add line items
SO301000.DocumentDetails.ServiceCommands.NewRow,
new Value { Value = "SS1121", LinkedCommand = SO301000.DocumentDetails.InventoryID },
new Value { Value = "2", LinkedCommand = SO301000.DocumentDetails.Quantity },
SO301000.DocumentDetails.ServiceCommands.NewRow,
new Value { Value = "SS1122", LinkedCommand = SO301000.DocumentDetails.InventoryID },
new Value { Value = "2", LinkedCommand = SO301000.DocumentDetails.Quantity },
SO301000.DocumentDetails.ServiceCommands.NewRow,
new Value { Value = "SS1123", LinkedCommand = SO301000.DocumentDetails.InventoryID },
new Value { Value = "2", LinkedCommand = SO301000.DocumentDetails.Quantity },
//add shipping information
new Value { Value = "True", LinkedCommand = SO301000.ShippingSettingsShipToInfoOverrideContact.OverrideContact },
new Value { Value = "DEMO CHURCH SHIP", LinkedCommand = SO301000.ShippingSettingsShipToInfoOverrideContact.BusinessName },
new Value { Value = "True", LinkedCommand = SO301000.ShippingSettingsShipToInfo.OverrideAddress },
new Value { Value = "123 TEST STREET", LinkedCommand = SO301000.ShippingSettingsShipToInfo.AddressLine1 },
new Value { Value = "BUFORD", LinkedCommand = SO301000.ShippingSettingsShipToInfo.City },
new Value { Value = "GA", LinkedCommand = SO301000.ShippingSettingsShipToInfo.State },
new Value { Value = "30519", LinkedCommand = SO301000.ShippingSettingsShipToInfo.PostalCode },
new Value { Value = "FREESHIP", LinkedCommand = SO301000.ShippingSettingsShippingInformation.ShipVia },
//add totals
new Value { Value = "10.00", LinkedCommand = SO301000.Totals.PremiumFreight },
new Value { Value = "94.0000", LinkedCommand = SO301000.Totals.PackageWeight },
//add payment
SO301000.Actions.Save,
SO301000.OrderSummary.OrderNbr
}
);
New Code Error - I am now able to insert the customer payment record but receive an error when trying to insert that card into an existing sales order.
Here is my code:
SO301000Content SO301000 = context.SO301000GetSchema();
context.SO301000Clear();
SO301000Content[] SO30100content = context.SO301000Submit
(
new Command[]
{
//add header info
new Value { Value = "SO", LinkedCommand = SO301000.OrderSummary.OrderType },
new Value { Value = "000129", LinkedCommand = SO301000.OrderSummary.OrderNbr },
//add payment
new Value { Value = "VISA", LinkedCommand = SO301000.PaymentSettings.PaymentMethod },
new Value { Value = "VISA:****-****-****-7261", LinkedCommand = SO301000.PaymentSettings.CardAccountNo },
SO301000.Actions.Save
}
);
If anybody has any ideas, I would greatly appreciate it. Thanks.