Create Order via Apex
Map<String, Object> billing = new Map<String, Object>();
billing.put('firstName', 'Test First Name');
billing.put('lastName', 'Billing');
billing.put('country', 'GB');
billing.put('address2', '');
billing.put('city', 'London');
billing.put('address1', '4 Leathermarket St, Weston St');
billing.put('buildingNumber', '4');
billing.put('streetName', 'Leathermarket St');
billing.put('postalCode', 'SE1 3ER');
billing.put('company', '');
billing.put('state', 'London');
billing.put('customFields', new Map<String, Object>());
Map<String, Object> delivery = new Map<String, Object>();
delivery.put('firstName', 'Test First Name');
delivery.put('lastName', 'Delivery');
delivery.put('country', 'GB');
delivery.put('address2', '');
delivery.put('city', 'London');
delivery.put('address1', '4 Leathermarket St, Weston St');
delivery.put('buildingNumber', '4');
delivery.put('streetName', 'Leathermarket St');
delivery.put('postalCode', 'SE1 3ER');
delivery.put('company', '');
delivery.put('state', 'London');
delivery.put('customFields', new Map<String, Object>());
Contact c = [SELECT id, firstName, lastName, email, accountId FROM contact LIMIT 1];
Map<String, Object> tracking = new Map<String, Object>();
tracking.put('contactId', c.id);
tracking.put('accountId', c.accountId);
i42as.LimioOrder_Acquisition.OrderRequest request = new i42as.LimioOrder_Acquisition.OrderRequest();
request.country = 'GB';
request.offerPath = '/offers2/Digital offer';
request.offerId = null;
request.tracking = tracking;
request.billingAddress = billing;
request.deliveryAddress = delivery;
request.contact = c;
request.invoicePref = 'Email';
Object result = i42as.LimioOrder_Acquisition.processInvoiceLimioOrder(request);Last updated
Was this helpful?

