ONDC-Official / log-validation-utility

log-validation-utility
1 stars 26 forks source link

Getting discrepancy in quote in on_select, on_init, confirm, and on_confirm #4

Closed himanshu-kumar-zs closed 6 months ago

himanshu-kumar-zs commented 10 months ago

we are sending multiple fulfilments in on_select and only one fulfillment which is selected by the buyer in on_init, but the utility is giving discrepancy in quotes and also it is giving "brkupfftitles3": "invalid id: DUNZO:DUNZO:PT34M in delivery line item (should be a valid fulfillment_id)" error.

Payload of on_select

{
  "context": {
    "action": "on_select",
    "bap_id": "buyer-app.ondc.org",
    "bap_uri": "https://buyer-app.ondc.org/protocol/v1",
    "bpp_id": "ondc-demo.staging.zopsmart.com/ondc",
    "bpp_uri": "https://ondc-demo.staging.zopsmart.com/ondc",
    "city": "std:080",
    "core_version": "1.2.0",
    "country": "IND",
    "domain": "ONDC:RET10",
    "message_id": "a9b84338-6bb7-479b-a12f-218d7336a24a",
    "timestamp": "2023-11-09T11:48:25Z",
    "transaction_id": "a743739f-fd53-466c-ab87-429e580c10b1",
    "ttl": "PT30S"
  },
  "message": {
    "order": {
      "fulfillments": [
        {
          "@ondc/org/TAT": "PT29M",
          "@ondc/org/category": "Immediate Delivery",
          "@ondc/org/provider_name": "ONDC Demo",
          "id": "F:2023-11-09:813:PT29M",
          "provider_id": "3419",
          "state": {
            "descriptor": {
              "code": "Serviceable"
            }
          },
          "tracking": false,
          "type": "Delivery"
        },
        {
          "@ondc/org/TAT": "PT34M",
          "@ondc/org/category": "Immediate Delivery",
          "@ondc/org/provider_name": "DUNZO",
          "id": "DUNZO:DUNZO:PT34M",
          "state": {
            "descriptor": {
              "code": "Serviceable"
            }
          },
          "tracking": true,
          "type": "Delivery"
        }
      ],
      "items": [
        {
          "fulfillment_id": "F:2023-11-09:813:PT29M",
          "id": "2284951"
        }
      ],
      "provider": {
        "id": "ondc-demo.staging.zopsmart.com/ondc",
        "locations": [
          {
            "id": "3419"
          }
        ]
      },
      "provider_location": {
        "id": ""
      },
      "quote": {
        "breakup": [
          {
            "@ondc/org/item_id": "2284951",
            "@ondc/org/item_quantity": {
              "count": 1
            },
            "@ondc/org/title_type": "item",
            "item": {
              "@ondc/org/return_window": "",
              "@ondc/org/returnable": false,
              "@ondc/org/seller_pickup_return": false,
              "id": "",
              "price": {
                "currency": "INR",
                "value": "80.00"
              },
              "quantity": {
                "available": {
                  "count": "535"
                },
                "maximum": {
                  "count": "535"
                }
              }
            },
            "price": {
              "currency": "INR",
              "value": "80.00"
            },
            "title": "1ltr"
          },
          {
            "@ondc/org/item_id": "2284951",
            "@ondc/org/title_type": "discount",
            "price": {
              "currency": "INR",
              "value": "-5.00"
            },
            "title": "Discount"
          },
          {
            "@ondc/org/item_id": "F:2023-11-09:813:PT29M",
            "@ondc/org/title_type": "delivery",
            "price": {
              "currency": "INR",
              "value": "0.00"
            },
            "title": "Delivery charges"
          },
          {
            "@ondc/org/item_id": "DUNZO:DUNZO:PT34M",
            "@ondc/org/title_type": "delivery",
            "price": {
              "currency": "INR",
              "value": "0.00"
            },
            "title": "Delivery charges"
          },
          {
            "@ondc/org/item_id": "F:2023-11-09:813:PT29M",
            "@ondc/org/title_type": "misc",
            "price": {
              "currency": "INR",
              "value": "2.655"
            },
            "title": "Convenience Fee"
          }
        ],
        "price": {
          "currency": "INR",
          "value": "77.66"
        },
        "ttl": "PT15M"
      }
    }
  }
}

Payload of on_init

{
  "context": {
    "action": "on_init",
    "bap_id": "buyer-app.ondc.org",
    "bap_uri": "https://buyer-app.ondc.org/protocol/v1",
    "bpp_id": "ondc-demo.staging.zopsmart.com/ondc",
    "bpp_uri": "https://ondc-demo.staging.zopsmart.com/ondc",
    "city": "std:080",
    "core_version": "1.2.0",
    "country": "IND",
    "domain": "ONDC:RET10",
    "message_id": "43bc6eea-4a2a-4401-9d75-2c00ae848ce2",
    "timestamp": "2023-11-09T11:48:38.546Z",
    "transaction_id": "a743739f-fd53-466c-ab87-429e580c10b1",
    "ttl": "PT30S"
  },
  "message": {
    "order": {
      "billing": {
        "address": {
          "area_code": "560102",
          "building": "near apollo pharmacy",
          "city": "Bengaluru",
          "country": "IND",
          "door": "near apollo pharmacy",
          "locality": "24th main road 25th cross road hsr layout sector 2",
          "name": "himanshu dunzo",
          "state": "Karnataka"
        },
        "created_at": "2023-11-09T11:48:38.546Z",
        "email": "himanshu.kumar+dunz@zopsmart.com",
        "name": "himanshu dunzo",
        "phone": "8084860505",
        "updated_at": "2023-11-09T11:48:38.546Z"
      },
      "cancellationTerms": [
        {
          "cancellation_fee": {
            "amount": {
              "currency": "INR",
              "value": "0"
            }
          },
          "fulfillment_state": {
            "descriptor": {
              "code": "Pending",
              "short_desc": "001,003,006,010"
            }
          },
          "reason_required": true,
          "refund_eligible": true
        },
        {
          "cancellation_fee": {
            "amount": {
              "currency": "INR",
              "value": "0"
            }
          },
          "fulfillment_state": {
            "descriptor": {
              "code": "Packed",
              "short_desc": "001,003,006,010"
            }
          },
          "reason_required": true,
          "refund_eligible": true
        }
      ],
      "fulfillments": [
        {
          "end": {
            "contact": {
              "email": "himanshu.kumar+dunz@zopsmart.com",
              "phone": "8084860505"
            },
            "location": {
              "address": {
                "area_code": "560102",
                "building": "near apollo pharmacy",
                "city": "Bengaluru",
                "country": "IND",
                "locality": "24th main road 25th cross road hsr layout sector 2",
                "name": "himanshu dunzo",
                "state": "Karnataka"
              },
              "gps": "12.9140160000001, 77.6371740000001"
            }
          },
          "id": "F:2023-11-09:813:PT29M",
          "tracking": false,
          "type": "Delivery"
        }
      ],
      "items": [
        {
          "fulfillment_id": "F:2023-11-09:813:PT29M",
          "id": "2284951",
          "quantity": {
            "count": 1
          }
        }
      ],
      "payment": {
        "@ondc/org/buyer_app_finder_fee_amount": "3.00",
        "@ondc/org/buyer_app_finder_fee_type": "percent",
        "@ondc/org/settlement_basis": "",
        "@ondc/org/settlement_details": [
          {
            "bank_name": "",
            "beneficiary_name": "",
            "branch_name": "",
            "settlement_bank_account_no": "",
            "settlement_counterparty": "seller-app",
            "settlement_ifsc_code": "",
            "settlement_phase": "sale-amount",
            "settlement_timestamp": "",
            "settlement_type": "upi",
            "upi_address": "9876543210@ybl"
          }
        ],
        "@ondc/org/settlement_window": "",
        "@ondc/org/withholding_amount": ""
      },
      "provider": {
        "id": "ondc-demo.staging.zopsmart.com/ondc",
        "locations": [
          {
            "id": "3419"
          }
        ]
      },
      "provider_location": {
        "id": "3419"
      },
      "quote": {
        "breakup": [
          {
            "@ondc/org/item_id": "2284951",
            "@ondc/org/item_quantity": {
              "count": 1
            },
            "@ondc/org/title_type": "item",
            "item": {
              "@ondc/org/return_window": "",
              "@ondc/org/returnable": false,
              "@ondc/org/seller_pickup_return": false,
              "id": "",
              "price": {
                "currency": "INR",
                "value": "80.00"
              }
            },
            "price": {
              "currency": "INR",
              "value": "80.00"
            },
            "title": "1ltr"
          },
          {
            "@ondc/org/item_id": "2284951",
            "@ondc/org/title_type": "discount",
            "price": {
              "currency": "INR",
              "value": "-5.00"
            },
            "title": "Discount"
          },
          {
            "@ondc/org/item_id": "F:2023-11-09:813:PT29M",
            "@ondc/org/title_type": "delivery",
            "price": {
              "currency": "INR",
              "value": "0.00"
            },
            "title": "Delivery charges"
          },
          {
            "@ondc/org/item_id": "F:2023-11-09:813:PT29M",
            "@ondc/org/title_type": "misc",
            "price": {
              "currency": "INR",
              "value": "2.655"
            },
            "title": "Convenience Fee"
          }
        ],
        "price": {
          "currency": "INR",
          "value": "77.66"
        },
        "ttl": "PT15M"
      }
    }
  }
}
sandeepshahi commented 10 months ago

@himanshu-kumar-zs, The utility currently only supports Phase-1 of v1.2. As it is part of Phase 2, multiple fulfillment options are not yet supported, and the utility may generate outputs indicating such issues. The recommendation is to disregard any warnings or issues related to Phase 2 when using the utility.