В общем сделал так и заработало:
интерфейс
public interface APIv1 {
@Multipart
@POST("/api/v1/order/create")
Call<ResponseBody> SendOrder(@PartMap Map<String, RequestBody> params);
}
упаковка параметров:
RequestBody rb;
LinkedHashMap<String, RequestBody> mp= new LinkedHashMap<>();
rb = RequestBody.create(MediaType.parse("text/plain"), String.valueOf((int)OrderProducts.getBoxSumm()));
mp.put("price", rb);
rb = RequestBody.create(MediaType.parse("text/plain"), "1");
mp.put("number_person", rb);
rb = RequestBody.create(MediaType.parse("text/plain"), "cash");
mp.put("payment_type", rb);
rb = RequestBody.create(MediaType.parse("text/plain"), "yes");
mp.put("delivery", rb);
rb = RequestBody.create(MediaType.parse("text/plain"), this.clientname);
mp.put("client[name]", rb);
rb = RequestBody.create(MediaType.parse("text/plain"), this.clientphone);
mp.put("client[phone]", rb);
rb = RequestBody.create(MediaType.parse("text/plain"), this.clientaddress);
mp.put("client[address]", rb);
List<OrderProducts> orderProducts = OrderProducts.getOrderProductsNew();
for (int i = 0; i < orderProducts.size(); i++) {
OrderProducts p = orderProducts.get(i);
Product product = Product.getProductById(p.productid);
if (product != null) {
rb = RequestBody.create(MediaType.parse("text/plain"), String.valueOf(product.extid));
mp.put("products["+ String.valueOf(i)+"][product_id]", rb);
rb = RequestBody.create(MediaType.parse("text/plain"), String.valueOf(p.amount));
mp.put("products["+ String.valueOf(i)+"][amount]", rb);
}
}
выполнение запроса:
Call<ResponseBody> call = intface.SendOrder(mp);
call.enqueue(new Callback<ResponseBody>() {
@Override
public void onResponse(Call<ResponseBody> call, retrofit2.Response<ResponseBody> response) {
Log.v("Upload", "success");
}
@Override
public void onFailure(Call<ResponseBody> call, Throwable t) {
Log.e("Upload error:", t.getMessage());
}
});