@deliverart/sdk-js-order 2.1.54 → 2.1.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -67,6 +67,21 @@ const order = await sdk.call(new CreateOrder({
67
67
  email: 'john@example.com',
68
68
  phoneNumber: '+39123456789'
69
69
  },
70
+ billingInfo: {
71
+ businessName: 'Acme Corp',
72
+ vat: 'IT12345678901',
73
+ taxCode: 'RSSMRA80A01H501U',
74
+ billingAddress: {
75
+ street: 'Via Fatturazione 10',
76
+ city: 'Milano',
77
+ postalCode: '20100',
78
+ country: 'IT'
79
+ },
80
+ billingData: {
81
+ recipientCode: 'ABCDEFG',
82
+ pec: 'billing@acmecorp.it'
83
+ }
84
+ },
70
85
  address: {
71
86
  street: 'Via Roma 1',
72
87
  city: 'Milano',
@@ -104,7 +119,7 @@ const order = await sdk.call(new CreateOrder({
104
119
  - `customer: string` (optional) - Customer IRI
105
120
  - `customerBusinessProfile: string` (optional) - Business profile IRI
106
121
  - `customerInfo: OrderCustomerInfo` (optional) - Customer contact info
107
- - `billingInfo: OrderBillingInfo` (optional) - Billing information
122
+ - `billingInfo: OrderBillingInfo` (optional) - Billing information (includes businessName, vat, taxCode, billingAddress, billingData)
108
123
  - `address: Address` (optional) - Delivery/collection address
109
124
  - `items: OrderMenuItem[]` (required) - Order items
110
125
  - `deliveryTime: string` (optional) - Requested delivery time (ISO 8601)
@@ -305,6 +320,27 @@ import { CalculateOrderFees } from '@deliverart/sdk-js-order';
305
320
  const fees = await sdk.call(new CalculateOrderFees({
306
321
  pointOfSale: '/point_of_sales/123',
307
322
  salesMode: '/sales_modes/456',
323
+ billingInfo: {
324
+ businessName: 'Acme Corp',
325
+ vat: 'IT12345678901',
326
+ taxCode: 'RSSMRA80A01H501U',
327
+ billingAddress: {
328
+ street: 'Via Fatturazione 10',
329
+ city: 'Milano',
330
+ postalCode: '20100',
331
+ country: 'IT'
332
+ },
333
+ billingData: {
334
+ recipientCode: 'ABCDEFG',
335
+ pec: 'billing@acmecorp.it'
336
+ }
337
+ },
338
+ address: {
339
+ street: 'Via Roma 1',
340
+ city: 'Milano',
341
+ postalCode: '20100',
342
+ country: 'IT'
343
+ },
308
344
  items: [
309
345
  {
310
346
  menuItem: '/menu_items/1',
@@ -322,8 +358,7 @@ fees.fees.forEach(fee => {
322
358
 
323
359
  **Parameters:**
324
360
  - Same as CreateOrder but only requires minimal fields
325
-
326
- **Response:** `FeeSimulation`
361
+ - `billingInfo: OrderBillingInfo` (optional) - Billing information (includes billingAddress)
327
362
 
328
363
  ---
329
364
 
@@ -398,6 +433,21 @@ async function orderWorkflow() {
398
433
  // Calculate fees first
399
434
  const fees = await sdk.call(new CalculateOrderFees({
400
435
  pointOfSale: '/point_of_sales/123',
436
+ billingInfo: {
437
+ businessName: 'Acme Corp',
438
+ vat: 'IT12345678901',
439
+ taxCode: 'RSSMRA80A01H501U',
440
+ billingAddress: {
441
+ street: 'Via Fatturazione 10',
442
+ city: 'Milano',
443
+ postalCode: '20100',
444
+ country: 'IT'
445
+ },
446
+ billingData: {
447
+ recipientCode: 'ABCDEFG',
448
+ pec: 'billing@acmecorp.it'
449
+ }
450
+ },
401
451
  items: [
402
452
  { menuItem: '/menu_items/1', quantity: 2, price: 1500 }
403
453
  ]
@@ -416,6 +466,21 @@ async function orderWorkflow() {
416
466
  email: 'john@example.com',
417
467
  phoneNumber: '+39123456789'
418
468
  },
469
+ billingInfo: {
470
+ businessName: 'Acme Corp',
471
+ vat: 'IT12345678901',
472
+ taxCode: 'RSSMRA80A01H501U',
473
+ billingAddress: {
474
+ street: 'Via Fatturazione 10',
475
+ city: 'Milano',
476
+ postalCode: '20100',
477
+ country: 'IT'
478
+ },
479
+ billingData: {
480
+ recipientCode: 'ABCDEFG',
481
+ pec: 'billing@acmecorp.it'
482
+ }
483
+ },
419
484
  address: {
420
485
  street: 'Via Roma 1',
421
486
  city: 'Milano',
@@ -456,4 +521,3 @@ async function orderWorkflow() {
456
521
  ## License
457
522
 
458
523
  MIT
459
-
package/dist/index.cjs CHANGED
@@ -11345,6 +11345,7 @@ var orderBillingInfoSchema = external_exports.object({
11345
11345
  businessName: external_exports.string(),
11346
11346
  vat: external_exports.string(),
11347
11347
  taxCode: external_exports.string(),
11348
+ billingAddress: import_sdk_js_global_types2.addressSchema,
11348
11349
  billingData: import_sdk_js_global_types2.billingDataSchema
11349
11350
  });
11350
11351
  var localeItemSchema = external_exports.object({
@@ -12024,7 +12025,9 @@ var AdvanceOrderPreparationStatus = class extends import_sdk_js_core11.AbstractA
12024
12025
  var import_sdk_js_core12 = require("@deliverart/sdk-js-core");
12025
12026
  var calculateOrderFeesInputSchema = writableOrderSchema.required().partial({
12026
12027
  customer: true,
12028
+ customerAddress: true,
12027
12029
  customerBusinessProfile: true,
12030
+ locationData: true,
12028
12031
  referenceBundle: true,
12029
12032
  partner: true,
12030
12033
  partnerIdentifier: true,
@@ -12055,7 +12058,7 @@ var CalculateOrderFees = class extends import_sdk_js_core12.AbstractApiRequest {
12055
12058
  this.headersSchema = void 0;
12056
12059
  }
12057
12060
  getPath() {
12058
- return "/orders";
12061
+ return "/orders/fees/calculate";
12059
12062
  }
12060
12063
  };
12061
12064