I am writing a sample quickfix application and am trying to do a NewOrderSingle. However I am getting a message
In fromApp–>OnMessgge.–>executionReport–>

8=FIX.4.4|9=277|35=8|34=2|49=FXALL|52=20190617-11:04:09.955|56=paypal|6=0.|11=APPL12456S|14=0|15=CAD|17=REJECT-1003511248|31=0.|32=0|37=REJECT-1003511248|38=2|39=8|40=1|54=1|55=USD/CAD|58=Invalid Account (User Account Mapping not valid)|60=20190617-11:04:09.928|64=20190628|103=99|150=8|151=0|10=141|

Here is my NewOrderSingle request-

NewOrderSingle newOrder = new NewOrderSingle();
newOrder.set(new TransactTime(new Date()));

newOrder.set(new Symbol("USD/CAD"));
newOrder.set(new ClOrdID("APPL12456S"));
newOrder.set(new OrderQty(2));
// newOrder.set(new SettlDate("01-22-2019"));
newOrder.set(new SettlDate("20190628"));
newOrder.set(new HandlInst(HandlInst.MANUAL_ORDER));
newOrder.set(new Price(200.9d));

newOrder.set(new Currency("CAD"));
newOrder.set(new NoAllocs(1));
newOrder.set(new Side(Side.BUY));
newOrder.set(new OrdType(OrdType.MARKET));
newOrder.setField(new AllocAccount("test"));
newOrder.setField(new AllocShares(new Double("150")));
System.out.println("New order message send-before - ");

boolean sent = Session.lookupSession(sessionID).sendToTarget(newOrder, sessionID);
System.out.println("New order message send-after - " + sent);

I have specified AllocAccount but not sure if I need to specify anything else.
Few questions

  1. How do I specify the password corresponding to this account.
  2. How will the server know if only authorized people are accessing this account.
  3. Also is there a way to make the communication synchronous.
    Seeing this message in the log file-

    15:55:23.318 [DefaultThreadPool-1] INFO quickfix.mina.NetworkingOptions Socket option: SocketSynchronousWrites=false

2

This error message:

58=Invalid Account (User Account Mapping not valid

is coming from your counterparty, not FIX itself. They received your message, but they didn’t like the information that you put in the fields.

FIX is only about transmitting messages, not ensuring that you didn’t screw up what you put in them!

You need to review your counterparty’s documentation, or perhaps check with their tech support. If I had to guess, I’d say that your AllocAccount value “test” is not the name of a valid account.

To your questions:

  1. How do I specify the password corresponding to this account.

    Normally you’d use tag 554 in the login message. However, you don’t need this for your counterparty. You’ve already connected!

    If you have further questions, read your counterparty’s documentation again.

  2. How will the server know if only authorized people are accessing this account.

    There’s a few ways. They might whitelist your IP domain. They might make you use a user/password in the login message. They might make you use a SSL certificate. Whatever they do, you’ve done it, because you already connected!

    If you have further questions, read your counterparty’s documentation again.

  3. Also is there a way to make the communication synchronous. (includes error message)

    Frankly, I don’t know what this error message means, and I’ve been working with various QuickFIXes for 10 years. And it’s not actually the source of your problems. Ignore it for now.