From 72f1d36920948bd580c7d4a71e4f066623beae1a Mon Sep 17 00:00:00 2001 From: Rajaneesh Date: Wed, 17 Jan 2024 09:39:58 +0530 Subject: [PATCH 01/26] adding enum definitions --- api/enums/Ack-Status.json | 4 ++++ api/enums/Cancellation-Type.json | 4 ++++ api/enums/Error-Type.json | 7 +++++++ api/enums/Payment-Status.json | 4 ++++ api/enums/Payment-TL_method.json | 4 ++++ api/enums/Payment-Type.json | 6 ++++++ api/enums/Quotation-Breakup-Type.json | 6 ++++++ api/enums/Rating-Direction.json | 4 ++++ api/enums/Scalar-Type.json | 4 ++++ api/enums/Subscriber-Status.json | 7 +++++++ api/enums/Subscriber-Type.json | 7 +++++++ api/enums/Support-Type.json | 5 +++++ api/enums/Tracking-Status.json | 4 ++++ api/enums/Tracking-TL_method.json | 4 ++++ 14 files changed, 70 insertions(+) create mode 100644 api/enums/Ack-Status.json create mode 100644 api/enums/Cancellation-Type.json create mode 100644 api/enums/Error-Type.json create mode 100644 api/enums/Payment-Status.json create mode 100644 api/enums/Payment-TL_method.json create mode 100644 api/enums/Payment-Type.json create mode 100644 api/enums/Quotation-Breakup-Type.json create mode 100644 api/enums/Rating-Direction.json create mode 100644 api/enums/Scalar-Type.json create mode 100644 api/enums/Subscriber-Status.json create mode 100644 api/enums/Subscriber-Type.json create mode 100644 api/enums/Support-Type.json create mode 100644 api/enums/Tracking-Status.json create mode 100644 api/enums/Tracking-TL_method.json diff --git a/api/enums/Ack-Status.json b/api/enums/Ack-Status.json new file mode 100644 index 0000000..6a2e8dc --- /dev/null +++ b/api/enums/Ack-Status.json @@ -0,0 +1,4 @@ +[ + "ACK", + "NACK" +] \ No newline at end of file diff --git a/api/enums/Cancellation-Type.json b/api/enums/Cancellation-Type.json new file mode 100644 index 0000000..59a0228 --- /dev/null +++ b/api/enums/Cancellation-Type.json @@ -0,0 +1,4 @@ +[ + "Full", + "Partial" +] \ No newline at end of file diff --git a/api/enums/Error-Type.json b/api/enums/Error-Type.json new file mode 100644 index 0000000..2f684cc --- /dev/null +++ b/api/enums/Error-Type.json @@ -0,0 +1,7 @@ +[ + "CONTEXT-ERROR", + "CORE-ERROR", + "DOMAIN-ERROR", + "POLICY-ERROR", + "JSON_SCHEMA-ERROR" +] \ No newline at end of file diff --git a/api/enums/Payment-Status.json b/api/enums/Payment-Status.json new file mode 100644 index 0000000..31175ef --- /dev/null +++ b/api/enums/Payment-Status.json @@ -0,0 +1,4 @@ +[ + "PAID", + "NOT-PAID" +] \ No newline at end of file diff --git a/api/enums/Payment-TL_method.json b/api/enums/Payment-TL_method.json new file mode 100644 index 0000000..a065583 --- /dev/null +++ b/api/enums/Payment-TL_method.json @@ -0,0 +1,4 @@ +[ + "http/get", + "http/post" +] \ No newline at end of file diff --git a/api/enums/Payment-Type.json b/api/enums/Payment-Type.json new file mode 100644 index 0000000..d9e030b --- /dev/null +++ b/api/enums/Payment-Type.json @@ -0,0 +1,6 @@ +[ + "On-Order", + "Pre-Fulfillment", + "On-Fulfillment", + "Post-Fulfillment" +] \ No newline at end of file diff --git a/api/enums/Quotation-Breakup-Type.json b/api/enums/Quotation-Breakup-Type.json new file mode 100644 index 0000000..bdba8ef --- /dev/null +++ b/api/enums/Quotation-Breakup-Type.json @@ -0,0 +1,6 @@ +[ + "Item", + "Offer", + "Add-on", + "Fulfillment" +] diff --git a/api/enums/Rating-Direction.json b/api/enums/Rating-Direction.json new file mode 100644 index 0000000..2f9a01b --- /dev/null +++ b/api/enums/Rating-Direction.json @@ -0,0 +1,4 @@ +[ + "UP", + "Down" +] \ No newline at end of file diff --git a/api/enums/Scalar-Type.json b/api/enums/Scalar-Type.json new file mode 100644 index 0000000..bae0b27 --- /dev/null +++ b/api/enums/Scalar-Type.json @@ -0,0 +1,4 @@ +[ + "CONSTANT", + "VARIABLE" +] \ No newline at end of file diff --git a/api/enums/Subscriber-Status.json b/api/enums/Subscriber-Status.json new file mode 100644 index 0000000..9ac2543 --- /dev/null +++ b/api/enums/Subscriber-Status.json @@ -0,0 +1,7 @@ +[ + "INITIATED", + "UNDER_SUBSCRIPTION", + "SUBSCRIBED", + "INVALID_SSL", + "UNSUBSCRIBED" +] \ No newline at end of file diff --git a/api/enums/Subscriber-Type.json b/api/enums/Subscriber-Type.json new file mode 100644 index 0000000..0b365f3 --- /dev/null +++ b/api/enums/Subscriber-Type.json @@ -0,0 +1,7 @@ +[ + "bap", + "bpp", + "bg", + "bppr", + "bgr" +] \ No newline at end of file diff --git a/api/enums/Support-Type.json b/api/enums/Support-Type.json new file mode 100644 index 0000000..f5f5f5b --- /dev/null +++ b/api/enums/Support-Type.json @@ -0,0 +1,5 @@ +[ + "order", + "billing", + "fulfillment" +] \ No newline at end of file diff --git a/api/enums/Tracking-Status.json b/api/enums/Tracking-Status.json new file mode 100644 index 0000000..e15714c --- /dev/null +++ b/api/enums/Tracking-Status.json @@ -0,0 +1,4 @@ +[ + "ACTIVE", + "INACTIVE" +] \ No newline at end of file diff --git a/api/enums/Tracking-TL_method.json b/api/enums/Tracking-TL_method.json new file mode 100644 index 0000000..32f59d9 --- /dev/null +++ b/api/enums/Tracking-TL_method.json @@ -0,0 +1,4 @@ +[ + "http/get", + "ws" +] \ No newline at end of file From c668e5318538f676baf2d968a69643d1cf05f8c0 Mon Sep 17 00:00:00 2001 From: Rajaneesh Date: Wed, 17 Jan 2024 10:10:37 +0530 Subject: [PATCH 02/26] adding new enums in the spec --- api/enums/Cancellation-Cancelled_By.json | 4 ++++ api/enums/Fulfillment-Type.json | 5 +++++ api/enums/Order-State.json | 8 ++++++++ api/logistics.yaml | 14 ++++++++++++++ 4 files changed, 31 insertions(+) create mode 100644 api/enums/Cancellation-Cancelled_By.json create mode 100644 api/enums/Fulfillment-Type.json create mode 100644 api/enums/Order-State.json diff --git a/api/enums/Cancellation-Cancelled_By.json b/api/enums/Cancellation-Cancelled_By.json new file mode 100644 index 0000000..b111bc7 --- /dev/null +++ b/api/enums/Cancellation-Cancelled_By.json @@ -0,0 +1,4 @@ +[ + "CONSUMER", + "PROVIDER" +] \ No newline at end of file diff --git a/api/enums/Fulfillment-Type.json b/api/enums/Fulfillment-Type.json new file mode 100644 index 0000000..2aa0559 --- /dev/null +++ b/api/enums/Fulfillment-Type.json @@ -0,0 +1,5 @@ +[ + "Home-Delivery", + "Store-Pickup", + "Store-Pickup-And-Home-Delivery" +] \ No newline at end of file diff --git a/api/enums/Order-State.json b/api/enums/Order-State.json new file mode 100644 index 0000000..745cc52 --- /dev/null +++ b/api/enums/Order-State.json @@ -0,0 +1,8 @@ +[ + "Initiated", + "Acknowledged", + "Packed", + "Shipped", + "Delivered", + "Cancelled" +] \ No newline at end of file diff --git a/api/logistics.yaml b/api/logistics.yaml index 35fda9e..044006b 100644 --- a/api/logistics.yaml +++ b/api/logistics.yaml @@ -1358,6 +1358,9 @@ components: format: date-time cancelled_by: type: string + enum: + - CONSUMER + - PROVIDER reasons: $ref: '#/components/schemas/Option' selected_reason: @@ -1627,6 +1630,10 @@ components: type: type: string description: This describes the type of fulfillment + enum: + - Home-Delivery + - Store-Pickup + - Store-Pickup-And-Home-Delivery state: $ref: '#/components/schemas/State' tracking: @@ -1905,6 +1912,13 @@ components: description: Hash of order object without id state: type: string + enum: + - Initiated + - Acknowledged + - Packed + - Shipped + - Delivered + - Cancelled provider: type: object properties: From 3b0e890161a268f4ebbdafa1e693546b613b3073 Mon Sep 17 00:00:00 2001 From: Rajaneesh Date: Wed, 17 Jan 2024 12:49:38 +0530 Subject: [PATCH 03/26] adding enum for fulfillment.state.descriptor.code --- .../Fulfillment-State-Descriptor-Code.json | 11 ++++ api/logistics.yaml | 54 +++++++++++++++++-- 2 files changed, 60 insertions(+), 5 deletions(-) create mode 100644 api/enums/Fulfillment-State-Descriptor-Code.json diff --git a/api/enums/Fulfillment-State-Descriptor-Code.json b/api/enums/Fulfillment-State-Descriptor-Code.json new file mode 100644 index 0000000..a49ffcb --- /dev/null +++ b/api/enums/Fulfillment-State-Descriptor-Code.json @@ -0,0 +1,11 @@ +[ + "Pending-Fulfillment", + "Packing", + "Picking", + "Shipped", + "Out-for-Delivery", + "Delivered", + "Failed-Fulfillment", + "Canceled", + "Returned" +] \ No newline at end of file diff --git a/api/logistics.yaml b/api/logistics.yaml index 044006b..ff1bd25 100644 --- a/api/logistics.yaml +++ b/api/logistics.yaml @@ -1635,7 +1635,7 @@ components: - Store-Pickup - Store-Pickup-And-Home-Delivery state: - $ref: '#/components/schemas/State' + $ref: '#/components/schemas/FulfillmentState' tracking: type: boolean description: Indicates whether the fulfillment allows tracking @@ -1675,6 +1675,53 @@ components: type: string tags: $ref: '#/components/schemas/Tags' + FulfillmentState: + description: Describes a fulfillment state + type: object + properties: + descriptor: + $ref: '#/components/schemas/FulfillmentDescriptor' + updated_at: + type: string + format: date-time + updated_by: + type: string + description: ID of entity which changed the state + FulfillmentDescriptor: + description: Describes the description of a fulfillment object + type: object + properties: + name: + type: string + code: + type: string + enum: + - Pending-Fulfillment + - Packing + - Picking + - Shipped + - Out-for-Delivery + - Delivered + - Failed-Fulfillment + - Canceled + - Returned + symbol: + type: string + short_desc: + type: string + long_desc: + type: string + images: + type: array + items: + $ref: '#/components/schemas/Image' + audio: + type: string + format: uri + 3d_render: + type: string + format: uri + Gps: description: Describes a gps coordinate type: string @@ -1813,7 +1860,7 @@ components: tags: $ref: '#/components/schemas/Tags' Language: - description: indicates language code. Beckn supports country codes as per ISO 639.2 standard + description: indicates language code. Beckn supports language codes as per ISO 639.2 standard type: object properties: code: @@ -2009,7 +2056,6 @@ components: type: string cred: type: string - Page: description: Describes a page in a search result type: object @@ -2018,8 +2064,6 @@ components: type: string next_id: type: string - - Payment: description: Describes a payment type: object From 9ce3d701b8fc6cd9a2be86fd201bd59ac44a9cc1 Mon Sep 17 00:00:00 2001 From: Rajaneesh Date: Wed, 17 Jan 2024 20:36:19 +0530 Subject: [PATCH 04/26] adding example jsons --- api/logistics.yaml | 8 ++ examples/cancel/cancel.json | 20 ++++ examples/cancel/on-cancel.json | 102 ++++++++++++++++++++ examples/confirm/confirm.json | 63 +++++++++++++ examples/confirm/on-confirm.json | 104 +++++++++++++++++++++ examples/init/init.json | 52 +++++++++++ examples/init/on-init.json | 97 +++++++++++++++++++ examples/rating/on-rating.json | 22 +++++ examples/rating/rating.json | 20 ++++ examples/search/on-search.json | 90 ++++++++++++++++++ examples/search/search-by-fulfillment.json | 49 ++++++++++ examples/search/search.json | 31 ++++++ examples/select/on-select.json | 91 ++++++++++++++++++ examples/select/select.json | 39 ++++++++ examples/status/on-status.json | 102 ++++++++++++++++++++ examples/status/status.json | 19 ++++ examples/support/on-support.json | 20 ++++ examples/support/support.json | 19 ++++ examples/track/on-track.json | 22 +++++ examples/track/track.json | 19 ++++ examples/update/on-update.json | 104 +++++++++++++++++++++ examples/update/update.json | 28 ++++++ 22 files changed, 1121 insertions(+) create mode 100644 examples/cancel/cancel.json create mode 100644 examples/cancel/on-cancel.json create mode 100644 examples/confirm/confirm.json create mode 100644 examples/confirm/on-confirm.json create mode 100644 examples/init/init.json create mode 100644 examples/init/on-init.json create mode 100644 examples/rating/on-rating.json create mode 100644 examples/rating/rating.json create mode 100644 examples/search/on-search.json create mode 100644 examples/search/search-by-fulfillment.json create mode 100644 examples/search/search.json create mode 100644 examples/select/on-select.json create mode 100644 examples/select/select.json create mode 100644 examples/status/on-status.json create mode 100644 examples/status/status.json create mode 100644 examples/support/on-support.json create mode 100644 examples/support/support.json create mode 100644 examples/track/on-track.json create mode 100644 examples/track/track.json create mode 100644 examples/update/on-update.json create mode 100644 examples/update/update.json diff --git a/api/logistics.yaml b/api/logistics.yaml index ff1bd25..0f81b98 100644 --- a/api/logistics.yaml +++ b/api/logistics.yaml @@ -123,6 +123,14 @@ paths: $ref: '#/components/schemas/Offer/properties/id' required: - id + fulfillments: + type: array + items: + type: object + properties: + id: + $ref: '#/components/schemas/Fulfillment/properties/id' + required: - provider - items diff --git a/examples/cancel/cancel.json b/examples/cancel/cancel.json new file mode 100644 index 0000000..8908eab --- /dev/null +++ b/examples/cancel/cancel.json @@ -0,0 +1,20 @@ + +{ + "context": { + "domain": "logistics", + "country": "IND", + "city": "std:0806", + "action": "cancel", + "core_version": "0.9.4", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "8bc952d9-b448-4328-8519-9f61232ba554", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "order_id": "oid/12", + "cancellation_reason_id": "3" + } +} \ No newline at end of file diff --git a/examples/cancel/on-cancel.json b/examples/cancel/on-cancel.json new file mode 100644 index 0000000..c5c344c --- /dev/null +++ b/examples/cancel/on-cancel.json @@ -0,0 +1,102 @@ + +{ + "context": { + "domain": "logistics", + "country": "IND", + "city": "std:0806", + "action": "on_cancel", + "core_version": "0.9.4", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "8bc952d9-b448-4328-8519-9f61232ba554", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "order": { + "id": "oid/12", + "provider": { + "id":"P1", + "descriptor": { + "name":"Logistics", + "short_desc":"Logistics Org", + "long_desc":"Logistics Org" + }, + "locations":[ + { + "id": "L1", + "gps": "13.786587,76.872309", + "address": { + "street": "Shubhash nagar, 3rd block", + "city": "Bengaluru", + "area_code": "560042", + "state": "KA" + } + } + ] + }, + "items": [ + { + "id": "I1", + "quantity": { + "count": "1", + "measure": { + "unit": "KG", + "value": "1" + } + } + } + ], + "quote" :{ + "price": { + "currency": "INR", + "value": "50" + }, + "breakup": [ + { + "ref_id": "I1", + "type": "item", + "price": { + "currency": "INR", + "value": "50" + } + } + ] + }, + "fulfillment": { + "type": "Home-Delivery", + "start": { + "location": { + "gps": "13.2008459,77.708736" + } + }, + "end": { + "location": { + "gps": "14.3847563,77.1847563" + } + }, + "state": { + "descriptor": { + "code": "Canceled" + } + } + }, + "billing": { + "name": "Paul Sterling", + "phone": "+919876345623", + "email": "sample@gmail.com" + }, + "payment": { + "status": "NOT-PAID", + "type": "PRE-FULFILLMENT", + "params": { + "amount": "1500", + "currency": "INR", + "bank_code": "INB0004321", + "bank_account_number": "1234002341" + } + } + } + } +} \ No newline at end of file diff --git a/examples/confirm/confirm.json b/examples/confirm/confirm.json new file mode 100644 index 0000000..6d4eaa1 --- /dev/null +++ b/examples/confirm/confirm.json @@ -0,0 +1,63 @@ + +{ + "context": { + "domain": "logistics", + "country": "IND", + "city": "std:0806", + "action": "confirm", + "core_version": "0.9.4", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "a6f81cf4-a402-45d5-9e43-836a060ac011", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "order": { + "provider": { + "id": "P1" + }, + "items":[ + { + "id": "I1", + "quantity": { + "count": "1", + "measure": { + "unit": "KG", + "value": "1" + } + } + } + ], + "fulfillment": { + "type": "Home-Delivery", + "start": { + "location": { + "gps": "13.2008459,77.708736" + } + }, + "end": { + "location": { + "gps": "14.3847563,77.1847563" + } + } + }, + "billing": { + "name": "Paul Sterling", + "phone": "+919876345623", + "email": "sample@gmail.com" + }, + "payment": { + "status": "PAID", + "type": "PRE-FULFILLMENT", + "params": { + "amount": "1500", + "currency": "INR", + "bank_code": "INB0004321", + "bank_account_number": "1234002341" + } + } + } + } +} \ No newline at end of file diff --git a/examples/confirm/on-confirm.json b/examples/confirm/on-confirm.json new file mode 100644 index 0000000..c3b4b92 --- /dev/null +++ b/examples/confirm/on-confirm.json @@ -0,0 +1,104 @@ +{ + "context": { + "domain": "logistics", + "country": "IND", + "city": "std:0806", + "action": "on_confirm", + "core_version": "0.9.4", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "a6f81cf4-a402-45d5-9e43-836a060ac011", + "timestamp": "2024-01-15T16:01:00.000Z", + "ttl": "PT30S" + }, + "message": { + "order": { + "id": "oid/12", + "state": "Initiated", + "provider": { + "id":"P1", + "descriptor": { + "name":"Logistics", + "short_desc":"Logistics Org", + "long_desc":"Logistics Org" + }, + "locations":[ + { + "id": "L1", + "gps": "13.786587,76.872309", + "address": { + "street": "Shubhash nagar, 3rd block", + "city": "Bengaluru", + "area_code": "560042", + "state": "KA" + } + } + ] + }, + "items": [ + { + "id": "I1", + "quantity": { + "count": "1", + "measure": { + "unit": "KG", + "value": "1" + } + } + } + ], + "quote" :{ + "price": { + "currency": "INR", + "value": "50" + }, + "breakup": [ + { + "ref_id": "I1", + "type": "item", + "price": { + "currency": "INR", + "value": "50" + } + } + ] + }, + "fulfillment": { + "type": "Home-Delivery", + "start": { + "location": { + "gps": "13.2008459,77.708736" + } + }, + "end": { + "location": { + "gps": "14.3847563,77.1847563" + } + }, + "state": { + "descriptor": { + "code": "Pending-Fulfillment" + } + } + }, + "billing": { + "name": "Paul Sterling", + "phone": "+919876345623", + "email": "sample@gmail.com" + }, + "payment": { + "status": "NOT-PAID", + "type": "PRE-FULFILLMENT", + "params": { + "amount": "1500", + "currency": "INR", + "bank_code": "INB0004321", + "bank_account_number": "1234002341" + } + } + } + } +} \ No newline at end of file diff --git a/examples/init/init.json b/examples/init/init.json new file mode 100644 index 0000000..29ff7ff --- /dev/null +++ b/examples/init/init.json @@ -0,0 +1,52 @@ +{ + "context": { + "domain": "logistics", + "country": "IND", + "city": "std:0806", + "action": "init", + "core_version": "0.9.4", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "005277cc-9a82-466f-b41b-cdda015bd6a5", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "order": { + "provider": { + "id": "P1" + }, + "items":[ + { + "id": "I1", + "quantity": { + "count": "1", + "measure": { + "unit": "KG", + "value": "1" + } + } + } + ], + "fulfillment": { + "type": "Home-Delivery", + "start": { + "location": { + "gps": "13.2008459,77.708736" + } + }, + "end": { + "location": { + "gps": "14.3847563,77.1847563" + } + } + }, + "billing": { + "name": "Paul Sterling", + "phone": "+919876345623", + "email": "sample@gmail.com" + } + } + } +} \ No newline at end of file diff --git a/examples/init/on-init.json b/examples/init/on-init.json new file mode 100644 index 0000000..d867896 --- /dev/null +++ b/examples/init/on-init.json @@ -0,0 +1,97 @@ +{ + "context": { + "domain": "logistics", + "country": "IND", + "city": "std:0806", + "action": "on_init", + "core_version": "0.9.4", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "005277cc-9a82-466f-b41b-cdda015bd6a5", + "timestamp": "2024-01-15T16:01:00.000Z", + "ttl": "PT30S" + }, + "message": { + "initialized": { + "provider": { + "id":"P1", + "descriptor": { + "name":"Logistics", + "short_desc":"Logistics Org", + "long_desc":"Logistics Org" + }, + "locations":[ + { + "id": "L1", + "gps": "13.786587,76.872309", + "address": { + "street": "Shubhash nagar, 3rd block", + "city": "Bengaluru", + "area_code": "560042", + "state": "KA" + } + } + ] + }, + "items": [ + { + "id": "I1", + "quantity": { + "count": "1", + "measure": { + "unit": "KG", + "value": "1" + } + } + } + ], + "quote" :{ + "price": { + "currency": "INR", + "value": "50" + }, + "breakup": [ + { + "ref_id": "I1", + "type": "item", + "price": { + "currency": "INR", + "value": "50" + } + } + ] + }, + "fulfillment": { + "type": "Home-Delivery", + "start": { + "location": { + "gps": "13.2008459,77.708736" + } + }, + "end": { + "location": { + "gps": "14.3847563,77.1847563" + } + } + }, + "billing": { + "name": "Paul Sterling", + "phone": "+919876345623", + "email": "sample@gmail.com" + }, + "payment": { + "status": "NOT-PAID", + "type": "PRE-FULFILLMENT", + "params": { + "amount": "1500", + "currency": "INR", + "bank_code": "INB0004321", + "bank_account_number": "1234002341" + } + } + } + } +} \ No newline at end of file diff --git a/examples/rating/on-rating.json b/examples/rating/on-rating.json new file mode 100644 index 0000000..e7d454f --- /dev/null +++ b/examples/rating/on-rating.json @@ -0,0 +1,22 @@ + +{ + "context": { + "domain": "logistics", + "country": "IND", + "city": "std:0806", + "action": "on_rating", + "core_version": "0.9.4", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "bbf8234d-7b72-4550-8030-d166620eb7ac", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "feedback": { + "id": "feedback/id/08", + "parent_id": "oid/12" + } + } +} \ No newline at end of file diff --git a/examples/rating/rating.json b/examples/rating/rating.json new file mode 100644 index 0000000..d2ff0b9 --- /dev/null +++ b/examples/rating/rating.json @@ -0,0 +1,20 @@ + +{ + "context": { + "domain": "logistics", + "country": "IND", + "city": "std:0806", + "action": "rating", + "core_version": "0.9.4", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "bbf8234d-7b72-4550-8030-d166620eb7ac", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "id": "oid/12", + "value": "4" + } +} \ No newline at end of file diff --git a/examples/search/on-search.json b/examples/search/on-search.json new file mode 100644 index 0000000..6915af8 --- /dev/null +++ b/examples/search/on-search.json @@ -0,0 +1,90 @@ +{ + "context": { + "domain": "logistics", + "country": "IND", + "city": "std:0806", + "action": "on_search", + "core_version": "0.9.4", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", + "timestamp": "2024-01-15T16:01:00.000Z", + "ttl": "PT30S" + }, + "message": { + "catalog": { + "bpp/descriptor": { + "name":"XYZLogistics" + }, + "bpp/providers": [ + { + "id":"P1", + "descriptor": { + "name":"Logistics", + "short_desc":"Logistics Org", + "long_desc":"Logistics Org" + }, + "locations":[ + { + "id": "L1", + "gps": "13.786587,76.872309", + "address": { + "street": "Shubhash nagar, 3rd block", + "city": "Bengaluru", + "area_code": "560042", + "state": "KA" + } + } + ], + "categories": [ + { + "id": "category1", + "descriptor": { + "name": "Fast delivery" + } + } + ], + "fulfillments": [ + { + "id":"1", + "type":"Home-Delivery" + }, + { + "id":"2", + "type":"Store-Pickup" + }, + { + "id":"3", + "type":"Store-Pickup-And-Home-Delivery" + } + ], + "items": [ + { + "id": "I1", + "descriptor": { + "Name": "Lightweight delivery", + "short_desc": "Delivery in just 1 hours", + "long_desc": "Delivery in just 1 hours" + }, + "price": { + "currency": "INR", + "value": "50.0" + }, + "category_id": "category1", + "tags": { + "fulfillment_id": "1" + }, + "time":{ + "duration": "PT60M", + "timestamp":"2024-01-14T16: 00: 00.000Z" + } + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/examples/search/search-by-fulfillment.json b/examples/search/search-by-fulfillment.json new file mode 100644 index 0000000..817a820 --- /dev/null +++ b/examples/search/search-by-fulfillment.json @@ -0,0 +1,49 @@ +{ + "context": { + "domain": "logistics", + "country": "IND", + "city": "std:0806", + "action": "search", + "core_version": "0.9.4", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "intent": { + "category": { + "descriptor": { + "name": "Fast delivery" + } + }, + "provider": { + "locations": [ + { + "id": "loc/1" + } + ] + }, + "fulfillment": { + "start": { + "location": { + "gps": "14.785638,76.454553", + "address": { + "area_code": "320042" + } + } + }, + "end": { + "location": { + "gps": "14.433424,77.928379", + "address": { + "area_code": "320042" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/examples/search/search.json b/examples/search/search.json new file mode 100644 index 0000000..19df8de --- /dev/null +++ b/examples/search/search.json @@ -0,0 +1,31 @@ +{ + "context": { + "domain": "logistics", + "country": "IND", + "city": "std:0806", + "action": "search", + "core_version": "0.9.4", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "intent": { + "category": { + "descriptor": { + "name": "Fast delivery" + } + }, + "provider": { + "locations": [ + { + "id": "loc/1" + } + ] + } + } + } +} \ No newline at end of file diff --git a/examples/select/on-select.json b/examples/select/on-select.json new file mode 100644 index 0000000..96725c9 --- /dev/null +++ b/examples/select/on-select.json @@ -0,0 +1,91 @@ +{ + "context": { + "domain": "logistics", + "country": "IND", + "city": "std:0806", + "action": "on_select", + "core_version": "0.9.4", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "313027c8-dc49-40da-8812-ef86a97f39c0", + "timestamp": "2024-01-15T16:01:00.000Z", + "ttl": "PT30S" + }, + "message": { + "selected": { + "provider": { + "id":"P1", + "descriptor": { + "name":"Logistics", + "short_desc":"Logistics Org", + "long_desc":"Logistics Org" + }, + "locations":[ + { + "id": "L1", + "gps": "13.786587,76.872309", + "address": { + "street": "Shubhash nagar, 3rd block", + "city": "Bengaluru", + "area_code": "560042", + "state": "KA" + } + } + ] + }, + "items": [ + { + "id": "I1", + "descriptor": { + "Name": "Lightweight delivery", + "short_desc": "Delivery in just 1 hours", + "long_desc": "Delivery in just 1 hours" + }, + "price": { + "currency": "INR", + "value": "50.0" + }, + "category_id": "category1", + "time":{ + "duration": "PT60M", + "timestamp":"2024-01-14T16: 00: 00.000Z" + }, + "quantity": { + "selected": { + "count": "1", + "measure": { + "unit": "KG", + "value": "1" + } + } + } + } + ], + "fulfillments": [ + { + "id":"1", + "type":"Home-Delivery" + } + ], + "quote" :{ + "price": { + "currency": "INR", + "value": "50" + }, + "breakup": [ + { + "ref_id": "I1", + "type": "item", + "price": { + "currency": "INR", + "value": "50" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/examples/select/select.json b/examples/select/select.json new file mode 100644 index 0000000..c64071f --- /dev/null +++ b/examples/select/select.json @@ -0,0 +1,39 @@ +{ + "context": { + "domain": "logistics", + "country": "IND", + "city": "std:0806", + "action": "select", + "core_version": "0.9.4", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "313027c8-dc49-40da-8812-ef86a97f39c0", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "selected": { + "provider": { + "id": "P1" + }, + "items":[ + { + "id": "I1", + "quantity": { + "count": "1", + "measure": { + "unit": "KG", + "value": "1" + } + } + } + ], + "fulfillments": [ + { + "id": "1" + } + ] + } + } +} \ No newline at end of file diff --git a/examples/status/on-status.json b/examples/status/on-status.json new file mode 100644 index 0000000..831e2c2 --- /dev/null +++ b/examples/status/on-status.json @@ -0,0 +1,102 @@ + +{ + "context": { + "domain": "logistics", + "country": "IND", + "city": "std:0806", + "action": "on_status", + "core_version": "0.9.4", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "bbf8234d-7b72-4550-8030-d166620eb7ac", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "order": { + "id": "oid/12", + "provider": { + "id":"P1", + "descriptor": { + "name":"Logistics", + "short_desc":"Logistics Org", + "long_desc":"Logistics Org" + }, + "locations":[ + { + "id": "L1", + "gps": "13.786587,76.872309", + "address": { + "street": "Shubhash nagar, 3rd block", + "city": "Bengaluru", + "area_code": "560042", + "state": "KA" + } + } + ] + }, + "items": [ + { + "id": "I1", + "quantity": { + "count": "1", + "measure": { + "unit": "KG", + "value": "1" + } + } + } + ], + "quote" :{ + "price": { + "currency": "INR", + "value": "50" + }, + "breakup": [ + { + "ref_id": "I1", + "type": "item", + "price": { + "currency": "INR", + "value": "50" + } + } + ] + }, + "fulfillment": { + "type": "Home-Delivery", + "start": { + "location": { + "gps": "13.2008459,77.708736" + } + }, + "end": { + "location": { + "gps": "14.3847563,77.1847563" + } + }, + "state": { + "descriptor": { + "code": "Packing" + } + } + }, + "billing": { + "name": "Paul Sterling", + "phone": "+919876345623", + "email": "sample@gmail.com" + }, + "payment": { + "status": "NOT-PAID", + "type": "PRE-FULFILLMENT", + "params": { + "amount": "1500", + "currency": "INR", + "bank_code": "INB0004321", + "bank_account_number": "1234002341" + } + } + } + } +} \ No newline at end of file diff --git a/examples/status/status.json b/examples/status/status.json new file mode 100644 index 0000000..da0433c --- /dev/null +++ b/examples/status/status.json @@ -0,0 +1,19 @@ + +{ + "context": { + "domain": "logistics", + "country": "IND", + "city": "std:0806", + "action": "status", + "core_version": "0.9.4", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "bbf8234d-7b72-4550-8030-d166620eb7ac", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "order_id": "oid/12" + } +} \ No newline at end of file diff --git a/examples/support/on-support.json b/examples/support/on-support.json new file mode 100644 index 0000000..e20390f --- /dev/null +++ b/examples/support/on-support.json @@ -0,0 +1,20 @@ + +{ + "context": { + "domain": "logistics", + "country": "IND", + "city": "std:0806", + "action": "on_support", + "core_version": "0.9.4", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "6cae6207-2f14-459a-84e0-1439c013be09", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "phone": "+919876564656", + "email": "sample@gmail.com" + } +} \ No newline at end of file diff --git a/examples/support/support.json b/examples/support/support.json new file mode 100644 index 0000000..48aa5c7 --- /dev/null +++ b/examples/support/support.json @@ -0,0 +1,19 @@ + +{ + "context": { + "domain": "logistics", + "country": "IND", + "city": "std:0806", + "action": "support", + "core_version": "0.9.4", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "6cae6207-2f14-459a-84e0-1439c013be09", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "ref_id": "oid/12" + } +} \ No newline at end of file diff --git a/examples/track/on-track.json b/examples/track/on-track.json new file mode 100644 index 0000000..e2674d2 --- /dev/null +++ b/examples/track/on-track.json @@ -0,0 +1,22 @@ + +{ + "context": { + "domain": "logistics", + "country": "IND", + "city": "std:0806", + "action": "on_track", + "core_version": "0.9.4", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "2a121930-9ebe-4d80-b557-08f15791af83", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "tracking": { + "url": "https://sample/tracking/url", + "status": "active" + } + } +} \ No newline at end of file diff --git a/examples/track/track.json b/examples/track/track.json new file mode 100644 index 0000000..fce9a74 --- /dev/null +++ b/examples/track/track.json @@ -0,0 +1,19 @@ + +{ + "context": { + "domain": "logistics", + "country": "IND", + "city": "std:0806", + "action": "track", + "core_version": "0.9.4", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "2a121930-9ebe-4d80-b557-08f15791af83", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "order_id": "oid/12" + } +} \ No newline at end of file diff --git a/examples/update/on-update.json b/examples/update/on-update.json new file mode 100644 index 0000000..b57e2ab --- /dev/null +++ b/examples/update/on-update.json @@ -0,0 +1,104 @@ + +{ + "context": { + "domain": "logistics", + "country": "IND", + "city": "std:0806", + "action": "update", + "core_version": "0.9.4", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "92fed6b2-7822-425b-a807-3d26edddc695", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "update_target": "order.fulfillment.end.location", + "order": { + "id": "oid/12", + "state": "Initiated", + "provider": { + "id":"P1", + "descriptor": { + "name":"Logistics", + "short_desc":"Logistics Org", + "long_desc":"Logistics Org" + }, + "locations":[ + { + "id": "L1", + "gps": "13.786587,76.872309", + "address": { + "street": "Shubhash nagar, 3rd block", + "city": "Bengaluru", + "area_code": "560042", + "state": "KA" + } + } + ] + }, + "items": [ + { + "id": "I1", + "quantity": { + "count": "1", + "measure": { + "unit": "KG", + "value": "1" + } + } + } + ], + "quote" :{ + "price": { + "currency": "INR", + "value": "50" + }, + "breakup": [ + { + "ref_id": "I1", + "type": "item", + "price": { + "currency": "INR", + "value": "50" + } + } + ] + }, + "fulfillment": { + "type": "Home-Delivery", + "start": { + "location": { + "gps": "13.2008459,77.708736" + } + }, + "end": { + "location": { + "gps": "14.3847563,78.7656455" + } + }, + "state": { + "descriptor": { + "code": "Pending-Fulfillment" + } + } + }, + "billing": { + "name": "Paul Sterling", + "phone": "+919876345623", + "email": "sample@gmail.com" + }, + "payment": { + "status": "NOT-PAID", + "type": "PRE-FULFILLMENT", + "params": { + "amount": "1500", + "currency": "INR", + "bank_code": "INB0004321", + "bank_account_number": "1234002341" + } + } + } + } +} \ No newline at end of file diff --git a/examples/update/update.json b/examples/update/update.json new file mode 100644 index 0000000..e473ccf --- /dev/null +++ b/examples/update/update.json @@ -0,0 +1,28 @@ + +{ + "context": { + "domain": "logistics", + "country": "IND", + "city": "std:0806", + "action": "update", + "core_version": "0.9.4", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "92fed6b2-7822-425b-a807-3d26edddc695", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "update_target": "order.fulfillment.end.location", + "order": { + "fulfillment": { + "end": { + "location": { + "gps": "14.3847563,78.7656455" + } + } + } + } + } +} \ No newline at end of file From 1f40949ed916beabdde9e300161bd4bd6fbcc2ce Mon Sep 17 00:00:00 2001 From: Rajaneesh Date: Thu, 18 Jan 2024 11:13:25 +0530 Subject: [PATCH 05/26] adding reference to the core spec --- .gitmodules | 3 +++ api/core | 1 + 2 files changed, 4 insertions(+) create mode 100644 .gitmodules create mode 160000 api/core diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..8cb89eb --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "api/core"] + path = api/core + url = https://github.com/beckn/protocol-specifications/tree/c37370d9e5dfef72a682f5f21ee0ba31b341b7a0 diff --git a/api/core b/api/core new file mode 160000 index 0000000..372a9f2 --- /dev/null +++ b/api/core @@ -0,0 +1 @@ +Subproject commit 372a9f25548a46748fcd1d26fcd36ca41ba05cea From f7774ef4d7a415d7f0cbdcdbc32652cfab09ea44 Mon Sep 17 00:00:00 2001 From: Rajaneesh Date: Thu, 18 Jan 2024 11:26:53 +0530 Subject: [PATCH 06/26] removing old core reference --- .gitmodules | 3 - api/core | 1 - api/logistics.yaml | 2596 ++++++++++++++++++++------------------------ 3 files changed, 1152 insertions(+), 1448 deletions(-) delete mode 160000 api/core diff --git a/.gitmodules b/.gitmodules index 8cb89eb..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "api/core"] - path = api/core - url = https://github.com/beckn/protocol-specifications/tree/c37370d9e5dfef72a682f5f21ee0ba31b341b7a0 diff --git a/api/core b/api/core deleted file mode 160000 index 372a9f2..0000000 --- a/api/core +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 372a9f25548a46748fcd1d26fcd36ca41ba05cea diff --git a/api/logistics.yaml b/api/logistics.yaml index 0f81b98..4b3501c 100644 --- a/api/logistics.yaml +++ b/api/logistics.yaml @@ -1,8 +1,8 @@ openapi: 3.0.0 info: - title: Beckn Hyperlocal Delivery API specification - description: Beckn Hyperlocal Delivery API specification - version: 0.9.1 + title: Beckn Protocol Core + description: Beckn Core Transaction API specification + version: 1.1.0 security: - SubscriberAuth: [] paths: @@ -11,254 +11,113 @@ paths: tags: - Beckn Provider Platform (BPP) - Beckn Gateway (BG) - description: Search for services by intent - security: - - SubscriberAuth: [] - GatewaySubscriberAuth: [] + description: BAP declares the customer's intent to buy/avail products or services requestBody: - description: BAP searches for services content: application/json: schema: type: object properties: context: - $ref: '#/components/schemas/Context' + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - search message: type: object properties: intent: $ref: '#/components/schemas/Intent' - required: - - intent required: - context - message responses: - '200': - description: Acknowledgement of message received - content: - application/json: - schema: - type: object - properties: - context: - $ref: '#/components/schemas/Context' - message: - type: object - properties: - ack: - $ref: '#/components/schemas/Ack' - required: - - ack - error: - $ref: '#/components/schemas/Error' - required: - - message + default: + $ref: '#/paths/~1init/post/responses/default' /select: post: tags: - Beckn Provider Platform (BPP) - description: Select items from the catalog and build your order + description: BAP declares the customer's cart (or equivalent) created by selecting objects from the catalog requestBody: - description: TODO content: application/json: schema: type: object properties: context: - $ref: '#/components/schemas/Context' + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - select + required: + - action message: type: object properties: - selected: - type: object - properties: - provider: - type: object - properties: - id: - $ref: '#/components/schemas/Provider/properties/id' - locations: - type: array - maxItems: 1 - items: - type: object - properties: - id: - $ref: '#/components/schemas/Location/properties/id' - required: - - id - required: - - id - - locations - items: - type: array - items: - type: object - properties: - id: - $ref: '#/components/schemas/Item/properties/id' - quantity: - $ref: '#/components/schemas/ItemQuantity/properties/selected' - required: - - id - - quantity - add_ons: - type: array - items: - type: object - properties: - id: - $ref: '#/components/schemas/AddOn/properties/id' - required: - - id - offers: - type: array - items: - type: object - properties: - id: - $ref: '#/components/schemas/Offer/properties/id' - required: - - id - fulfillments: - type: array - items: - type: object - properties: - id: - $ref: '#/components/schemas/Fulfillment/properties/id' - - required: - - provider - - items + order: + $ref: '#/components/schemas/Order' required: - - selected + - order required: - context - message responses: - '200': - description: Acknowledgement of message received - content: - application/json: - schema: - type: object - properties: - context: - $ref: '#/components/schemas/Context' - message: - type: object - properties: - ack: - $ref: '#/components/schemas/Ack' - required: - - ack - error: - $ref: '#/components/schemas/Error' - required: - - message + default: + $ref: '#/paths/~1init/post/responses/default' /init: post: tags: - Beckn Provider Platform (BPP) description: Initialize an order by providing billing and/or shipping details requestBody: - description: TODO content: application/json: schema: type: object properties: context: - $ref: '#/components/schemas/Context' + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - init + required: + - action message: type: object properties: order: - type: object - properties: - provider: - type: object - properties: - id: - $ref: '#/components/schemas/Provider/properties/id' - locations: - type: array - maxItems: 1 - items: - type: object - properties: - id: - $ref: '#/components/schemas/Location/properties/id' - required: - - id - required: - - id - - locations - items: - type: array - items: - type: object - properties: - id: - $ref: '#/components/schemas/Item/properties/id' - quantity: - $ref: '#/components/schemas/ItemQuantity/properties/selected' - required: - - id - - quantity - add_ons: - type: array - items: - type: object - properties: - id: - $ref: '#/components/schemas/AddOn/properties/id' - required: - - id - offers: - type: array - items: - type: object - properties: - id: - $ref: '#/components/schemas/Offer/properties/id' - required: - - id - billing: - $ref: '#/components/schemas/Billing' - fulfillment: - $ref: '#/components/schemas/Fulfillment' - required: - - provider - - items - - add_ons - - offers - - billing - - fulfillment + $ref: '#/components/schemas/Order' required: - order required: - context - message responses: - '200': - description: Acknowledgement of message received + default: + description: Acknowledgement of message received after successful validation of schema and signature content: application/json: schema: type: object properties: - context: - $ref: '#/components/schemas/Context' message: type: object properties: ack: - $ref: '#/components/schemas/Ack' + allOf: + - $ref: '#/components/schemas/Ack' + - properties: + status: + enum: + - ACK + - NACK required: - ack error: @@ -271,14 +130,20 @@ paths: - Beckn Provider Platform (BPP) description: Initialize an order by providing billing and/or shipping details requestBody: - description: TODO content: application/json: schema: type: object properties: context: - $ref: '#/components/schemas/Context' + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - confirm + required: + - action message: type: object properties: @@ -290,40 +155,28 @@ paths: - context - message responses: - '200': - description: Acknowledgement of message received - content: - application/json: - schema: - type: object - properties: - context: - $ref: '#/components/schemas/Context' - message: - type: object - properties: - ack: - $ref: '#/components/schemas/Ack' - required: - - ack - error: - $ref: '#/components/schemas/Error' - required: - - message + default: + $ref: '#/paths/~1init/post/responses/default' /status: post: tags: - Beckn Provider Platform (BPP) description: Fetch the latest order object requestBody: - description: TODO content: application/json: schema: type: object properties: context: - $ref: '#/components/schemas/Context' + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - status + required: + - action message: type: object properties: @@ -335,40 +188,28 @@ paths: - context - message responses: - '200': - description: Acknowledgement of message received - content: - application/json: - schema: - type: object - properties: - context: - $ref: '#/components/schemas/Context' - message: - type: object - properties: - ack: - $ref: '#/components/schemas/Ack' - required: - - ack - error: - $ref: '#/components/schemas/Error' - required: - - message + default: + $ref: '#/paths/~1init/post/responses/default' /track: post: tags: - Beckn Provider Platform (BPP) description: Track an active order requestBody: - description: TODO content: application/json: schema: type: object properties: context: - $ref: '#/components/schemas/Context' + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - track + required: + - action message: type: object properties: @@ -383,40 +224,28 @@ paths: - context - message responses: - '200': - description: Acknowledgement of message received - content: - application/json: - schema: - type: object - properties: - context: - $ref: '#/components/schemas/Context' - message: - type: object - properties: - ack: - $ref: '#/components/schemas/Ack' - required: - - ack - error: - $ref: '#/components/schemas/Error' - required: - - message + default: + $ref: '#/paths/~1init/post/responses/default' /cancel: post: tags: - Beckn Provider Platform (BPP) description: Cancel an order requestBody: - description: TODO content: application/json: schema: type: object properties: context: - $ref: '#/components/schemas/Context' + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - cancel + required: + - action message: type: object properties: @@ -428,45 +257,32 @@ paths: $ref: '#/components/schemas/Descriptor' required: - order_id - - cancellation_reason_id required: - context - message responses: - '200': - description: Acknowledgement of message received - content: - application/json: - schema: - type: object - properties: - context: - $ref: '#/components/schemas/Context' - message: - type: object - properties: - ack: - $ref: '#/components/schemas/Ack' - required: - - ack - error: - $ref: '#/components/schemas/Error' - required: - - message + default: + $ref: '#/paths/~1init/post/responses/default' /update: post: tags: - Beckn Provider Platform (BPP) description: Remove object requestBody: - description: TODO content: application/json: schema: type: object properties: context: - $ref: '#/components/schemas/Context' + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - update + required: + - action message: type: object properties: @@ -474,7 +290,9 @@ paths: description: 'Comma separated values of order objects being updated. For example: ```"update_target":"item,billing,fulfillment"```' type: string order: - $ref: '#/components/schemas/Order' + description: Updated order object + allOf: + - $ref: '#/components/schemas/Order' required: - update_target - order @@ -482,148 +300,93 @@ paths: - context - message responses: - '200': - description: Acknowledgement of message received - content: - application/json: - schema: - type: object - properties: - context: - $ref: '#/components/schemas/Context' - message: - type: object - properties: - ack: - $ref: '#/components/schemas/Ack' - required: - - ack - error: - $ref: '#/components/schemas/Error' - required: - - message + default: + $ref: '#/paths/~1init/post/responses/default' /rating: post: tags: - Beckn Provider Platform (BPP) description: Provide feedback on a service requestBody: - description: TODO content: application/json: schema: type: object properties: context: - $ref: '#/components/schemas/Context' + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - rating + required: + - action message: type: object properties: - id: - type: string - description: ID of the item to be rated - value: - type: integer - maximum: 5 - minimum: 1 - required: - - id - - value + ratings: + type: array + items: + $ref: '#/components/schemas/Rating' required: - context - message responses: - '200': - description: Acknowledgement of message received - content: - application/json: - schema: - type: object - properties: - context: - $ref: '#/components/schemas/Context' - message: - type: object - properties: - ack: - $ref: '#/components/schemas/Ack' - required: - - ack - error: - $ref: '#/components/schemas/Error' - required: - - message - + default: + $ref: '#/paths/~1init/post/responses/default' /support: post: tags: - Beckn Provider Platform (BPP) description: Contact support - parameters: - - in: header - name: Signature - description: This contains the digital signature of the request body signed using the signing private key of the Subscriber - schema: - type: string - required: true requestBody: - description: TODO content: application/json: schema: type: object properties: context: - $ref: '#/components/schemas/Context' + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - support + required: + - action message: type: object properties: - ref_id: - type: string - description: ID of the element for which support is needed + support: + $ref: '#/components/schemas/Support' required: - context - message responses: - '200': - description: Acknowledgement of message received - content: - application/json: - schema: - type: object - properties: - context: - $ref: '#/components/schemas/Context' - message: - type: object - properties: - ack: - $ref: '#/components/schemas/Ack' - required: - - ack - error: - $ref: '#/components/schemas/Error' - required: - - message - + default: + $ref: '#/paths/~1init/post/responses/default' /on_search: post: tags: - - Beckn App Platform (BAP) + - Beckn Application Platform (BAP) - Beckn Gateway (BG) - description: Send catalog - security: - - SubscriberAuth: [] - - GatewaySubscriberAuth: [] + description: BPP sends its catalog in response to a search request. requestBody: - description: TODO content: application/json: schema: type: object properties: context: - $ref: '#/components/schemas/Context' + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - on_search + required: + - action message: type: object properties: @@ -636,206 +399,94 @@ paths: required: - context responses: - '200': - description: Acknowledgement of message received - content: - application/json: - schema: - type: object - properties: - context: - $ref: '#/components/schemas/Context' - message: - type: object - properties: - ack: - $ref: '#/components/schemas/Ack' - required: - - ack - error: - $ref: '#/components/schemas/Error' - required: - - context + default: + $ref: '#/paths/~1init/post/responses/default' /on_select: post: tags: - - Beckn App Platform (BAP) + - Beckn Application Platform (BAP) description: Send draft order object with quoted price for selected items requestBody: - description: TODO content: application/json: schema: type: object properties: context: - $ref: '#/components/schemas/Context' + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - on_select + required: + - action message: type: object properties: - selected: - type: object - properties: - provider: - $ref: '#/components/schemas/Provider' - provider_location: - $ref: '#/components/schemas/Location' - items: - type: array - items: - allOf: - - $ref: '#/components/schemas/Item' - - properties: - quantity: - $ref: '#/components/schemas/ItemQuantity' - add_ons: - type: array - items: - $ref: '#/components/schemas/AddOn' - offers: - type: array - items: - $ref: '#/components/schemas/Offer' - quote: - $ref: '#/components/schemas/Quotation' - required: - - selected + order: + $ref: '#/components/schemas/Order' error: $ref: '#/components/schemas/Error' required: - context responses: - '200': - description: Acknowledgement of message received - content: - application/json: - schema: - type: object - properties: - context: - $ref: '#/components/schemas/Context' - message: - type: object - properties: - ack: - $ref: '#/components/schemas/Ack' - required: - - ack - error: - $ref: '#/components/schemas/Error' - required: - - context - - message + default: + $ref: '#/paths/~1init/post/responses/default' /on_init: post: tags: - - Beckn App Platform (BAP) + - Beckn Application Platform (BAP) description: Send order object with payment details updated - parameters: - - in: header - name: Proxy-Authorization - required: false - schema: - type: string - description: 'Signature of message body + X-Sub-Authorization header using BG''s signing public key. For example Proxy-Authorization : Signature subId=''bg-example.com'',algorithm=''rsa-sha256'' headers=''Authorization'' signature=''Base64(RSA-SHA256(signing string))''' requestBody: - description: TODO content: application/json: schema: type: object properties: context: - $ref: '#/components/schemas/Context' + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - on_init + required: + - action message: type: object properties: - initialized: - type: object - properties: - provider: - type: object - properties: - id: - $ref: '#/components/schemas/Provider/properties/id' - provider_location: - type: object - properties: - id: - $ref: '#/components/schemas/Location/properties/id' - items: - type: array - items: - type: object - properties: - id: - $ref: '#/components/schemas/Item/properties/id' - quantity: - $ref: '#/components/schemas/ItemQuantity/properties/selected' - add_ons: - type: array - items: - type: object - properties: - id: - $ref: '#/components/schemas/AddOn/properties/id' - offers: - type: array - items: - type: object - properties: - id: - $ref: '#/components/schemas/Offer/properties/id' - billing: - $ref: '#/components/schemas/Billing' - fulfillment: - $ref: '#/components/schemas/Fulfillment' - quote: - $ref: '#/components/schemas/Quotation' - payment: - $ref: '#/components/schemas/Payment' + order: + $ref: '#/components/schemas/Order' required: - - initialized + - order error: $ref: '#/components/schemas/Error' required: - context responses: - '200': - description: Acknowledgement of message received - content: - application/json: - schema: - type: object - properties: - context: - $ref: '#/components/schemas/Context' - message: - type: object - properties: - ack: - $ref: '#/components/schemas/Ack' - required: - - ack - error: - $ref: '#/components/schemas/Error' - required: - - context - - message + default: + $ref: '#/paths/~1init/post/responses/default' /on_confirm: post: tags: - - Beckn App Platform (BAP) + - Beckn Application Platform (BAP) description: Send active order object requestBody: - description: TODO content: application/json: schema: type: object properties: context: - $ref: '#/components/schemas/Context' + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - on_confirm + required: + - action message: type: object properties: @@ -848,41 +499,28 @@ paths: required: - context responses: - '200': - description: Acknowledgement of message received - content: - application/json: - schema: - type: object - properties: - context: - $ref: '#/components/schemas/Context' - message: - type: object - properties: - ack: - $ref: '#/components/schemas/Ack' - required: - - ack - error: - $ref: '#/components/schemas/Error' - required: - - context - - message + default: + $ref: '#/paths/~1init/post/responses/default' /on_track: post: tags: - - Beckn App Platform (BAP) + - Beckn Application Platform (BAP) description: Send tracking details of an active order requestBody: - description: TODO content: application/json: schema: type: object properties: context: - $ref: '#/components/schemas/Context' + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - on_track + required: + - action message: type: object properties: @@ -895,41 +533,28 @@ paths: required: - context responses: - '200': - description: Acknowledgement of message received - content: - application/json: - schema: - type: object - properties: - context: - $ref: '#/components/schemas/Context' - message: - type: object - properties: - ack: - $ref: '#/components/schemas/Ack' - required: - - ack - error: - $ref: '#/components/schemas/Error' - required: - - context - - message + default: + $ref: '#/paths/~1init/post/responses/default' /on_cancel: post: tags: - - Beckn App Platform (BAP) + - Beckn Application Platform (BAP) description: Send cancellation request_id with reasons list in case of cancellation request. Else send cancelled order object requestBody: - description: TODO content: application/json: schema: type: object properties: context: - $ref: '#/components/schemas/Context' + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - on_cancel + required: + - action message: type: object properties: @@ -942,41 +567,28 @@ paths: required: - context responses: - '200': - description: Acknowledgement of message received - content: - application/json: - schema: - type: object - properties: - context: - $ref: '#/components/schemas/Context' - message: - type: object - properties: - ack: - $ref: '#/components/schemas/Ack' - required: - - ack - error: - $ref: '#/components/schemas/Error' - required: - - context - - message + default: + $ref: '#/paths/~1init/post/responses/default' /on_update: post: tags: - - Beckn App Platform (BAP) + - Beckn Application Platform (BAP) description: Returns updated service with updated runtime object requestBody: - description: TODO content: application/json: schema: type: object properties: context: - $ref: '#/components/schemas/Context' + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - on_update + required: + - action message: type: object properties: @@ -989,41 +601,28 @@ paths: required: - context responses: - '200': - description: Acknowledgement of message received - content: - application/json: - schema: - type: object - properties: - context: - $ref: '#/components/schemas/Context' - message: - type: object - properties: - ack: - $ref: '#/components/schemas/Ack' - required: - - ack - error: - $ref: '#/components/schemas/Error' - required: - - context - - message + default: + $ref: '#/paths/~1init/post/responses/default' /on_status: post: tags: - - Beckn App Platform (BAP) + - Beckn Application Platform (BAP) description: Fetch the status of a Service requestBody: - description: TODO content: application/json: schema: type: object properties: context: - $ref: '#/components/schemas/Context' + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - on_status + required: + - action message: type: object properties: @@ -1036,332 +635,187 @@ paths: required: - context responses: - '200': - description: Acknowledgement of message received - content: - application/json: - schema: - type: object - properties: - context: - $ref: '#/components/schemas/Context' - message: - type: object - properties: - ack: - $ref: '#/components/schemas/Ack' - required: - - ack - error: - $ref: '#/components/schemas/Error' - required: - - context - - message + default: + $ref: '#/paths/~1init/post/responses/default' /on_rating: post: tags: - - Beckn App Platform (BAP) + - Beckn Application Platform (BAP) description: Provide feedback on a service requestBody: - description: TODO content: application/json: schema: type: object properties: context: - $ref: '#/components/schemas/Context' + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - on_rating + required: + - action message: type: object properties: - feedback: - $ref: '#/components/schemas/Feedback' - required: - - feedback + feedback_form: + description: A feedback form to allow the user to provide additional information on the rating provided + allOf: + - $ref: '#/components/schemas/XInput' error: $ref: '#/components/schemas/Error' required: - context + - message responses: - '200': - description: Acknowledgement of message received - content: - application/json: - schema: - type: object - properties: - context: - $ref: '#/components/schemas/Context' - message: - type: object - properties: - ack: - $ref: '#/components/schemas/Ack' - required: - - ack - error: - $ref: '#/components/schemas/Error' - required: - - context - - message + default: + $ref: '#/paths/~1init/post/responses/default' /on_support: post: tags: - - Beckn App Platform (BAP) + - Beckn Application Platform (BAP) description: Contact Support requestBody: - description: TODO content: application/json: schema: type: object properties: context: - $ref: '#/components/schemas/Context' + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - on_support + required: + - action message: type: object properties: - phone: - type: string - format: phone - email: - type: string - format: email - uri: - type: string - format: uri + support: + $ref: '#/components/schemas/Support' error: $ref: '#/components/schemas/Error' required: - context responses: - '200': - description: Acknowledgement of message received - content: - application/json: - schema: - type: object - properties: - context: - $ref: '#/components/schemas/Context' - message: - type: object - properties: - ack: - $ref: '#/components/schemas/Ack' - required: - - ack - error: - $ref: '#/components/schemas/Error' - required: - - context - - message - - /get_cancellation_reasons: - post: - tags: - - BPP Meta APIs - description: Get cancellation reasons of a BPP - parameters: - - in: header - name: Signature - description: This contains the digital signature of the request body signed using the signing private key of the Subscriber - schema: - type: string - required: true - requestBody: - description: TODO - content: - application/json: - schema: - $ref: '#/components/schemas/Context' - responses: - '200': - description: List of cancellation reasons - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Option' - - /get_return_reasons: - post: - tags: - - BPP Meta APIs - description: Get return reasons of a BPP - parameters: - - in: header - name: Signature - description: This contains the digital signature of the request body signed using the signing private key of the Subscriber - schema: - type: string - required: true - requestBody: - description: TODO - content: - application/json: - schema: - $ref: '#/components/schemas/Context' - responses: - '200': - description: List of return reasons - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Option' - - /get_rating_categories: - post: - tags: - - BPP Meta APIs - description: Get all rating categories supported by a BPP - parameters: - - in: header - name: Signature - description: This contains the digital signature of the request body signed using the signing private key of the Subscriber - schema: - type: string - required: true - requestBody: - description: TODO - content: - application/json: - schema: - $ref: '#/components/schemas/Context' - responses: - '200': - description: Feedback forms - content: - application/json: - schema: - type: array - items: - allOf: - - $ref: '#/components/schemas/Category' - - type: object - properties: - question: - type: string - - + default: + $ref: '#/paths/~1init/post/responses/default' components: securitySchemes: SubscriberAuth: type: apiKey in: header name: Authorization - description: 'Signature of message body using BAP or BPP subscriber''s signing public key.

For example:

Authorization : Signature keyId=''bap-example.com'', signature=''Base64(EdDSA-SHA512(requestBody))''' - GatewaySubscriberAuth: - type: apiKey - in: header - name: Proxy-Authorization - description: 'Signature of message body + BAP/BPP''s Authorization header using BG''s signing public key. For example:

Proxy-Authorization : Signature keyId=''bg-example.com'' headers=''Authorization'',signature=''Base64(EdDSA-SHA512(requestBody)''' + description: 'Signature of message body using BAP or BPP subscriber''s signing public key.

Format:

Authorization : Signature keyId="{subscriber_id}|{unique_key_id}|{algorithm}",algorithm="ed25519",created="1606970629",expires="1607030629",headers="(created) (expires) digest",signature="Base64(signing string)"' schemas: Ack: - description: Describes the ACK response + description: 'Describes the acknowledgement sent in response to an API call. If the implementation uses HTTP/S, then Ack must be returned in the same session. Every API call to a BPP must be responded to with an Ack whether the BPP intends to respond with a callback or not. This has one property called `status` that indicates the status of the Acknowledgement.' type: object properties: status: type: string - description: 'Describe the status of the ACK response. If schema validation passes, status is ACK else it is NACK' + description: 'The status of the acknowledgement. If the request passes the validation criteria of the BPP, then this is set to ACK. If a BPP responds with status = `ACK` to a request, it is required to respond with a callback. If the request fails the validation criteria, then this is set to NACK. Additionally, if a BPP does not intend to respond with a callback even after the request meets the validation criteria, it should set this value to `NACK`.' enum: - ACK - NACK - required: - - status + tags: + description: A list of tags containing any additional information sent along with the Acknowledgement. + type: array + items: + $ref: '#/components/schemas/TagGroup' AddOn: - description: Describes an add-on + description: Describes an additional item offered as a value-addition to a product or service. This does not exist independently in a catalog and is always associated with an item. type: object properties: id: + description: Provider-defined ID of the add-on type: string - description: 'ID of the add-on. This follows the syntax {item.id}/add-on/{add-on unique id} for item specific add-on OR ' descriptor: $ref: '#/components/schemas/Descriptor' price: $ref: '#/components/schemas/Price' Address: - description: Describes an address + description: Describes a postal address. + type: string + Agent: + description: 'Describes the direct performer, driver or executor that fulfills an order. It is usually a person. But in some rare cases, it could be a non-living entity like a drone, or a bot. Some examples of agents are Doctor in the healthcare sector, a driver in the mobility sector, or a delivery person in the logistics sector. This object can be set at any stage of the order lifecycle. This can be set at the discovery stage when the BPP wants to provide details on the agent fulfilling the order, like in healthcare, where the doctor''s name appears during search. This object can also used to search for a particular person that the customer wants fulfilling an order. Sometimes, this object gets instantiated after the order is confirmed, like in the case of on-demand taxis, where the driver is assigned after the user confirms the ride.' + properties: + person: + $ref: '#/components/schemas/Person' + contact: + $ref: '#/components/schemas/Contact' + organization: + $ref: '#/components/schemas/Organization' + rating: + $ref: '#/components/schemas/Rating/properties/value' + Authorization: + description: 'Describes an authorization mechanism used to start or end the fulfillment of an order. For example, in the mobility sector, the driver may require a one-time password to initiate the ride. In the healthcare sector, a patient may need to provide a password to open a video conference link during a teleconsultation.' type: object properties: - door: - type: string - description: Door / Shop number of the address - name: - type: string - description: 'Name of address if applicable. Example, shop name' - building: - type: string - description: Name of the building or block - street: - type: string - description: Street name or number - locality: - type: string - description: 'Name of the locality, apartments' - ward: + type: + description: Type of authorization mechanism used. The allowed values for this field can be published as part of the network policy. type: string - description: Name or number of the ward if applicable - city: + token: + description: 'Token used for authorization. This is typically generated at the BPP. The BAP can send this value to the user via any channel that it uses to authenticate the user like SMS, Email, Push notification, or in-app rendering.' type: string - description: City name - state: + valid_from: + description: Timestamp in RFC3339 format from which token is valid type: string - description: State name - country: + format: date-time + valid_to: + description: Timestamp in RFC3339 format until which token is valid type: string - description: Country name - area_code: + format: date-time + status: + description: Status of the token type: string - description: 'Area code. This can be Pincode, ZIP code or any equivalent' Billing: - description: Describes a billing event + description: 'Describes the billing details of an entity.
This has properties like name,organization,address,email,phone,time,tax_number, created_at,updated_at' type: object properties: name: - description: Personal details of the customer needed for billing. + description: Name of the billable entity type: string organization: - $ref: '#/components/schemas/Organization' + description: Details of the organization being billed. + allOf: + - $ref: '#/components/schemas/Organization' address: - $ref: '#/components/schemas/Address' + description: The address of the billable entity + allOf: + - $ref: '#/components/schemas/Address' + state: + description: The state where the billable entity resides. This is important for state-level tax calculation + allOf: + - $ref: '#/components/schemas/State' + city: + description: The city where the billable entity resides. + allOf: + - $ref: '#/components/schemas/City' email: + description: Email address where the bill is sent to type: string format: email phone: + description: Phone number of the billable entity type: string time: - $ref: '#/components/schemas/Time' - tax_number: - type: string - created_at: - type: string - format: date-time - updated_at: + description: Details regarding the billing period + allOf: + - $ref: '#/components/schemas/Time' + tax_id: + description: ID of the billable entity as recognized by the taxation authority type: string - format: date-time - required: - - name - - phone Cancellation: - description: Describes the ACK response + description: Describes a cancellation event type: object properties: - type: - type: string - enum: - - full - - partial - ref_id: - type: string - policies: - type: array - items: - $ref: '#/components/schemas/Policy' time: + description: Date-time when the order was cancelled by the buyer type: string format: date-time cancelled_by: @@ -1369,170 +823,172 @@ components: enum: - CONSUMER - PROVIDER - reasons: - $ref: '#/components/schemas/Option' - selected_reason: - type: object - properties: - id: - $ref: '#/components/schemas/Option/properties/id' + reason: + description: The reason for cancellation + allOf: + - $ref: '#/components/schemas/Option' additional_description: - $ref: '#/components/schemas/Descriptor' + description: Any additional information regarding the nature of cancellation + allOf: + - $ref: '#/components/schemas/Descriptor' + CancellationTerm: + description: Describes the cancellation terms of an item or an order. This can be referenced at an item or order level. Item-level cancellation terms can override the terms at the order level. + type: object + properties: + fulfillment_state: + description: The state of fulfillment during which this term is applicable. + allOf: + - $ref: '#/components/schemas/FulfillmentState' + reason_required: + description: Indicates whether a reason is required to cancel the order + type: boolean + cancel_by: + description: Information related to the time of cancellation. + allOf: + - $ref: '#/components/schemas/Time' + cancellation_fee: + $ref: '#/components/schemas/Fee' + xinput: + $ref: '#/components/schemas/XInput' + external_ref: + $ref: '#/components/schemas/MediaFile' Catalog: - description: Describes a BPP catalog + description: 'Describes the products or services offered by a BPP. This is typically sent as the response to a search intent from a BAP. The payment terms, offers and terms of fulfillment supported by the BPP can also be included here. The BPP can show hierarchical nature of products/services in its catalog using the parent_category_id in categories. The BPP can also send a ttl (time to live) in the context which is the duration for which a BAP can cache the catalog and use the cached catalog.
This has properties like bbp/descriptor,bbp/categories,bbp/fulfillments,bbp/payments,bbp/offers,bbp/providers and exp
This is used in the following situations.
  • This is typically used in the discovery stage when the BPP sends the details of the products and services it offers as response to a search intent from the BAP.
' type: object properties: - bpp/descriptor: + descriptor: $ref: '#/components/schemas/Descriptor' - bpp/categories: - type: array - items: - $ref: '#/components/schemas/Category' - bpp/fulfillments: + fulfillments: + description: Fulfillment modes offered at the BPP level. This is used when a BPP itself offers fulfillments on behalf of the providers it has onboarded. type: array items: $ref: '#/components/schemas/Fulfillment' - bpp/payments: + payments: + description: Payment terms offered by the BPP for all transactions. This can be overriden at the provider level. type: array items: $ref: '#/components/schemas/Payment' - bpp/offers: + offers: + description: Offers at the BPP-level. This is common across all providers onboarded by the BPP. type: array items: $ref: '#/components/schemas/Offer' - bpp/providers: + providers: type: array items: - allOf: - - $ref: '#/components/schemas/Provider' - - $ref: '#/components/schemas/ProviderCatalog' + $ref: '#/components/schemas/Provider' exp: + description: Timestamp after which catalog will expire type: string - description: Time after which catalog has to be refreshed format: date-time + ttl: + description: Duration in seconds after which this catalog will expire + type: string Category: - description: Describes a category + description: A label under which a collection of items can be grouped. type: object properties: id: + description: ID of the category type: string - description: Unique id of the category parent_category_id: $ref: '#/components/schemas/Category/properties/id' descriptor: $ref: '#/components/schemas/Descriptor' time: $ref: '#/components/schemas/Time' + ttl: + description: Time to live for an instance of this schema tags: - $ref: '#/components/schemas/Tags' + type: array + items: + $ref: '#/components/schemas/TagGroup' Circle: - description: Describes a circular area on the map - allOf: - - $ref: '#/components/schemas/Gps' - - properties: - radius: - $ref: '#/components/schemas/Scalar' + description: Describes a circular region of a specified radius centered at a specified GPS coordinate. + type: object + properties: + gps: + $ref: '#/components/schemas/Gps' + radius: + $ref: '#/components/schemas/Scalar' City: description: Describes a city type: object properties: name: - type: string description: Name of the city - code: type: string + code: description: City code + type: string Contact: + description: Describes the contact information of an entity type: object properties: phone: type: string email: type: string - tags: - $ref: '#/components/schemas/Tags' + jcard: + type: object + description: A Jcard object as per draft-ietf-jcardcal-jcard-03 specification Context: - description: Describes a beckn message context + description: 'Every API call in beckn protocol has a context. It provides a high-level overview to the receiver about the nature of the intended transaction. Typically, it is the BAP that sets the transaction context based on the consumer''s location and action on their UI. But sometimes, during unsolicited callbacks, the BPP also sets the transaction context but it is usually the same as the context of a previous full-cycle, request-callback interaction between the BAP and the BPP. The context object contains four types of fields.
  1. Demographic information about the transaction using fields like `domain`, `country`, and `region`.
  2. Addressing details like the sending and receiving platform''s ID and API URL.
  3. Interoperability information like the protocol version that implemented by the sender and,
  4. Transaction details like the method being called at the receiver''s endpoint, the transaction_id that represents an end-to-end user session at the BAP, a message ID to pair requests with callbacks, a timestamp to capture sending times, a ttl to specifiy the validity of the request, and a key to encrypt information if necessary.
This object must be passed in every interaction between a BAP and a BPP. In HTTP/S implementations, it is not necessary to send the context during the synchronous response. However, in asynchronous protocols, the context must be sent during all interactions,' type: object properties: domain: - $ref: '#/components/schemas/Domain' - country: - $ref: '#/components/schemas/Country/properties/code' - city: - $ref: '#/components/schemas/City/properties/code' + description: Domain code that is relevant to this transaction context + allOf: + - $ref: '#/components/schemas/Domain/properties/code' + location: + description: The location where the transaction is intended to be fulfilled. + allOf: + - $ref: '#/components/schemas/Location' action: + description: The Beckn protocol method being called by the sender and executed at the receiver. type: string - description: Defines the Beckn API call. Any actions other than the ennumerated actions are not supported by Beckn Protocol - enum: - - search - - select - - init - - confirm - - update - - status - - track - - cancel - - feedback - - support - - on_search - - on_select - - on_init - - on_confirm - - on_update - - on_status - - on_track - - on_cancel - - on_feedback - - on_support - - ack - core_version: - type: string - description: Version of Beckn core API specification being used - bap_id: + version: type: string - format: uri - description: This is registered domain name of the BAP. Must be an HTTPS domain in open networks + description: Version of transaction protocol being used by the sender. + bap_id: + description: Subscriber ID of the BAP + allOf: + - description: 'A globally unique identifier of the platform, Typically it is the fully qualified domain name (FQDN) of the platform.' + type: string bap_uri: - type: string - format: uri - description: URI of the BAP. Must have the same domain name as the bap_id + description: Subscriber URL of the BAP for accepting callbacks from BPPs. + allOf: + - description: The callback URL of the Subscriber. This should necessarily contain the same domain name as set in `subscriber_id``. + type: string + format: uri bpp_id: - type: string - format: uri - description: This is registered domain name of the BPP. Must be an HTTPS domain in open networks + description: Subscriber ID of the BPP + allOf: + - $ref: '#/components/schemas/Context/properties/bap_id/allOf/0' bpp_uri: - type: string - format: uri - description: URI of the BPP. Must have the same domain name as the bap_id + description: Subscriber URL of the BPP for accepting calls from BAPs. + allOf: + - $ref: '#/components/schemas/Context/properties/bap_uri/allOf/0' transaction_id: + description: 'This is a unique value which persists across all API calls from `search` through `confirm`. This is done to indicate an active user session across multiple requests. The BPPs can use this value to push personalized recommendations, and dynamic offerings related to an ongoing transaction despite being unaware of the user active on the BAP.' type: string - description: 'This is a unique value which persists across all API calls from search through confirm. The format for transaction id is an ecrypted value of the following string. ''{bap_id}/{timestamp}/{ttl}/{random nonce}'' using a key known only to the BAP. The BAP will decrypt this value to compare the callback transaction_id with the request transaction_id' + format: uuid message_id: + description: 'This is a unique value which persists during a request / callback cycle. Since beckn protocol APIs are asynchronous, BAPs need a common value to match an incoming callback from a BPP to an earlier call. This value can also be used to ignore duplicate messages coming from the BPP. It is recommended to generate a fresh message_id for every new interaction. When sending unsolicited callbacks, BPPs must generate a new message_id.' type: string - description: 'This is a unique value which persists during a request / callback cycle. The format for transaction id is an ecrypted value of the following string. ''{bap_id}/{action}/{timestamp}/{ttl}/{random nonce}'' using a key known only to the BAP. The BAP will decrypt this value to compare the callback message_id with the request message_id' + format: uuid timestamp: + description: Time of request generation in RFC3339 format type: string format: date-time - description: Time of request generation in RFC3339 format key: - type: string description: The encryption public key of the sender + type: string ttl: - $ref: '#/components/schemas/Duration' - required: - - domain - - action - - country - - city - - core_version - - transaction_id - - message_id - - bap_id - - bap_uri - - timestamp + description: The duration in ISO8601 format after timestamp for which this message holds valid + type: string Country: - description: Describes a country. + description: Describes a country type: object properties: name: @@ -1541,265 +997,256 @@ components: code: type: string description: Country code as per ISO 3166-1 and ISO 3166-2 format + Credential: + description: Describes a credential of an entity - Person or Organization + type: object + properties: + id: + type: string + type: + type: string + default: VerifiableCredential + url: + description: URL of the credential + type: string + format: uri + Customer: + description: Describes a customer buying/availing a product or a service + type: object + properties: + person: + $ref: '#/components/schemas/Person' + contact: + $ref: '#/components/schemas/Contact' DecimalValue: - description: Describes a decimal value + description: Describes a numerical value in decimal form type: string pattern: '[+-]?([0-9]*[.])?[0-9]+' - Descriptor: - description: Describes the description of a real-world object. Maintained by Beckn Foundation + description: Physical description of something. type: object properties: name: type: string code: type: string - symbol: - type: string short_desc: type: string long_desc: type: string + additional_desc: + type: object + properties: + url: + type: string + content_type: + type: string + enum: + - text/plain + - text/html + - application/json + media: + type: array + items: + $ref: '#/components/schemas/MediaFile' images: type: array items: $ref: '#/components/schemas/Image' - audio: + Domain: + description: 'Described the industry sector or sub-sector. The network policy should contain codes for all the industry sectors supported by the network. Domains can be created in varying levels of granularity. The granularity of a domain can be decided by the participants of the network. Too broad domains will result in irrelevant search broadcast calls to BPPs that don''t have services supporting the domain. Too narrow domains will result in a large number of registry entries for each BPP. It is recommended that network facilitators actively collaborate with various working groups and network participants to carefully choose domain codes keeping in mind relevance, performance, and opportunity cost. It is recommended that networks choose broad domains like mobility, logistics, healthcare etc, and progressively granularize them as and when the number of network participants for each domain grows large.' + type: object + properties: + name: + description: Name of the domain type: string - format: uri - 3d_render: - type: string - format: uri - - Dimensions: - description: Describes the dimensions of a real-world object - type: object - properties: - length: - $ref: '#/components/schemas/Scalar' - breadth: - $ref: '#/components/schemas/Scalar' - height: - $ref: '#/components/schemas/Scalar' - Domain: - description: Describes the domain of an object - type: string - + code: + description: 'Standard code representing the domain. The standard is usually published as part of the network policy. Furthermore, the network facilitator should also provide a mechanism to provide the supported domains of a network.' + additional_info: + description: A url that contains addtional information about that domain. + allOf: + - $ref: '#/components/schemas/MediaFile' Duration: description: Describes duration as per ISO8601 format type: string - Error: - description: Describes an error object + description: 'Describes an error object that is returned by a BAP, BPP or BG as a response or callback to an action by another network participant. This object is sent when any request received by a network participant is unacceptable. This object can be sent either during Ack or with the callback.' type: object properties: - type: - type: string - enum: - - CONTEXT-ERROR - - CORE-ERROR - - DOMAIN-ERROR - - POLICY-ERROR - - JSON-SCHEMA-ERROR code: type: string - description: 'Beckn specific error code. For full list of error codes, refer to error_codes.md in the root folder of this repo' - path: + description: 'Standard error code. For full list of error codes, refer to docs/protocol-drafts/BECKN-005-ERROR-CODES-DRAFT-01.md of this repo"' + paths: type: string description: Path to json schema generating the error. Used only during json schema validation errors message: type: string - description: Human readable message descirbing the error - required: - - type - - code - - Feedback: - description: Feedback for a service + description: Human readable message describing the error. Used mainly for logging. Not recommended to be shown to the user. + Fee: + description: A fee applied on a particular entity type: object properties: - id: + percentage: + description: Percentage of a value + allOf: + - $ref: '#/components/schemas/DecimalValue' + amount: + description: A fixed value + allOf: + - $ref: '#/components/schemas/Price' + Form: + description: Describes a form + type: object + properties: + url: + description: 'The URL from where the form can be fetched. The content fetched from the url must be processed as per the mime_type specified in this object. Once fetched, the rendering platform can choosed to render the form as-is as an embeddable element; or process it further to blend with the theme of the application. In case the interface is non-visual, the the render can process the form data and reproduce it as per the standard specified in the form.' type: string - descriptor: + format: uri + data: + description: The form submission data + type: object + additionalProperties: + type: string + mime_type: + description: This field indicates the nature and format of the form received by querying the url. MIME types are defined and standardized in IETF's RFC 6838. type: string - parent_id: + enum: + - text/html + - application/xml + submission_id: type: string - - - - + format: uuid Fulfillment: - description: Describes how a single product/service will be rendered/fulfilled to the end customer + description: Describes how a an order will be rendered/fulfilled to the end-customer type: object properties: id: - type: string description: Unique reference ID to the fulfillment of an order + type: string type: + description: 'A code that describes the mode of fulfillment. This is typically set when there are multiple ways an order can be fulfilled. For example, a retail order can be fulfilled either via store pickup or a home delivery. Similarly, a medical consultation can be provided either in-person or via tele-consultation. The network policy must publish standard fulfillment type codes for the different modes of fulfillment.' type: string - description: This describes the type of fulfillment - enum: - - Home-Delivery - - Store-Pickup - - Store-Pickup-And-Home-Delivery + rateable: + description: Whether the fulfillment can be rated or not + type: boolean + rating: + description: The rating value of the fulfullment service. + allOf: + - $ref: '#/components/schemas/Rating/properties/value' state: - $ref: '#/components/schemas/FulfillmentState' + description: The current state of fulfillment. The BPP must set this value whenever the state of the order fulfillment changes and fire an unsolicited `on_status` call. + allOf: + - $ref: '#/components/schemas/FulfillmentState' tracking: type: boolean description: Indicates whether the fulfillment allows tracking default: false + customer: + description: The person that will ultimately receive the order + allOf: + - $ref: '#/components/schemas/Customer' agent: - description: The person who fulfills the order + description: The agent that is currently handling the fulfillment of the order allOf: - - $ref: '#/components/schemas/Person' - - $ref: '#/components/schemas/Contact' + - $ref: '#/components/schemas/Agent' + contact: + $ref: '#/components/schemas/Contact' vehicle: $ref: '#/components/schemas/Vehicle' - start: - description: Details on the start of fulfillment - type: object - properties: - location: - $ref: '#/components/schemas/Location' - time: - $ref: '#/components/schemas/Time' - instructions: - $ref: '#/components/schemas/Descriptor' - contact: - $ref: '#/components/schemas/Contact' - end: - description: Details on the end of fulfillment - type: object - properties: - location: - $ref: '#/components/schemas/Location' - time: - $ref: '#/components/schemas/Time' - instructions: - $ref: '#/components/schemas/Descriptor' - contact: - $ref: '#/components/schemas/Contact' - purpose: + stops: + description: The list of logical stops encountered during the fulfillment of an order. + type: array + items: + $ref: '#/components/schemas/Stop' + path: + description: The physical path taken by the agent that can be rendered on a map. The allowed format of this property can be set by the network. type: string tags: - $ref: '#/components/schemas/Tags' + type: array + items: + $ref: '#/components/schemas/TagGroup' FulfillmentState: - description: Describes a fulfillment state + description: Describes the state of fulfillment type: object properties: descriptor: - $ref: '#/components/schemas/FulfillmentDescriptor' + $ref: '#/components/schemas/Descriptor' updated_at: type: string format: date-time updated_by: type: string description: ID of entity which changed the state - FulfillmentDescriptor: - description: Describes the description of a fulfillment object + Gps: + description: Describes a GPS coordinate + type: string + pattern: '^[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?),\s*[-+]?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?)$' + Image: + description: Describes an image type: object properties: - name: + url: + description: URL to the image. This can be a data url or an remote url type: string - code: + format: uri + size_type: + description: The size of the image. The network policy can define the default dimensions of each type type: string enum: - - Pending-Fulfillment - - Packing - - Picking - - Shipped - - Out-for-Delivery - - Delivered - - Failed-Fulfillment - - Canceled - - Returned - symbol: - type: string - short_desc: - type: string - long_desc: - type: string - images: - type: array - items: - $ref: '#/components/schemas/Image' - audio: + - xs + - sm + - md + - lg + - xl + - custom + width: + description: Width of the image in pixels type: string - format: uri - 3d_render: + height: + description: Height of the image in pixels type: string - format: uri - - Gps: - description: Describes a gps coordinate - type: string - pattern: '^[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?),\s*[-+]?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?)$' - Image: - description: 'Image of an object.

A url based image will look like

```uri:http://path/to/image```

An image can also be sent as a data string. For example :

```data:js87y34ilhriuho84r3i4```' - type: string Intent: - description: Intent of a user. Used for searching for services + description: 'The intent to buy or avail a product or a service. The BAP can declare the intent of the consumer containing
  • What they want (A product, service, offer)
  • Who they want (A seller, service provider, agent etc)
  • Where they want it and where they want it from
  • When they want it (start and end time of fulfillment
  • How they want to pay for it

This has properties like descriptor,provider,fulfillment,payment,category,offer,item,tags
This is typically used by the BAP to send the purpose of the user''s search to the BPP. This will be used by the BPP to find products or services it offers that may match the user''s intent.
For example, in Mobility, the mobility consumer declares a mobility intent. In this case, the mobility consumer declares information that describes various aspects of their journey like,
  • Where would they like to begin their journey (intent.fulfillment.start.location)
  • Where would they like to end their journey (intent.fulfillment.end.location)
  • When would they like to begin their journey (intent.fulfillment.start.time)
  • When would they like to end their journey (intent.fulfillment.end.time)
  • Who is the transport service provider they would like to avail services from (intent.provider)
  • Who is traveling (This is not recommended in public networks) (intent.fulfillment.customer)
  • What kind of fare product would they like to purchase (intent.item)
  • What add-on services would they like to avail
  • What offers would they like to apply on their booking (intent.offer)
  • What category of services would they like to avail (intent.category)
  • What additional luggage are they carrying
  • How would they like to pay for their journey (intent.payment)

For example, in health domain, a consumer declares the intent for a lab booking the describes various aspects of their booking like,
  • Where would they like to get their scan/test done (intent.fulfillment.start.location)
  • When would they like to get their scan/test done (intent.fulfillment.start.time)
  • When would they like to get the results of their test/scan (intent.fulfillment.end.time)
  • Who is the service provider they would like to avail services from (intent.provider)
  • Who is getting the test/scan (intent.fulfillment.customer)
  • What kind of test/scan would they like to purchase (intent.item)
  • What category of services would they like to avail (intent.category)
  • How would they like to pay for their journey (intent.payment)
' type: object properties: - query_string: - type: string + descriptor: + description: 'A raw description of the search intent. Free text search strings, raw audio, etc can be sent in this object.' + allOf: + - $ref: '#/components/schemas/Descriptor' provider: - type: object - properties: - id: - $ref: '#/components/schemas/Provider/properties/id' - descriptor: - $ref: '#/components/schemas/Descriptor' - locations: - type: array - maxItems: 1 - items: - type: object - properties: - id: - $ref: '#/components/schemas/Location/properties/id' + description: The provider from which the customer wants to place to the order from + allOf: + - $ref: '#/components/schemas/Provider' fulfillment: - type: object - properties: - id: - $ref: '#/components/schemas/Fulfillment/properties/id' - start: - type: object - properties: - location: - $ref: '#/components/schemas/Location' - time: - $ref: '#/components/schemas/Time' - end: - type: object - properties: - location: - $ref: '#/components/schemas/Location' - time: - $ref: '#/components/schemas/Time' - tags: - $ref: '#/components/schemas/Tags' - vehicle: - $ref: '#/components/schemas/Vehicle' - + description: Details on how the customer wants their order fulfilled + allOf: + - $ref: '#/components/schemas/Fulfillment' payment: - $ref: '#/components/schemas/Payment' + description: Details on how the customer wants to pay for the order + allOf: + - $ref: '#/components/schemas/Payment' category: - $ref: '#/components/schemas/Category' + description: Details on the item category + allOf: + - $ref: '#/components/schemas/Category' offer: - $ref: '#/components/schemas/Offer' + description: details on the offer the customer wants to avail + allOf: + - $ref: '#/components/schemas/Offer' item: - $ref: '#/components/schemas/Item' - purpose: - type: string + description: Details of the item that the consumer wants to order + allOf: + - $ref: '#/components/schemas/Item' tags: - $ref: '#/components/schemas/Tags' - + type: array + items: + $ref: '#/components/schemas/TagGroup' ItemQuantity: - description: Describes count or amount of an item + description: Describes the count or amount of an item type: object properties: allocated: + description: This represents the exact quantity allocated for purchase of the item. type: object properties: count: @@ -1808,6 +1255,7 @@ components: measure: $ref: '#/components/schemas/Scalar' available: + description: This represents the exact quantity available for purchase of the item. The buyer can only purchase multiples of this type: object properties: count: @@ -1816,6 +1264,7 @@ components: measure: $ref: '#/components/schemas/Scalar' maximum: + description: This represents the maximum quantity allowed for purchase of the item type: object properties: count: @@ -1824,6 +1273,7 @@ components: measure: $ref: '#/components/schemas/Scalar' minimum: + description: This represents the minimum quantity allowed for purchase of the item type: object properties: count: @@ -1832,6 +1282,7 @@ components: measure: $ref: '#/components/schemas/Scalar' selected: + description: This represents the quantity selected for purchase of the item type: object properties: count: @@ -1839,81 +1290,209 @@ components: minimum: 0 measure: $ref: '#/components/schemas/Scalar' + unitized: + description: This represents the quantity available in a single unit of the item + type: object + properties: + count: + type: integer + minimum: 1 + maximum: 1 + measure: + $ref: '#/components/schemas/Scalar' Item: - description: Describes an item. Allows for domain extension. + description: 'Describes a product or a service offered to the end consumer by the provider. In the mobility sector, it can represent a fare product like one way journey. In the logistics sector, it can represent the delivery service offering. In the retail domain it can represent a product like a grocery item.' type: object properties: id: - description: This is the most unique identifier of a service item. An example of an Item ID could be the SKU of a product. + description: ID of the item. type: string - format: '#/components/schemas/Item/properties/id' parent_item_id: - $ref: '#/components/schemas/Item/properties/id' + description: 'ID of the item, this item is a variant of' + allOf: + - $ref: '#/components/schemas/Item/properties/id' + parent_item_quantity: + description: The number of units of the parent item this item is a multiple of + allOf: + - $ref: '#/components/schemas/ItemQuantity' descriptor: - $ref: '#/components/schemas/Descriptor' + description: Physical description of the item + allOf: + - $ref: '#/components/schemas/Descriptor' + creator: + description: The creator of this item + allOf: + - $ref: '#/components/schemas/Organization' price: - $ref: '#/components/schemas/Price' - category_id: - $ref: '#/components/schemas/Category/properties/id' - location_id: - $ref: '#/components/schemas/Location/properties/id' + description: 'The price of this item, if it has intrinsic value' + allOf: + - $ref: '#/components/schemas/Price' + quantity: + description: The selling quantity of the item + allOf: + - $ref: '#/components/schemas/ItemQuantity' + category_ids: + description: Categories this item can be listed under + type: array + items: + allOf: + - $ref: '#/components/schemas/Category/properties/id' + fulfillment_ids: + description: Modes through which this item can be fulfilled + type: array + items: + allOf: + - $ref: '#/components/schemas/Fulfillment/properties/id' + location_ids: + description: Provider Locations this item is available in + type: array + items: + allOf: + - $ref: '#/components/schemas/Location/properties/id' + payment_ids: + description: Payment modalities through which this item can be ordered + type: array + items: + allOf: + - $ref: '#/components/schemas/Payment/properties/id' + add_ons: + type: array + items: + $ref: '#/components/schemas/AddOn' + cancellation_terms: + description: Cancellation terms of this item + type: array + items: + $ref: '#/components/schemas/CancellationTerm' + refund_terms: + description: Refund terms of this item + type: array + items: + description: Refund term of an item or an order + type: object + properties: + fulfillment_state: + description: The state of fulfillment during which this term is applicable. + allOf: + - $ref: '#/components/schemas/State' + refund_eligible: + description: Indicates if cancellation will result in a refund + type: boolean + refund_within: + description: Time within which refund will be processed after successful cancellation. + allOf: + - $ref: '#/components/schemas/Time' + refund_amount: + $ref: '#/components/schemas/Price' + replacement_terms: + description: Terms that are applicable be met when this item is replaced + type: array + items: + $ref: '#/components/schemas/ReplacementTerm' + return_terms: + description: Terms that are applicable when this item is returned + type: array + items: + $ref: '#/components/schemas/ReturnTerm' + xinput: + description: Additional input required from the customer to purchase / avail this item + allOf: + - $ref: '#/components/schemas/XInput' time: - $ref: '#/components/schemas/Time' + description: Temporal attributes of this item. This property is used when the item exists on the catalog only for a limited period of time. + allOf: + - $ref: '#/components/schemas/Time' + rateable: + description: Whether this item can be rated + type: boolean + rating: + description: The rating of the item + allOf: + - $ref: '#/components/schemas/Rating/properties/value' matched: + description: Whether this item is an exact match of the request type: boolean related: + description: Whether this item is a related item to the exactly matched item type: boolean recommended: + description: Whether this item is a recommended item to a response type: boolean - tags: - $ref: '#/components/schemas/Tags' - Language: - description: indicates language code. Beckn supports language codes as per ISO 639.2 standard - type: object - properties: - code: + ttl: + description: Time to live in seconds for an instance of this schema type: string + tags: + type: array + items: + $ref: '#/components/schemas/TagGroup' Location: - description: Describes the location of a runtime object. Extension not allowed + description: The physical location of something type: object properties: id: type: string descriptor: $ref: '#/components/schemas/Descriptor' + map_url: + description: The url to the map of the location. This can be a globally recognized map url or the one specified by the network policy. + type: string + format: uri gps: - $ref: '#/components/schemas/Gps' + description: The GPS co-ordinates of this location. + allOf: + - $ref: '#/components/schemas/Gps' address: - $ref: '#/components/schemas/Address' - station_code: - type: string + description: The address of this location. + allOf: + - $ref: '#/components/schemas/Address' city: - $ref: '#/components/schemas/City' + description: 'The city this location is, or is located within' + allOf: + - $ref: '#/components/schemas/City' + district: + description: 'The state this location is, or is located within' + type: string + state: + description: 'The state this location is, or is located within' + allOf: + - $ref: '#/components/schemas/State' country: - $ref: '#/components/schemas/Country' + description: 'The country this location is, or is located within' + allOf: + - $ref: '#/components/schemas/Country' + area_code: + type: string circle: $ref: '#/components/schemas/Circle' polygon: + description: The boundary polygon of this location type: string 3dspace: + description: The three dimensional region describing this location type: string - - MonetaryValue: - description: Describes a monetary value used for exchange + rating: + description: The rating of this location + allOf: + - $ref: '#/components/schemas/Rating/properties/value' + MediaFile: + description: This object contains a url to a media file. type: object properties: - currency: + mimetype: + description: 'indicates the nature and format of the document, file, or assortment of bytes. MIME types are defined and standardized in IETF''s RFC 6838' + type: string + url: + description: The URL of the file + type: string + format: uri + signature: + description: The digital signature of the file signed by the sender + type: string + dsa: + description: The signing algorithm used by the sender type: string - value: - $ref: '#/components/schemas/DecimalValue' - - Name: - type: string - description: 'Describes the name of a person in format: ./{given_name}/{honorific_prefix}/{first_name}/{middle_name}/{last_name}/{honorific_suffix}' - pattern: '^\./[^/]+/[^/]*/[^/]*/[^/]*/[^/]*/[^/]*$' - Offer: - description: Describes an offer + description: An offer associated with a catalog. This is typically used to promote a particular product and enable more purchases. type: object properties: id: @@ -1934,22 +1513,10 @@ components: $ref: '#/components/schemas/Item/properties/id' time: $ref: '#/components/schemas/Time' - - Operator: - description: Describes the agent of a service - allOf: - - $ref: "#/components/schemas/Person" - - properties: - experience: - type: object - properties: - label: - type: string - value: - type: string - unit: - type: string - + tags: + type: array + items: + $ref: '#/components/schemas/TagGroup' Option: description: Describes a selectable option type: object @@ -1959,146 +1526,168 @@ components: descriptor: $ref: '#/components/schemas/Descriptor' Order: - description: Describes the details of an order + description: Describes a legal purchase order. It contains the complete details of the legal contract created between the buyer and the seller. type: object properties: id: type: string - description: Hash of order object without id - state: + description: Human-readable ID of the order. This is generated at the BPP layer. The BPP can either generate order id within its system or forward the order ID created at the provider level. + ref_order_ids: + description: A list of order IDs to link this order to previous orders. + type: array + items: + type: string + description: ID of a previous order + status: + description: Status of the order. Allowed values can be defined by the network policy + type: string + enum: + - ACTIVE + - COMPLETE + - CANCELLED + type: + description: 'This is used to indicate the type of order being created to BPPs. Sometimes orders can be linked to previous orders, like a replacement order in a retail domain. A follow-up consultation in healthcare domain. A single order part of a subscription order. The list of order types can be standardized at the network level.' type: string + default: DEFAULT enum: - - Initiated - - Acknowledged - - Packed - - Shipped - - Delivered - - Cancelled + - DRAFT + - DEFAULT provider: - type: object - properties: - id: - $ref: '#/components/schemas/Provider/properties/id' - locations: - type: array - maxItems: 1 - items: - type: object - properties: - id: - $ref: '#/components/schemas/Location/properties/id' - required: - - id - required: - - id - - locations + description: Details of the provider whose catalog items have been selected. + allOf: + - $ref: '#/components/schemas/Provider' items: + description: The items purchased / availed in this order type: array items: - type: object - properties: - id: - $ref: '#/components/schemas/Item/properties/id' - quantity: - $ref: '#/components/schemas/ItemQuantity/properties/selected' - required: - - id - - quantity + $ref: '#/components/schemas/Item' add_ons: + description: The add-ons purchased / availed in this order type: array items: - type: object - properties: - id: - $ref: '#/components/schemas/AddOn/properties/id' - required: - - id + $ref: '#/components/schemas/AddOn' offers: + description: The offers applied in this order type: array items: - type: object - properties: - id: - $ref: '#/components/schemas/Offer/properties/id' - required: - - id + $ref: '#/components/schemas/Offer' billing: - $ref: '#/components/schemas/Billing' - fulfillment: + description: The billing details of this order allOf: - - $ref: '#/components/schemas/Fulfillment' - - properties: - customer: - allOf: - - $ref: '#/components/schemas/Person' - - $ref: '#/components/schemas/Contact' - - required: - - name - required: - - customer + - $ref: '#/components/schemas/Billing' + fulfillments: + description: The fulfillments involved in completing this order + type: array + items: + $ref: '#/components/schemas/Fulfillment' + cancellation: + description: The cancellation details of this order + allOf: + - $ref: '#/components/schemas/Cancellation' + cancellation_terms: + description: Cancellation terms of this item + type: array + items: + $ref: '#/components/schemas/CancellationTerm' + refund_terms: + description: Refund terms of this item + type: array + items: + $ref: '#/components/schemas/Item/properties/refund_terms/items' + replacement_terms: + description: Replacement terms of this item + type: array + items: + $ref: '#/components/schemas/ReplacementTerm' + return_terms: + description: Return terms of this item + type: array + items: + $ref: '#/components/schemas/ReturnTerm' quote: - $ref: '#/components/schemas/Quotation' - payment: - $ref: '#/components/schemas/Payment' + description: The mutually agreed upon quotation for this order. + allOf: + - $ref: '#/components/schemas/Quotation' + payments: + description: The terms of settlement for this order + type: array + items: + $ref: '#/components/schemas/Payment' created_at: + description: The date-time of creation of this order type: string format: date-time updated_at: + description: The date-time of updated of this order type: string format: date-time - required: - - provider - - items - - add_ons - - offers - - billing - - fulfillment - - quote - - payment - + xinput: + description: Additional input required from the customer to confirm this order + allOf: + - $ref: '#/components/schemas/XInput' + tags: + type: array + items: + $ref: '#/components/schemas/TagGroup' Organization: - description: Describes an organization + description: An organization. Usually a recognized business entity. type: object properties: - name: - type: string - cred: - type: string - Page: - description: Describes a page in a search result + descriptor: + $ref: '#/components/schemas/Descriptor' + address: + description: The postal address of the organization + allOf: + - $ref: '#/components/schemas/Address' + state: + description: The state where the organization's address is registered + allOf: + - $ref: '#/components/schemas/State' + city: + description: The city where the the organization's address is registered + allOf: + - $ref: '#/components/schemas/City' + contact: + $ref: '#/components/schemas/Contact' + Payment: + description: 'Describes the terms of settlement between the BAP and the BPP for a single transaction. When instantiated, this object contains
  1. the amount that has to be settled,
  2. The payment destination destination details
  3. When the settlement should happen, and
  4. A transaction reference ID
. During a transaction, the BPP reserves the right to decide the terms of payment. However, the BAP can send its terms to the BPP first. If the BPP does not agree to those terms, it must overwrite the terms and return them to the BAP. If overridden, the BAP must either agree to the terms sent by the BPP in order to preserve the provider''s autonomy, or abort the transaction. In case of such disagreements, the BAP and the BPP can perform offline negotiations on the payment terms. Once an agreement is reached, the BAP and BPP can resume transactions.' type: object properties: id: + description: ID of the payment term that can be referred at an item or an order level in a catalog type: string - next_id: - type: string - Payment: - description: Describes a payment - type: object - properties: - uri: + collected_by: + description: 'This field indicates who is the collector of payment. The BAP can set this value to ''bap'' if it wants to collect the payment first and settle it to the BPP. If the BPP agrees to those terms, the BPP should not send the payment url. Alternatively, the BPP can set this field with the value ''bpp'' if it wants the payment to be made directly.' + url: type: string - description: 'A payment uri to be called by the BAP. If empty, then the payment is to be done offline. The details of payment should be present in the params object. If ```tl_method``` = http/get, then the payment details will be sent as url params. Two url param values, ```$transaction_id``` and ```$amount``` are mandatory. And example url would be : https://www.example.com/pay?txid=$transaction_id&amount=$amount&vpa=upiid&payee=shopez&billno=1234' + description: 'A payment url to be called by the BAP. If empty, then the payment is to be done offline. The details of payment should be present in the params object. If tl_method = http/get, then the payment details will be sent as url params. Two url param values, ```$transaction_id``` and ```$amount``` are mandatory.' format: uri - tl_method: - type: string - enum: - - http/get - - http/post params: type: object properties: transaction_id: type: string - description: This value will be placed in the the $transaction_id url param in case of http/get and in the requestBody http/post requests + description: The reference transaction ID associated with a payment activity amount: - $ref: '#/components/schemas/MonetaryValue/properties/value' - additionalProperties: - type: string + type: string + currency: + type: string + bank_code: + type: string + bank_account_number: + type: string + virtual_payment_address: + type: string + source_bank_code: + type: string + source_bank_account_number: + type: string + source_virtual_payment_address: + type: string type: type: string enum: - - ON-ORDER + - PRE-ORDER - PRE-FULFILLMENT - ON-FULFILLMENT - POST-FULFILLMENT @@ -2106,62 +1695,104 @@ components: type: string enum: - PAID - - NOT-PATD + - NOT-PAID time: $ref: '#/components/schemas/Time' - + tags: + type: array + items: + $ref: '#/components/schemas/TagGroup' Person: - description: Describes a person. Extension not allowed + description: Describes a person as any individual type: object properties: + id: + type: string + description: Describes the identity of the person + url: + description: Profile url of the person + type: string + format: uri name: - $ref: '#/components/schemas/Name' + description: the name of the person + type: string image: $ref: '#/components/schemas/Image' + age: + description: Age of the person + allOf: + - $ref: '#/components/schemas/Duration' dob: + description: Date of birth of the person type: string format: date gender: type: string - description: 'Gender of something, typically a Person, but possibly also fictional characters, animals, etc. While Male and Female may be used, text strings are also acceptable for people who do not identify as a binary gender' - cred: - type: string + description: 'Gender of something, typically a Person, but possibly also fictional characters, animals, etc. While Male and Female may be used, text strings are also acceptable for people who do not identify as a binary gender.Allowed values for this field can be published in the network policy' + creds: + type: array + items: + $ref: '#/components/schemas/Credential' + languages: + type: array + items: + description: Describes a language known to the person. + type: object + properties: + code: + type: string + name: + type: string + skills: + type: array + items: + description: Describes a skill of the person. + type: object + properties: + code: + type: string + name: + type: string tags: - $ref: '#/components/schemas/Tags' - Policy: - description: Describes a policy. Allows for domain extension. + type: array + items: + $ref: '#/components/schemas/TagGroup' + Price: + description: Describes the price of a product or service + type: object + properties: + currency: + type: string + value: + $ref: '#/components/schemas/DecimalValue' + estimated_value: + $ref: '#/components/schemas/DecimalValue' + computed_value: + $ref: '#/components/schemas/DecimalValue' + listed_value: + $ref: '#/components/schemas/DecimalValue' + offered_value: + $ref: '#/components/schemas/DecimalValue' + minimum_value: + $ref: '#/components/schemas/DecimalValue' + maximum_value: + $ref: '#/components/schemas/DecimalValue' + Provider: + description: Describes the catalog of a business. type: object properties: id: type: string + description: Id of the provider descriptor: $ref: '#/components/schemas/Descriptor' - parent_policy_id: - $ref: '#/components/schemas/Policy/properties/id' + category_id: + type: string + description: Category Id of the provider at the BPP-level catalog + rating: + $ref: '#/components/schemas/Rating/properties/value' time: $ref: '#/components/schemas/Time' - - Price: - description: Describes the price of an item. Allows for domain extension. - allOf: - - $ref: '#/components/schemas/MonetaryValue' - - properties: - estimated_value: - $ref: '#/components/schemas/DecimalValue' - computed_value: - $ref: '#/components/schemas/DecimalValue' - listed_value: - $ref: '#/components/schemas/DecimalValue' - offered_value: - $ref: '#/components/schemas/DecimalValue' - minimum_value: - $ref: '#/components/schemas/DecimalValue' - maximum_value: - $ref: '#/components/schemas/DecimalValue' - ProviderCatalog: - description: Describes a provider catalog - type: object - properties: categories: type: array items: @@ -2177,11 +1808,7 @@ components: locations: type: array items: - allOf: - - $ref: '#/components/schemas/Location' - - properties: - time: - $ref: '#/components/schemas/Time' + $ref: '#/components/schemas/Location' offers: type: array items: @@ -2194,75 +1821,130 @@ components: type: string description: Time after which catalog has to be refreshed format: date-time - - Provider: - description: 'Describes a service provider. This can be a restaurant, a hospital, a Store etc' - type: object - properties: - id: - type: string - description: 'Id of the provider. The syntax of the ID is {unique provider identifier. If the provider name has an @, it has to be escaped}@{bpp_id}' - descriptor: - $ref: '#/components/schemas/Descriptor' - time: - $ref: '#/components/schemas/Time' - locations: + rateable: + description: Whether this provider can be rated or not + type: boolean + ttl: + description: 'The time-to-live in seconds, for this object. This can be overriden at deeper levels. A value of -1 indicates that this object is not cacheable.' + type: integer + minimum: -1 + tags: type: array items: - $ref: '#/components/schemas/Location' - tags: - $ref: '#/components/schemas/Tags' - + $ref: '#/components/schemas/TagGroup' Quotation: - description: Describes a quote + description: 'Describes a quote. It is the estimated price of products or services from the BPP.
This has properties like price, breakup, ttl' type: object properties: + id: + description: ID of the quote. + type: string + format: uuid price: - $ref: '#/components/schemas/Price' + description: The total quoted price + allOf: + - $ref: '#/components/schemas/Price' breakup: + description: the breakup of the total quoted price type: array items: type: object properties: - type: - type: string - enum: - - item - - offer - - add-on - - fulfillment - ref_id: - type: string + item: + $ref: '#/components/schemas/Item' title: type: string price: $ref: '#/components/schemas/Price' ttl: $ref: '#/components/schemas/Duration' - Rating: - description: Describes the rating of a person or an object. Extension not allowed + description: Describes the rating of an entity type: object properties: + rating_category: + description: Category of the entity being rated + type: string + enum: + - Item + - Order + - Fulfillment + - Provider + - Agent + - Support + id: + description: Id of the object being rated + type: string value: - type: number - minimum: 0 - unit: + description: 'Rating value given to the object. This can be a single value or can also contain an inequality operator like gt, gte, lt, lte. This can also contain an inequality expression containing logical operators like && and ||.' type: string - default: U+2B50 - description: 'Follows the unicode 13.0 format for emojis : https://unicode.org/emoji/charts/full-emoji-list.html' - max_value: - type: number - default: 5 - direction: + Region: + description: Describes an arbitrary region of space. The network policy should contain a published list of supported regions by the network. + type: object + properties: + dimensions: + description: 'The number of dimensions that are used to describe any point inside that region. The most common dimensionality of a region is 2, that represents an area on a map. There are regions on the map that can be approximated to one-dimensional regions like roads, railway lines, or shipping lines. 3 dimensional regions are rarer, but are gaining popularity as flying drones are being adopted for various fulfillment services.' type: string enum: - - UP - - DOWN - default: UP - + - '1' + - '2' + - '3' + type: + description: 'The type of region. This is used to specify the granularity of the region represented by this object. Various examples of two-dimensional region types are city, country, state, district, and so on. The network policy should contain a list of all possible region types supported by the network.' + type: string + name: + type: string + description: Name of the region as specified on the map where that region exists. + code: + type: string + description: A standard code representing the region. This should be interpreted in the same way by all network participants. + boundary: + type: string + description: 'A string representing the boundary of the region. One-dimensional regions are represented by polylines. Two-dimensional regions are represented by polygons, and three-dimensional regions can represented by polyhedra.' + map_url: + type: string + description: The url to the map of the region. This can be a globally recognized map or the one specified by the network policy. + ReplacementTerm: + description: The replacement policy of an item or an order + type: object + properties: + fulfillment_state: + description: The state of fulfillment during which this term is applicable. + allOf: + - $ref: '#/components/schemas/State' + replace_within: + description: 'Applicable only for buyer managed returns where the buyer has to replace the item before a certain date-time, failing which they will not be eligible for replacement' + allOf: + - $ref: '#/components/schemas/Time' + external_ref: + $ref: '#/components/schemas/MediaFile' + ReturnTerm: + description: Describes the return policy of an item or an order + type: object + properties: + fulfillment_state: + description: The state of fulfillment during which this term IETF''s applicable. + allOf: + - $ref: '#/components/schemas/State' + return_eligible: + description: Indicates whether the item is eligible for return + type: boolean + return_time: + description: 'Applicable only for buyer managed returns where the buyer has to return the item to the origin before a certain date-time, failing which they will not be eligible for refund.' + allOf: + - $ref: '#/components/schemas/Time' + return_location: + description: The location where the item or order must / will be returned to + allOf: + - $ref: '#/components/schemas/Location' + fulfillment_managed_by: + description: The entity that will perform the return + type: string + enum: + - CONSUMER + - PROVIDER Scalar: - description: An object representing a scalar quantity. Extension allowed only to the limit of vector + description: Describes a scalar type: object properties: type: @@ -2271,26 +1953,22 @@ components: - CONSTANT - VARIABLE value: - type: number + $ref: '#/components/schemas/DecimalValue' estimated_value: - type: number + $ref: '#/components/schemas/DecimalValue' computed_value: - type: number + $ref: '#/components/schemas/DecimalValue' range: type: object properties: min: - type: number + $ref: '#/components/schemas/DecimalValue' max: - type: number + $ref: '#/components/schemas/DecimalValue' unit: type: string - required: - - value - - unit - Schedule: - description: Describes a schedule + description: 'Describes schedule as a repeating time period used to describe a regularly recurring event. At a minimum a schedule will specify frequency which describes the interval between occurrences of the event. Additional information can be provided to specify the schedule more precisely. This includes identifying the timestamps(s) of when the event will take place. Schedules may also have holidays to exclude a specific day from the schedule.
This has properties like frequency, holidays, times' type: object properties: frequency: @@ -2306,88 +1984,99 @@ components: type: string format: date-time State: - description: Describes a state + description: A bounded geopolitical region of governance inside a country. type: object properties: - descriptor: - $ref: '#/components/schemas/Descriptor' - updated_at: + name: type: string - format: date-time - updated_by: + description: Name of the state + code: type: string - description: ID of entity which changed the state - Subscriber: + description: State code as per country or international standards + Stop: + description: A logical point in space and time during the fulfillment of an order. type: object - description: 'Any entity which wants to authenticate itself on a network. This can be a BAP, BPP, BG, BPPR or a BGR.' properties: - subscriber_id: + id: type: string - description: Registered domain name of the subscriber. Must have a valid SSL certificate issued by a Certificate Authority of the operating region + parent_stop_id: + type: string + location: + description: Location of the stop + allOf: + - $ref: '#/components/schemas/Location' type: + description: The type of stop. Allowed values of this property can be defined by the network policy. type: string - enum: - - bap - - bpp - - bg - - bppr - - bgr - cb_url: - type: string - description: Callback URL of the subscriber. The Registry will call this URL's on_subscribe API to validate the subscriber\'s credentials - domain: - $ref: '#/components/schemas/Domain' - city: - $ref: '#/components/schemas/City/properties/code' - country: - $ref: '#/components/schemas/Country/properties/code' - signing_public_key: + time: + description: Timings applicable at the stop. + allOf: + - $ref: '#/components/schemas/Time' + instructions: + description: Instructions that need to be followed at the stop + allOf: + - $ref: '#/components/schemas/Descriptor' + contact: + description: Contact details of the stop + allOf: + - $ref: '#/components/schemas/Contact' + person: + description: The details of the person present at the stop + allOf: + - $ref: '#/components/schemas/Person' + authorization: + $ref: '#/components/schemas/Authorization' + Support: + description: Details of customer support + type: object + properties: + ref_id: type: string - description: 'Signing Public key of the subscriber.

Any subscriber platform (BAP, BPP, BG) who wants to transact on the network must digitally sign the ```requestBody``` using the corresponding private key of this public key and send it in the transport layer header. In case of ```HTTP``` it is the ```Authorization``` header.

The ```Authorization``` will be used to validate the signature of a BAP or BPP.

Furthermore, if an API call is being proxied or multicast by a Beckn Gateway, the BG must use it\''s signing key to digitally sign the ```requestBody``` using the corresponding private key of this public key and send it in the ```Proxy-Authorization``` header.' - encryption_public_key: + callback_phone: type: string - description: Encryption public key of the BAP subscriber. Any BPP must encrypt the ```requestBody.message``` value of the ```on_search``` API using this public key. - status: + format: phone + phone: type: string - enum: - - INITIATED - - UNDER_SUBSCRIPTION - - SUBSCRIBED - - INVALID_SSL - - UNSUBSCRIBED - created: - type: string - description: Timestamp when a subscriber was added to the registry with status = INITIATED - format: date-time - updated: + format: phone + email: type: string - format: date-time - expires: + format: email + url: type: string - description: Expiry timestamp in UTC derived from the ```lease_time``` of the subscriber - format: date-time - - Support: - description: Customer support + format: uri + Tag: + description: 'Describes a tag. This is used to contain extended metadata. This object can be added as a property to any schema to describe extended attributes. For BAPs, tags can be sent during search to optimize and filter search results. BPPs can use tags to index their catalog to allow better search functionality. Tags are sent by the BPP as part of the catalog response in the `on_search` callback. Tags are also meant for display purposes. Upon receiving a tag, BAPs are meant to render them as name-value pairs. This is particularly useful when rendering tabular information about a product or service.' type: object properties: - type: - type: string - enum: - - order - - billing - - fulfillment - ref_id: + descriptor: + description: 'Description of the Tag, can be used to store detailed information.' + allOf: + - $ref: '#/components/schemas/Descriptor' + value: + description: The value of the tag. This set by the BPP and rendered as-is by the BAP. type: string - channels: - $ref: '#/components/schemas/Tags' - - Tags: - description: Describes a tag. This is a simple key-value store which is used to contain extended metadata - additionalProperties: - type: string + display: + description: 'This value indicates if the tag is intended for display purposes. If set to `true`, then this tag must be displayed. If it is set to `false`, it should not be displayed. This value can override the group display value.' + type: boolean + TagGroup: + description: 'A collection of tag objects with group level attributes. For detailed documentation on the Tags and Tag Groups schema go to https://github.com/beckn/protocol-specifications/discussions/316' + type: object + properties: + display: + description: 'Indicates the display properties of the tag group. If display is set to false, then the group will not be displayed. If it is set to true, it should be displayed. However, group-level display properties can be overriden by individual tag-level display property. As this schema is purely for catalog display purposes, it is not recommended to send this value during search.' + type: boolean + default: true + descriptor: + description: 'Description of the TagGroup, can be used to store detailed information.' + allOf: + - $ref: '#/components/schemas/Descriptor' + list: + description: 'An array of Tag objects listed under this group. This property can be set by BAPs during search to narrow the `search` and achieve more relevant results. When received during `on_search`, BAPs must render this list under the heading described by the `name` property of this schema.' + type: array + items: + $ref: '#/components/schemas/Tag' Time: - description: Describes time in its various forms. It can be a single point in time; duration; or a structured timetable of operations + description: 'Describes time in its various forms. It can be a single point in time; duration; or a structured timetable of operations
This has properties like label, time stamp,duration,range, days, schedule' type: object properties: label: @@ -2409,31 +2098,31 @@ components: days: type: string description: comma separated values representing days of the week - - TrackingData: - description: Describes tracking data object during live tracking of an order - $ref: '#/components/schemas/Location/properties/gps' - + schedule: + $ref: '#/components/schemas/Schedule' Tracking: - description: Describes the tracking info of an object + description: Contains tracking information that can be used by the BAP to track the fulfillment of an order in real-time. which is useful for knowing the location of time sensitive deliveries. type: object properties: - tl_method: + id: + description: A unique tracking reference number type: string - enum: - - http/get - - ws url: + description: 'A URL to the tracking endpoint. This can be a link to a tracking webpage, a webhook URL created by the BAP where BPP can push the tracking data, or a GET url creaed by the BPP which the BAP can poll to get the tracking data. It can also be a websocket URL where the BPP can push real-time tracking data.' type: string format: uri + location: + description: 'In case there is no real-time tracking endpoint available, this field will contain the latest location of the entity being tracked. The BPP will update this value everytime the BAP calls the track API.' + allOf: + - $ref: '#/components/schemas/Location' status: + description: 'This value indicates if the tracking is currently active or not. If this value is `active`, then the BAP can begin tracking the order. If this value is `inactive`, the tracking URL is considered to be expired and the BAP should stop tracking the order.' type: string enum: - active - inactive - Vehicle: - description: Describes the properties of a vehicle used in a mobility service + description: 'Describes a vehicle is a device that is designed or used to transport people or cargo over land, water, air, or through space.
This has properties like category, capacity, make, model, size,variant,color,energy_type,registration' type: object properties: category: @@ -2454,3 +2143,22 @@ components: type: string registration: type: string + wheels_count: + type: string + cargo_volumne: + type: string + wheelchair_access: + type: string + code: + type: string + emission_standard: + type: string + XInput: + description: 'Contains any additional or extended inputs required to confirm an order. This is typically a Form Input. Sometimes, selection of catalog elements is not enough for the BPP to confirm an order. For example, to confirm a flight ticket, the airline requires details of the passengers along with information on baggage, identity, in addition to the class of ticket. Similarly, a logistics company may require details on the nature of shipment in order to confirm the shipping. A recruiting firm may require additional details on the applicant in order to confirm a job application. For all such purposes, the BPP can choose to send this object attached to any object in the catalog that is required to be sent while placing the order. This object can typically be sent at an item level or at the order level. The item level XInput will override the Order level XInput as it indicates a special requirement of information for that particular item. Hence the BAP must render a separate form for the Item and another form at the Order level before confirmation.' + type: object + properties: + form: + $ref: '#/components/schemas/Form' + required: + description: Indicates whether the form data is mandatorily required by the BPP to confirm the order. + type: boolean \ No newline at end of file From 857d11f28166aa59c5d898c5cc6248fdfa4d33c1 Mon Sep 17 00:00:00 2001 From: Rajaneesh Date: Thu, 18 Jan 2024 11:48:53 +0530 Subject: [PATCH 07/26] added a reference to core 1.1.0 --- .gitmodules | 3 +++ api/core | 1 + 2 files changed, 4 insertions(+) create mode 160000 api/core diff --git a/.gitmodules b/.gitmodules index e69de29..4c55563 100644 --- a/.gitmodules +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "api/core"] + path = api/core + url = https://github.com/beckn/protocol-specifications diff --git a/api/core b/api/core new file mode 160000 index 0000000..8479762 --- /dev/null +++ b/api/core @@ -0,0 +1 @@ +Subproject commit 8479762c101c385125cd66ecb907817ed6bdd231 From 9503b86503ffa4e202b5687a9f44062db841bee3 Mon Sep 17 00:00:00 2001 From: Rajaneesh Date: Thu, 18 Jan 2024 14:24:22 +0530 Subject: [PATCH 08/26] sanitizing the enums --- api/enums/Cancellation-Type.json | 4 - ...scriptor-Additional_desc-Content_type.json | 5 ++ api/enums/Form-Mime_Type.json | 4 + ...e.json => FulfillmentDescriptor-Code.json} | 0 api/enums/Image-Size_Type.json | 8 ++ .../{Order-State.json => Order-Status.json} | 0 api/enums/Order-Type.json | 4 + api/enums/Payment-Collected_by.json | 4 + api/enums/Payment-TL_method.json | 4 - api/enums/Rating-Direction.json | 4 - api/enums/Rating-Rating_Category.json | 8 ++ api/enums/Region-Dimention.json | 5 ++ api/enums/Subscriber-Status.json | 7 -- api/enums/Subscriber-Type.json | 7 -- api/enums/Tracking-TL_method.json | 4 - api/logistics.yaml | 85 ++++++++++++++++--- 16 files changed, 110 insertions(+), 43 deletions(-) delete mode 100644 api/enums/Cancellation-Type.json create mode 100644 api/enums/Descriptor-Additional_desc-Content_type.json create mode 100644 api/enums/Form-Mime_Type.json rename api/enums/{Fulfillment-State-Descriptor-Code.json => FulfillmentDescriptor-Code.json} (100%) create mode 100644 api/enums/Image-Size_Type.json rename api/enums/{Order-State.json => Order-Status.json} (100%) create mode 100644 api/enums/Order-Type.json create mode 100644 api/enums/Payment-Collected_by.json delete mode 100644 api/enums/Payment-TL_method.json delete mode 100644 api/enums/Rating-Direction.json create mode 100644 api/enums/Rating-Rating_Category.json create mode 100644 api/enums/Region-Dimention.json delete mode 100644 api/enums/Subscriber-Status.json delete mode 100644 api/enums/Subscriber-Type.json delete mode 100644 api/enums/Tracking-TL_method.json diff --git a/api/enums/Cancellation-Type.json b/api/enums/Cancellation-Type.json deleted file mode 100644 index 59a0228..0000000 --- a/api/enums/Cancellation-Type.json +++ /dev/null @@ -1,4 +0,0 @@ -[ - "Full", - "Partial" -] \ No newline at end of file diff --git a/api/enums/Descriptor-Additional_desc-Content_type.json b/api/enums/Descriptor-Additional_desc-Content_type.json new file mode 100644 index 0000000..fbd5735 --- /dev/null +++ b/api/enums/Descriptor-Additional_desc-Content_type.json @@ -0,0 +1,5 @@ +[ + "text/plain", + "text/html", + "application/json" +] \ No newline at end of file diff --git a/api/enums/Form-Mime_Type.json b/api/enums/Form-Mime_Type.json new file mode 100644 index 0000000..806e6f1 --- /dev/null +++ b/api/enums/Form-Mime_Type.json @@ -0,0 +1,4 @@ +[ + "text/html", + "application/xml" +] \ No newline at end of file diff --git a/api/enums/Fulfillment-State-Descriptor-Code.json b/api/enums/FulfillmentDescriptor-Code.json similarity index 100% rename from api/enums/Fulfillment-State-Descriptor-Code.json rename to api/enums/FulfillmentDescriptor-Code.json diff --git a/api/enums/Image-Size_Type.json b/api/enums/Image-Size_Type.json new file mode 100644 index 0000000..20289bb --- /dev/null +++ b/api/enums/Image-Size_Type.json @@ -0,0 +1,8 @@ +[ + "xs", + "sm", + "md", + "lg", + "xl", + "custom" +] \ No newline at end of file diff --git a/api/enums/Order-State.json b/api/enums/Order-Status.json similarity index 100% rename from api/enums/Order-State.json rename to api/enums/Order-Status.json diff --git a/api/enums/Order-Type.json b/api/enums/Order-Type.json new file mode 100644 index 0000000..39b5d19 --- /dev/null +++ b/api/enums/Order-Type.json @@ -0,0 +1,4 @@ +[ + "DRAFT", + "DEFAULT" +] \ No newline at end of file diff --git a/api/enums/Payment-Collected_by.json b/api/enums/Payment-Collected_by.json new file mode 100644 index 0000000..c6e6264 --- /dev/null +++ b/api/enums/Payment-Collected_by.json @@ -0,0 +1,4 @@ +[ + "BAP", + "BPP" +] \ No newline at end of file diff --git a/api/enums/Payment-TL_method.json b/api/enums/Payment-TL_method.json deleted file mode 100644 index a065583..0000000 --- a/api/enums/Payment-TL_method.json +++ /dev/null @@ -1,4 +0,0 @@ -[ - "http/get", - "http/post" -] \ No newline at end of file diff --git a/api/enums/Rating-Direction.json b/api/enums/Rating-Direction.json deleted file mode 100644 index 2f9a01b..0000000 --- a/api/enums/Rating-Direction.json +++ /dev/null @@ -1,4 +0,0 @@ -[ - "UP", - "Down" -] \ No newline at end of file diff --git a/api/enums/Rating-Rating_Category.json b/api/enums/Rating-Rating_Category.json new file mode 100644 index 0000000..8cce8e3 --- /dev/null +++ b/api/enums/Rating-Rating_Category.json @@ -0,0 +1,8 @@ +[ + "Item", + "Order", + "Provider", + "Fulfillment", + "Agent", + "Support" +] \ No newline at end of file diff --git a/api/enums/Region-Dimention.json b/api/enums/Region-Dimention.json new file mode 100644 index 0000000..f7421b5 --- /dev/null +++ b/api/enums/Region-Dimention.json @@ -0,0 +1,5 @@ +[ + "1", + "2", + "3" +] \ No newline at end of file diff --git a/api/enums/Subscriber-Status.json b/api/enums/Subscriber-Status.json deleted file mode 100644 index 9ac2543..0000000 --- a/api/enums/Subscriber-Status.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - "INITIATED", - "UNDER_SUBSCRIPTION", - "SUBSCRIBED", - "INVALID_SSL", - "UNSUBSCRIBED" -] \ No newline at end of file diff --git a/api/enums/Subscriber-Type.json b/api/enums/Subscriber-Type.json deleted file mode 100644 index 0b365f3..0000000 --- a/api/enums/Subscriber-Type.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - "bap", - "bpp", - "bg", - "bppr", - "bgr" -] \ No newline at end of file diff --git a/api/enums/Tracking-TL_method.json b/api/enums/Tracking-TL_method.json deleted file mode 100644 index 32f59d9..0000000 --- a/api/enums/Tracking-TL_method.json +++ /dev/null @@ -1,4 +0,0 @@ -[ - "http/get", - "ws" -] \ No newline at end of file diff --git a/api/logistics.yaml b/api/logistics.yaml index 4b3501c..7e1bdd3 100644 --- a/api/logistics.yaml +++ b/api/logistics.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: - title: Beckn Protocol Core - description: Beckn Core Transaction API specification + title: Beckn Hyperlocal Delivery API specification + description: Beckn Hyperlocal Delivery API specification version: 1.1.0 security: - SubscriberAuth: [] @@ -11,7 +11,7 @@ paths: tags: - Beckn Provider Platform (BPP) - Beckn Gateway (BG) - description: BAP declares the customer's intent to buy/avail products or services + description: BAP declares the customer's intent requestBody: content: application/json: @@ -1073,6 +1073,14 @@ components: description: 'Describes an error object that is returned by a BAP, BPP or BG as a response or callback to an action by another network participant. This object is sent when any request received by a network participant is unacceptable. This object can be sent either during Ack or with the callback.' type: object properties: + type: + type: string + enum: + - CONTEXT-ERROR + - CORE-ERROR + - DOMAIN-ERROR + - POLICY-ERROR + - JSON_SCHEMA-ERROR code: type: string description: 'Standard error code. For full list of error codes, refer to docs/protocol-drafts/BECKN-005-ERROR-CODES-DRAFT-01.md of this repo"' @@ -1126,6 +1134,10 @@ components: type: description: 'A code that describes the mode of fulfillment. This is typically set when there are multiple ways an order can be fulfilled. For example, a retail order can be fulfilled either via store pickup or a home delivery. Similarly, a medical consultation can be provided either in-person or via tele-consultation. The network policy must publish standard fulfillment type codes for the different modes of fulfillment.' type: string + enum: + - Home-Delivery + - Store-Pickup + - Store-Pickup-And-Home-Delivery rateable: description: Whether the fulfillment can be rated or not type: boolean @@ -1170,13 +1182,46 @@ components: type: object properties: descriptor: - $ref: '#/components/schemas/Descriptor' + $ref: '#/components/schemas/FulfillmentDescriptor' updated_at: type: string format: date-time updated_by: type: string description: ID of entity which changed the state + FulfillmentDescriptor: + description: Description of fulfillment . + type: object + properties: + name: + type: string + code: + type: string + enum: + - Pending-Fulfillment + - Packing + - Picking + - Shipped + - Out-for-Delivery + - Delivered + - Failed-Fulfillment + - Canceled + - Returned + short_desc: + type: string + long_desc: + type: string + additional_desc: + type: object + properties: + url: + type: string + content_type: + type: string + enum: + - text/plain + - text/html + - application/json Gps: description: Describes a GPS coordinate type: string @@ -1542,9 +1587,12 @@ components: description: Status of the order. Allowed values can be defined by the network policy type: string enum: - - ACTIVE - - COMPLETE - - CANCELLED + - Initiated + - Acknowledged + - Packed + - Shipped + - Delivered + - Cancelled type: description: 'This is used to indicate the type of order being created to BPPs. Sometimes orders can be linked to previous orders, like a replacement order in a retail domain. A follow-up consultation in healthcare domain. A single order part of a subscription order. The list of order types can be standardized at the network level.' type: string @@ -1658,6 +1706,10 @@ components: type: string collected_by: description: 'This field indicates who is the collector of payment. The BAP can set this value to ''bap'' if it wants to collect the payment first and settle it to the BPP. If the BPP agrees to those terms, the BPP should not send the payment url. Alternatively, the BPP can set this field with the value ''bpp'' if it wants the payment to be made directly.' + type: string + enum: + - BAP + - BPP url: type: string description: 'A payment url to be called by the BAP. If empty, then the payment is to be done offline. The details of payment should be present in the params object. If tl_method = http/get, then the payment details will be sent as url params. Two url param values, ```$transaction_id``` and ```$amount``` are mandatory.' @@ -1850,6 +1902,13 @@ components: items: type: object properties: + type: + type: string + enum: + - Item + - Offer + - Add-on + - Fulfillment item: $ref: '#/components/schemas/Item' title: @@ -1937,12 +1996,6 @@ components: description: The location where the item or order must / will be returned to allOf: - $ref: '#/components/schemas/Location' - fulfillment_managed_by: - description: The entity that will perform the return - type: string - enum: - - CONSUMER - - PROVIDER Scalar: description: Describes a scalar type: object @@ -2030,6 +2083,12 @@ components: description: Details of customer support type: object properties: + type: + type: string + enum: + - order + - billing + - fulfillment ref_id: type: string callback_phone: From a01c2136ffe4e20630a6eb29f9c5fa19b404bef6 Mon Sep 17 00:00:00 2001 From: Rajaneesh Date: Thu, 18 Jan 2024 16:33:46 +0530 Subject: [PATCH 09/26] adding NP-Logs and docs folders --- NP-Logs/Logs-Upload-Instructions.md | 21 +++++++++++++++++++++ docs/implementation-guide/1_Logistics.md | 0 2 files changed, 21 insertions(+) create mode 100644 NP-Logs/Logs-Upload-Instructions.md create mode 100644 docs/implementation-guide/1_Logistics.md diff --git a/NP-Logs/Logs-Upload-Instructions.md b/NP-Logs/Logs-Upload-Instructions.md new file mode 100644 index 0000000..4046f75 --- /dev/null +++ b/NP-Logs/Logs-Upload-Instructions.md @@ -0,0 +1,21 @@ +# Instructions for Network Participants to Upload Their Logs + +1. **Navigate to the NP Logs Folder:** + - Open the file explorer or command line interface. + - Locate and navigate to the designated NP Logs Folder on the shared network drive or platform. + +2. **Create a New Folder with Your Name:** + - Within the NP Logs Folder, create a new folder with your name (NP Name). + - Use this folder to organize and store your logs securely. + +3. **Upload All Logs into Respective Subfolders:** + - Inside your named folder, create subfolders such as 'search,' 'select,' 'init,' 'confirm,' etc. + - Upload the corresponding logs into their respective subfolders. + - Ensure that all logs are organized according to their specific categories. + +4. **Create a Pull Request (PR) with the Draft Branch:** + - After successfully uploading your logs, navigate to the version control system or platform used by the project. + - Commit the changes made to your forked repository and create a Pull Request (PR) for your changes with the `draft` branch, providing a clear description of the updates and logs added. + - Assign relevant reviewers and wait for approval before merging the changes into the main branch. + +By following these instructions, you will contribute to maintaining an organized and traceable log system for the network participants. diff --git a/docs/implementation-guide/1_Logistics.md b/docs/implementation-guide/1_Logistics.md new file mode 100644 index 0000000..e69de29 From c941d2d6595a9839a59e7325315c3f5207813b23 Mon Sep 17 00:00:00 2001 From: Rajaneesh Date: Thu, 18 Jan 2024 19:09:10 +0530 Subject: [PATCH 10/26] transforming example jsons to version 1.1.0 --- examples/cancel/cancel.json | 16 +++- examples/cancel/on-cancel.json | 92 ++++++++++++++------ examples/confirm/confirm.json | 60 ++++++++----- examples/confirm/on-confirm.json | 93 +++++++++++++------- examples/init/init.json | 60 ++++++++----- examples/init/on-init.json | 82 +++++++++++++----- examples/rating/on-rating.json | 23 +++-- examples/rating/rating.json | 25 ++++-- examples/search/on-search.json | 38 +++++---- examples/search/search-by-fulfillment.json | 42 ++++++---- examples/search/search.json | 12 ++- examples/select/on-select.json | 26 ++++-- examples/select/select.json | 28 +++++-- examples/status/on-status.json | 92 ++++++++++++++------ examples/status/status.json | 16 +++- examples/support/on-support.json | 22 +++-- examples/support/support.json | 22 +++-- examples/track/on-track.json | 16 +++- examples/track/track.json | 16 +++- examples/update/on-update.json | 98 +++++++++++++++------- examples/update/update.json | 28 ++++--- 21 files changed, 626 insertions(+), 281 deletions(-) diff --git a/examples/cancel/cancel.json b/examples/cancel/cancel.json index 8908eab..d526817 100644 --- a/examples/cancel/cancel.json +++ b/examples/cancel/cancel.json @@ -2,14 +2,22 @@ { "context": { "domain": "logistics", - "country": "IND", - "city": "std:0806", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, "action": "cancel", - "core_version": "0.9.4", + "version": "1.1.0", "bap_id": "logistics_bap", "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", - "message_id": "8bc952d9-b448-4328-8519-9f61232ba554", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", "timestamp": "2024-01-15T16:00:00.000Z", "ttl": "PT30S" }, diff --git a/examples/cancel/on-cancel.json b/examples/cancel/on-cancel.json index c5c344c..ee0797a 100644 --- a/examples/cancel/on-cancel.json +++ b/examples/cancel/on-cancel.json @@ -2,21 +2,29 @@ { "context": { "domain": "logistics", - "country": "IND", - "city": "std:0806", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, "action": "on_cancel", - "core_version": "0.9.4", + "version": "1.1.0", "bap_id": "logistics_bap", "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", - "message_id": "8bc952d9-b448-4328-8519-9f61232ba554", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", "timestamp": "2024-01-15T16:00:00.000Z", "ttl": "PT30S" }, "message": { "order": { "id": "oid/12", - "provider": { + "provider": { "id":"P1", "descriptor": { "name":"Logistics", @@ -39,11 +47,29 @@ "items": [ { "id": "I1", + "descriptor": { + "Name": "Lightweight delivery", + "short_desc": "Delivery in just 1 hours", + "long_desc": "Delivery in just 1 hours" + }, + "price": { + "currency": "INR", + "value": "50.0" + }, + "category_ids": [ + "category1" + ], + "time":{ + "duration": "PT60M", + "timestamp":"2024-01-14T16: 00: 00.000Z" + }, "quantity": { - "count": "1", - "measure": { - "unit": "KG", - "value": "1" + "selected": { + "count": "1", + "measure": { + "unit": "KG", + "value": "1" + } } } } @@ -55,8 +81,10 @@ }, "breakup": [ { - "ref_id": "I1", "type": "item", + "item": { + "id": "I1" + }, "price": { "currency": "INR", "value": "50" @@ -64,31 +92,41 @@ } ] }, - "fulfillment": { - "type": "Home-Delivery", - "start": { - "location": { - "gps": "13.2008459,77.708736" - } - }, - "end": { - "location": { - "gps": "14.3847563,77.1847563" - } - }, - "state": { - "descriptor": { - "code": "Canceled" + "fulfillments": [ + { + "type": "Home-Delivery", + "stops": [ + { + "location": { + "gps": "14.785638,76.454553", + "address": { + "area_code": "320042" + } + } + }, + { + "location": { + "gps": "14.433424,77.928379", + "address": { + "area_code": "320042" + } + } + } + ], + "state": { + "descriptor": { + "code": "Canceled" + } } } - }, + ], "billing": { "name": "Paul Sterling", "phone": "+919876345623", "email": "sample@gmail.com" }, "payment": { - "status": "NOT-PAID", + "status": "PAID", "type": "PRE-FULFILLMENT", "params": { "amount": "1500", diff --git a/examples/confirm/confirm.json b/examples/confirm/confirm.json index 6d4eaa1..dfb131f 100644 --- a/examples/confirm/confirm.json +++ b/examples/confirm/confirm.json @@ -2,14 +2,22 @@ { "context": { "domain": "logistics", - "country": "IND", - "city": "std:0806", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, "action": "confirm", - "core_version": "0.9.4", + "version": "1.1.0", "bap_id": "logistics_bap", "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", - "message_id": "a6f81cf4-a402-45d5-9e43-836a060ac011", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", "timestamp": "2024-01-15T16:00:00.000Z", "ttl": "PT30S" }, @@ -22,27 +30,39 @@ { "id": "I1", "quantity": { - "count": "1", - "measure": { - "unit": "KG", - "value": "1" + "selected": { + "count": "1", + "measure": { + "unit": "KG", + "value": "1" + } } } } ], - "fulfillment": { - "type": "Home-Delivery", - "start": { - "location": { - "gps": "13.2008459,77.708736" - } - }, - "end": { - "location": { - "gps": "14.3847563,77.1847563" - } + "fulfillments": [ + { + "type": "Home-Delivery", + "stops": [ + { + "location": { + "gps": "14.785638,76.454553", + "address": { + "area_code": "320042" + } + } + }, + { + "location": { + "gps": "14.433424,77.928379", + "address": { + "area_code": "320042" + } + } + } + ] } - }, + ], "billing": { "name": "Paul Sterling", "phone": "+919876345623", diff --git a/examples/confirm/on-confirm.json b/examples/confirm/on-confirm.json index c3b4b92..776b1d5 100644 --- a/examples/confirm/on-confirm.json +++ b/examples/confirm/on-confirm.json @@ -1,24 +1,29 @@ { "context": { "domain": "logistics", - "country": "IND", - "city": "std:0806", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, "action": "on_confirm", - "core_version": "0.9.4", + "version": "1.1.0", "bap_id": "logistics_bap", "bap_uri": "https://logistics_bap.com", "bpp_id": "logistics_bpp", "bpp_uri": "https://logistics_bpp.com", "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", - "message_id": "a6f81cf4-a402-45d5-9e43-836a060ac011", - "timestamp": "2024-01-15T16:01:00.000Z", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", + "timestamp": "2024-01-15T16:00:00.000Z", "ttl": "PT30S" }, "message": { "order": { "id": "oid/12", - "state": "Initiated", - "provider": { + "provider": { "id":"P1", "descriptor": { "name":"Logistics", @@ -41,11 +46,29 @@ "items": [ { "id": "I1", + "descriptor": { + "Name": "Lightweight delivery", + "short_desc": "Delivery in just 1 hours", + "long_desc": "Delivery in just 1 hours" + }, + "price": { + "currency": "INR", + "value": "50.0" + }, + "category_ids": [ + "category1" + ], + "time":{ + "duration": "PT60M", + "timestamp":"2024-01-14T16: 00: 00.000Z" + }, "quantity": { - "count": "1", - "measure": { - "unit": "KG", - "value": "1" + "selected": { + "count": "1", + "measure": { + "unit": "KG", + "value": "1" + } } } } @@ -57,8 +80,10 @@ }, "breakup": [ { - "ref_id": "I1", "type": "item", + "item": { + "id": "I1" + }, "price": { "currency": "INR", "value": "50" @@ -66,31 +91,41 @@ } ] }, - "fulfillment": { - "type": "Home-Delivery", - "start": { - "location": { - "gps": "13.2008459,77.708736" - } - }, - "end": { - "location": { - "gps": "14.3847563,77.1847563" - } - }, - "state": { - "descriptor": { - "code": "Pending-Fulfillment" + "fulfillments": [ + { + "type": "Home-Delivery", + "stops": [ + { + "location": { + "gps": "14.785638,76.454553", + "address": { + "area_code": "320042" + } + } + }, + { + "location": { + "gps": "14.433424,77.928379", + "address": { + "area_code": "320042" + } + } + } + ], + "state": { + "descriptor": { + "code": "Pending-Fulfillment" + } } } - }, + ], "billing": { "name": "Paul Sterling", "phone": "+919876345623", "email": "sample@gmail.com" }, "payment": { - "status": "NOT-PAID", + "status": "PAID", "type": "PRE-FULFILLMENT", "params": { "amount": "1500", diff --git a/examples/init/init.json b/examples/init/init.json index 29ff7ff..c2904f9 100644 --- a/examples/init/init.json +++ b/examples/init/init.json @@ -1,14 +1,22 @@ { "context": { "domain": "logistics", - "country": "IND", - "city": "std:0806", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, "action": "init", - "core_version": "0.9.4", + "version": "1.1.0", "bap_id": "logistics_bap", "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", - "message_id": "005277cc-9a82-466f-b41b-cdda015bd6a5", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", "timestamp": "2024-01-15T16:00:00.000Z", "ttl": "PT30S" }, @@ -21,27 +29,39 @@ { "id": "I1", "quantity": { - "count": "1", - "measure": { - "unit": "KG", - "value": "1" + "selected": { + "count": "1", + "measure": { + "unit": "KG", + "value": "1" + } } } } ], - "fulfillment": { - "type": "Home-Delivery", - "start": { - "location": { - "gps": "13.2008459,77.708736" - } - }, - "end": { - "location": { - "gps": "14.3847563,77.1847563" - } + "fulfillments": [ + { + "type": "Home-Delivery", + "stops": [ + { + "location": { + "gps": "14.785638,76.454553", + "address": { + "area_code": "320042" + } + } + }, + { + "location": { + "gps": "14.433424,77.928379", + "address": { + "area_code": "320042" + } + } + } + ] } - }, + ], "billing": { "name": "Paul Sterling", "phone": "+919876345623", diff --git a/examples/init/on-init.json b/examples/init/on-init.json index d867896..65058fb 100644 --- a/examples/init/on-init.json +++ b/examples/init/on-init.json @@ -1,21 +1,27 @@ { "context": { "domain": "logistics", - "country": "IND", - "city": "std:0806", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, "action": "on_init", - "core_version": "0.9.4", + "version": "1.1.0", "bap_id": "logistics_bap", "bap_uri": "https://logistics_bap.com", "bpp_id": "logistics_bpp", "bpp_uri": "https://logistics_bpp.com", "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", - "message_id": "005277cc-9a82-466f-b41b-cdda015bd6a5", - "timestamp": "2024-01-15T16:01:00.000Z", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", + "timestamp": "2024-01-15T16:00:00.000Z", "ttl": "PT30S" }, "message": { - "initialized": { + "order": { "provider": { "id":"P1", "descriptor": { @@ -39,11 +45,29 @@ "items": [ { "id": "I1", + "descriptor": { + "Name": "Lightweight delivery", + "short_desc": "Delivery in just 1 hours", + "long_desc": "Delivery in just 1 hours" + }, + "price": { + "currency": "INR", + "value": "50.0" + }, + "category_ids": [ + "category1" + ], + "time":{ + "duration": "PT60M", + "timestamp":"2024-01-14T16: 00: 00.000Z" + }, "quantity": { - "count": "1", - "measure": { - "unit": "KG", - "value": "1" + "selected": { + "count": "1", + "measure": { + "unit": "KG", + "value": "1" + } } } } @@ -55,8 +79,10 @@ }, "breakup": [ { - "ref_id": "I1", "type": "item", + "item": { + "id": "I1" + }, "price": { "currency": "INR", "value": "50" @@ -64,19 +90,29 @@ } ] }, - "fulfillment": { - "type": "Home-Delivery", - "start": { - "location": { - "gps": "13.2008459,77.708736" - } - }, - "end": { - "location": { - "gps": "14.3847563,77.1847563" - } + "fulfillments": [ + { + "type": "Home-Delivery", + "stops": [ + { + "location": { + "gps": "14.785638,76.454553", + "address": { + "area_code": "320042" + } + } + }, + { + "location": { + "gps": "14.433424,77.928379", + "address": { + "area_code": "320042" + } + } + } + ] } - }, + ], "billing": { "name": "Paul Sterling", "phone": "+919876345623", diff --git a/examples/rating/on-rating.json b/examples/rating/on-rating.json index e7d454f..c8ee0be 100644 --- a/examples/rating/on-rating.json +++ b/examples/rating/on-rating.json @@ -2,21 +2,30 @@ { "context": { "domain": "logistics", - "country": "IND", - "city": "std:0806", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, "action": "on_rating", - "core_version": "0.9.4", + "version": "1.1.0", "bap_id": "logistics_bap", "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", - "message_id": "bbf8234d-7b72-4550-8030-d166620eb7ac", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", "timestamp": "2024-01-15T16:00:00.000Z", "ttl": "PT30S" }, "message": { - "feedback": { - "id": "feedback/id/08", - "parent_id": "oid/12" + "feedback_form": { + "form": { + "url": "https://form/url" + } } } } \ No newline at end of file diff --git a/examples/rating/rating.json b/examples/rating/rating.json index d2ff0b9..5094036 100644 --- a/examples/rating/rating.json +++ b/examples/rating/rating.json @@ -2,19 +2,32 @@ { "context": { "domain": "logistics", - "country": "IND", - "city": "std:0806", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, "action": "rating", - "core_version": "0.9.4", + "version": "1.1.0", "bap_id": "logistics_bap", "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", - "message_id": "bbf8234d-7b72-4550-8030-d166620eb7ac", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", "timestamp": "2024-01-15T16:00:00.000Z", "ttl": "PT30S" }, "message": { - "id": "oid/12", - "value": "4" + "ratings": [ + { + "rating_category": "Order", + "id": "oid/12", + "value": "4" + } + ] } } \ No newline at end of file diff --git a/examples/search/on-search.json b/examples/search/on-search.json index 6915af8..783dd58 100644 --- a/examples/search/on-search.json +++ b/examples/search/on-search.json @@ -1,25 +1,31 @@ { "context": { "domain": "logistics", - "country": "IND", - "city": "std:0806", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, "action": "on_search", - "core_version": "0.9.4", + "version": "1.1.0", "bap_id": "logistics_bap", "bap_uri": "https://logistics_bap.com", "bpp_id": "logistics_bpp", "bpp_uri": "https://logistics_bpp.com", "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", - "timestamp": "2024-01-15T16:01:00.000Z", + "timestamp": "2024-01-15T16:00:00.000Z", "ttl": "PT30S" }, "message": { "catalog": { - "bpp/descriptor": { + "descriptor": { "name":"XYZLogistics" }, - "bpp/providers": [ + "providers": [ { "id":"P1", "descriptor": { @@ -31,12 +37,10 @@ { "id": "L1", "gps": "13.786587,76.872309", - "address": { - "street": "Shubhash nagar, 3rd block", - "city": "Bengaluru", - "area_code": "560042", - "state": "KA" - } + "address": "Shubhash nagar, 3rd block", + "city": "Bengaluru", + "area_code": "560042", + "state": "KA" } ], "categories": [ @@ -73,10 +77,12 @@ "currency": "INR", "value": "50.0" }, - "category_id": "category1", - "tags": { - "fulfillment_id": "1" - }, + "category_ids": [ + "category1" + ], + "fulfillment_ids": [ + "1" + ], "time":{ "duration": "PT60M", "timestamp":"2024-01-14T16: 00: 00.000Z" diff --git a/examples/search/search-by-fulfillment.json b/examples/search/search-by-fulfillment.json index 817a820..907a015 100644 --- a/examples/search/search-by-fulfillment.json +++ b/examples/search/search-by-fulfillment.json @@ -1,14 +1,20 @@ { "context": { "domain": "logistics", - "country": "IND", - "city": "std:0806", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, "action": "search", - "core_version": "0.9.4", + "version": "1.1.0", "bap_id": "logistics_bap", "bap_uri": "https://logistics_bap.com", "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", - "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", + "message_id": "7a47a08d-69e0-4a14-9216-a95bfde08965", "timestamp": "2024-01-15T16:00:00.000Z", "ttl": "PT30S" }, @@ -27,22 +33,24 @@ ] }, "fulfillment": { - "start": { - "location": { - "gps": "14.785638,76.454553", - "address": { - "area_code": "320042" + "stops": [ + { + "location": { + "gps": "14.785638,76.454553", + "address": { + "area_code": "320042" + } } - } - }, - "end": { - "location": { - "gps": "14.433424,77.928379", - "address": { - "area_code": "320042" + }, + { + "location": { + "gps": "14.433424,77.928379", + "address": { + "area_code": "320042" + } } } - } + ] } } } diff --git a/examples/search/search.json b/examples/search/search.json index 19df8de..186847f 100644 --- a/examples/search/search.json +++ b/examples/search/search.json @@ -1,10 +1,16 @@ { "context": { "domain": "logistics", - "country": "IND", - "city": "std:0806", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, "action": "search", - "core_version": "0.9.4", + "version": "1.1.0", "bap_id": "logistics_bap", "bap_uri": "https://logistics_bap.com", "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", diff --git a/examples/select/on-select.json b/examples/select/on-select.json index 96725c9..fe5aae5 100644 --- a/examples/select/on-select.json +++ b/examples/select/on-select.json @@ -1,21 +1,27 @@ { "context": { "domain": "logistics", - "country": "IND", - "city": "std:0806", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, "action": "on_select", - "core_version": "0.9.4", + "version": "1.1.0", "bap_id": "logistics_bap", "bap_uri": "https://logistics_bap.com", "bpp_id": "logistics_bpp", "bpp_uri": "https://logistics_bpp.com", "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", - "message_id": "313027c8-dc49-40da-8812-ef86a97f39c0", - "timestamp": "2024-01-15T16:01:00.000Z", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", + "timestamp": "2024-01-15T16:00:00.000Z", "ttl": "PT30S" }, "message": { - "selected": { + "order": { "provider": { "id":"P1", "descriptor": { @@ -48,7 +54,9 @@ "currency": "INR", "value": "50.0" }, - "category_id": "category1", + "category_ids": [ + "category1" + ], "time":{ "duration": "PT60M", "timestamp":"2024-01-14T16: 00: 00.000Z" @@ -77,8 +85,10 @@ }, "breakup": [ { - "ref_id": "I1", "type": "item", + "item": { + "id": "I1" + }, "price": { "currency": "INR", "value": "50" diff --git a/examples/select/select.json b/examples/select/select.json index c64071f..3d8bac6 100644 --- a/examples/select/select.json +++ b/examples/select/select.json @@ -1,19 +1,27 @@ { "context": { "domain": "logistics", - "country": "IND", - "city": "std:0806", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, "action": "select", - "core_version": "0.9.4", + "version": "1.1.0", "bap_id": "logistics_bap", "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", - "message_id": "313027c8-dc49-40da-8812-ef86a97f39c0", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", "timestamp": "2024-01-15T16:00:00.000Z", "ttl": "PT30S" }, "message": { - "selected": { + "order": { "provider": { "id": "P1" }, @@ -21,10 +29,12 @@ { "id": "I1", "quantity": { - "count": "1", - "measure": { - "unit": "KG", - "value": "1" + "selected": { + "count": "1", + "measure": { + "unit": "KG", + "value": "1" + } } } } diff --git a/examples/status/on-status.json b/examples/status/on-status.json index 831e2c2..efb1ea4 100644 --- a/examples/status/on-status.json +++ b/examples/status/on-status.json @@ -2,21 +2,29 @@ { "context": { "domain": "logistics", - "country": "IND", - "city": "std:0806", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, "action": "on_status", - "core_version": "0.9.4", + "version": "1.1.0", "bap_id": "logistics_bap", "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", - "message_id": "bbf8234d-7b72-4550-8030-d166620eb7ac", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", "timestamp": "2024-01-15T16:00:00.000Z", "ttl": "PT30S" }, "message": { "order": { "id": "oid/12", - "provider": { + "provider": { "id":"P1", "descriptor": { "name":"Logistics", @@ -39,11 +47,29 @@ "items": [ { "id": "I1", + "descriptor": { + "Name": "Lightweight delivery", + "short_desc": "Delivery in just 1 hours", + "long_desc": "Delivery in just 1 hours" + }, + "price": { + "currency": "INR", + "value": "50.0" + }, + "category_ids": [ + "category1" + ], + "time":{ + "duration": "PT60M", + "timestamp":"2024-01-14T16: 00: 00.000Z" + }, "quantity": { - "count": "1", - "measure": { - "unit": "KG", - "value": "1" + "selected": { + "count": "1", + "measure": { + "unit": "KG", + "value": "1" + } } } } @@ -55,8 +81,10 @@ }, "breakup": [ { - "ref_id": "I1", "type": "item", + "item": { + "id": "I1" + }, "price": { "currency": "INR", "value": "50" @@ -64,31 +92,41 @@ } ] }, - "fulfillment": { - "type": "Home-Delivery", - "start": { - "location": { - "gps": "13.2008459,77.708736" - } - }, - "end": { - "location": { - "gps": "14.3847563,77.1847563" - } - }, - "state": { - "descriptor": { - "code": "Packing" + "fulfillments": [ + { + "type": "Home-Delivery", + "stops": [ + { + "location": { + "gps": "14.785638,76.454553", + "address": { + "area_code": "320042" + } + } + }, + { + "location": { + "gps": "14.433424,77.928379", + "address": { + "area_code": "320042" + } + } + } + ], + "state": { + "descriptor": { + "code": "Shipped" + } } } - }, + ], "billing": { "name": "Paul Sterling", "phone": "+919876345623", "email": "sample@gmail.com" }, "payment": { - "status": "NOT-PAID", + "status": "PAID", "type": "PRE-FULFILLMENT", "params": { "amount": "1500", diff --git a/examples/status/status.json b/examples/status/status.json index da0433c..2584a00 100644 --- a/examples/status/status.json +++ b/examples/status/status.json @@ -2,14 +2,22 @@ { "context": { "domain": "logistics", - "country": "IND", - "city": "std:0806", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, "action": "status", - "core_version": "0.9.4", + "version": "1.1.0", "bap_id": "logistics_bap", "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", - "message_id": "bbf8234d-7b72-4550-8030-d166620eb7ac", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", "timestamp": "2024-01-15T16:00:00.000Z", "ttl": "PT30S" }, diff --git a/examples/support/on-support.json b/examples/support/on-support.json index e20390f..7e22798 100644 --- a/examples/support/on-support.json +++ b/examples/support/on-support.json @@ -2,19 +2,29 @@ { "context": { "domain": "logistics", - "country": "IND", - "city": "std:0806", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, "action": "on_support", - "core_version": "0.9.4", + "version": "1.1.0", "bap_id": "logistics_bap", "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", - "message_id": "6cae6207-2f14-459a-84e0-1439c013be09", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", "timestamp": "2024-01-15T16:00:00.000Z", "ttl": "PT30S" }, "message": { - "phone": "+919876564656", - "email": "sample@gmail.com" + "support": { + "phone": "+918675453298", + "email": "helpline@logistics.com" + } } } \ No newline at end of file diff --git a/examples/support/support.json b/examples/support/support.json index 48aa5c7..34c6502 100644 --- a/examples/support/support.json +++ b/examples/support/support.json @@ -2,18 +2,30 @@ { "context": { "domain": "logistics", - "country": "IND", - "city": "std:0806", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, "action": "support", - "core_version": "0.9.4", + "version": "1.1.0", "bap_id": "logistics_bap", "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", - "message_id": "6cae6207-2f14-459a-84e0-1439c013be09", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", "timestamp": "2024-01-15T16:00:00.000Z", "ttl": "PT30S" }, "message": { - "ref_id": "oid/12" + "support": { + "type": "Order", + "ref_id": "oid/12", + "callback_phone": "+919876564534" + } } } \ No newline at end of file diff --git a/examples/track/on-track.json b/examples/track/on-track.json index e2674d2..d8a80aa 100644 --- a/examples/track/on-track.json +++ b/examples/track/on-track.json @@ -2,14 +2,22 @@ { "context": { "domain": "logistics", - "country": "IND", - "city": "std:0806", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, "action": "on_track", - "core_version": "0.9.4", + "version": "1.1.0", "bap_id": "logistics_bap", "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", - "message_id": "2a121930-9ebe-4d80-b557-08f15791af83", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", "timestamp": "2024-01-15T16:00:00.000Z", "ttl": "PT30S" }, diff --git a/examples/track/track.json b/examples/track/track.json index fce9a74..ddcedee 100644 --- a/examples/track/track.json +++ b/examples/track/track.json @@ -2,14 +2,22 @@ { "context": { "domain": "logistics", - "country": "IND", - "city": "std:0806", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, "action": "track", - "core_version": "0.9.4", + "version": "1.1.0", "bap_id": "logistics_bap", "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", - "message_id": "2a121930-9ebe-4d80-b557-08f15791af83", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", "timestamp": "2024-01-15T16:00:00.000Z", "ttl": "PT30S" }, diff --git a/examples/update/on-update.json b/examples/update/on-update.json index b57e2ab..6f4c2a3 100644 --- a/examples/update/on-update.json +++ b/examples/update/on-update.json @@ -2,23 +2,29 @@ { "context": { "domain": "logistics", - "country": "IND", - "city": "std:0806", - "action": "update", - "core_version": "0.9.4", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, + "action": "on_update", + "version": "1.1.0", "bap_id": "logistics_bap", "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", - "message_id": "92fed6b2-7822-425b-a807-3d26edddc695", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", "timestamp": "2024-01-15T16:00:00.000Z", "ttl": "PT30S" }, "message": { - "update_target": "order.fulfillment.end.location", "order": { "id": "oid/12", - "state": "Initiated", - "provider": { + "provider": { "id":"P1", "descriptor": { "name":"Logistics", @@ -41,11 +47,29 @@ "items": [ { "id": "I1", + "descriptor": { + "Name": "Lightweight delivery", + "short_desc": "Delivery in just 1 hours", + "long_desc": "Delivery in just 1 hours" + }, + "price": { + "currency": "INR", + "value": "50.0" + }, + "category_ids": [ + "category1" + ], + "time":{ + "duration": "PT60M", + "timestamp":"2024-01-14T16: 00: 00.000Z" + }, "quantity": { - "count": "1", - "measure": { - "unit": "KG", - "value": "1" + "selected": { + "count": "1", + "measure": { + "unit": "KG", + "value": "1" + } } } } @@ -57,8 +81,10 @@ }, "breakup": [ { - "ref_id": "I1", "type": "item", + "item": { + "id": "I1" + }, "price": { "currency": "INR", "value": "50" @@ -66,31 +92,41 @@ } ] }, - "fulfillment": { - "type": "Home-Delivery", - "start": { - "location": { - "gps": "13.2008459,77.708736" - } - }, - "end": { - "location": { - "gps": "14.3847563,78.7656455" - } - }, - "state": { - "descriptor": { - "code": "Pending-Fulfillment" + "fulfillments": [ + { + "type": "Home-Delivery", + "stops": [ + { + "location": { + "gps": "14.785638,76.454553", + "address": { + "area_code": "320042" + } + } + }, + { + "location": { + "gps": "14.433424,77.928379", + "address": { + "area_code": "320042" + } + } + } + ], + "state": { + "descriptor": { + "code": "Shipped" + } } } - }, + ], "billing": { "name": "Paul Sterling", "phone": "+919876345623", - "email": "sample@gmail.com" + "email": "sterling@gmail.com" }, "payment": { - "status": "NOT-PAID", + "status": "PAID", "type": "PRE-FULFILLMENT", "params": { "amount": "1500", diff --git a/examples/update/update.json b/examples/update/update.json index e473ccf..bdea698 100644 --- a/examples/update/update.json +++ b/examples/update/update.json @@ -2,26 +2,32 @@ { "context": { "domain": "logistics", - "country": "IND", - "city": "std:0806", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, "action": "update", - "core_version": "0.9.4", + "version": "1.1.0", "bap_id": "logistics_bap", "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", - "message_id": "92fed6b2-7822-425b-a807-3d26edddc695", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", "timestamp": "2024-01-15T16:00:00.000Z", "ttl": "PT30S" }, "message": { - "update_target": "order.fulfillment.end.location", + "update_target": "order.billing", "order": { - "fulfillment": { - "end": { - "location": { - "gps": "14.3847563,78.7656455" - } - } + "billing": { + "name": "Paul Sterling", + "phone": "+919876345623", + "email": "sterling@gmail.com" } } } From 0d591ec08cd333b8ad030a1dce20c3e43866664b Mon Sep 17 00:00:00 2001 From: Rajaneesh Date: Thu, 18 Jan 2024 23:19:12 +0530 Subject: [PATCH 11/26] adding content of implementation guide --- docs/implementation-guide/1_Logistics.md | 208 +++++++++++++++++++++++ 1 file changed, 208 insertions(+) diff --git a/docs/implementation-guide/1_Logistics.md b/docs/implementation-guide/1_Logistics.md index e69de29..8ba4320 100644 --- a/docs/implementation-guide/1_Logistics.md +++ b/docs/implementation-guide/1_Logistics.md @@ -0,0 +1,208 @@ +# 1. Implementation Guide + +This document contains the REQUIRED and RECOMMENDED standard functionality that must be implemented by any logistics service provider Platform a.k.a BPPs and logistics Consumer Platform a.k.a BAPs. + +The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119]. + +## 1.1 Discovery of logistics service providers + +### 1.1.1 Recommendations for BPPs +The following recommendations need to be considered when implementing discovery functionality for a logistics BPP + +- REQUIRED. The BPP MUST implement the `search` endpoint to receive an `Intent` object sent by BAPs +- REQUIRED. The BPP MUST return a catalog of logistics services on the `on_search` callback endpoint specified in the `context.bap_uri` field of the `search` request body. +- REQUIRED. The BPP MUST map its logistics services to the `Item` schema. +- REQUIRED. Any logistics service provider related information like name, logo, short description must be mapped to the `Provider.descriptor` schema +- REQUIRED. Any form that must be filled before receiving a quotation must be mapped to the `XInput` schema +- REQUIRED. If the platform wants to group its services under a specific category, it must map each category to the `Category` schema +- REQUIRED. Any order fulfillment-related information MUST be mapped to the `Fulfillment` schema. +- REQUIRED. If the BPP does not want to respond to a search request, it MUST return a `ack.status` value equal to `NACK` +- RECOMMENDED. Upon receiving a `search` request, the BPP SHOULD return a catalog that best matches the intent. This can be done by indexing the catalog against the various probable paths in the `Intent` schema relevant to typical logistics use cases + +### 1.1.2 Recommendations for BAPs +- REQUIRED. The BAP MUST call the `search` endpoint of the BG to discover multiple BPPs on a network +- REQUIRED. The BAP MUST implement the `on_search` endpoint to consume the `Catalog` objects containing logistics services sent by BPPs. +- REQUIRED. The BAP MUST expect multiple catalogs sent by the respective logistics service providers on the network +- REQUIRED. The logistics services can be found in the `Catalog.providers[].items[]` array in the `on_search` request +- REQUIRED. If the `catalog.providers[].items[].xinput` object is present, then the BAP MUST redirect the user to, or natively render the form present on the link specified on the `items[].xinput.form.url` field. +- REQUIRED. If the `catalog.providers[].items[].xinput.required` field is set to `"true"` , then the BAP MUST NOT fire a `select`, `init` or `confirm` call until the form is submitted and a successful response is received +- RECOMMENDED. If the `catalog.providers[].items[].xinput.required` field is set to `"false"` , then the BAP SHOULD allow the user to skip filling the form + + +### Example +A search request for a logistics service provider may look like this +``` + +``` + +An example catalog of a logistics service provider may look like this +``` + +``` + +## 1.2 Initiating an order for a logistics service +This section provides recommendations for implementing the APIs related to a logistics service. + +### 1.2.1 Recommendations for BPPs + +#### 1.2.1.1 Selecting a logistics service from the catalog +- REQUIRED. The BPP MUST implement the `select` endpoint on the url specified in the `context.bpp_uri` field sent during `on_search`. In case of permissioned networks, this URL MUST match the `Subscriber.url` present on the respective entry in the Network Registry +- REQUIRED. The BPP MUST check for a form submission at the URL specified on the `xinput.form.url` before acknowledging a `select` request. +- REQUIRED. If the logistics service provider has successfully received the information submitted by the consumer, the BPP must return an acknowledgement with `ack.status` set to `ACK` in response to the `select` request +- REQUIRED. If the logistics service provider has returned a successful acknowledgement to a `select` request, it MUST send the offer encapsulated in an `Order` object + +#### 1.2.1.2 Initializing a logistics service order +- REQUIRED. The BPP MUST implement the `init` endpoint on the url specified in the `context.bpp_uri` field sent during `on_search`. In case of permissioned networks, this URL MUST match the `Subscriber.url` present on the respective entry in the Network Registry + +#### 1.2.1.3 Confirming the logistics service order +- REQUIRED. The BPP MUST implement the `confirm` endpoint on the url specified in URL specified in the `context.bpp_uri` field sent during `on_search`. In case of permissioned networks, this URL MUST match the `Subscriber.url` present on the respective entry in the Network Registry + +### 1.2.2 Recommendations for BAPs + +#### 1.2.1.1 Selecting a logistics service from the catalog +- REQUIRED. The BAP user MUST submit the form on the url received from `on_search` under `xinput.form.url`. +- REQUIRED. The BAP MUST implement the `on_select` endpoint on the url specified in the `context.bap_uri` field sent during `select`. In case of permissioned networks, this URL MUST match the `Subscriber.url` present on the respective entry in the Network Registry + +#### 1.2.2.2 Initializing a logistics service order +- REQUIRED. The BAP MUST hit the `init` endpoint on the url specified in the `context.bpp_uri` field sent during `on_search`. +- REQUIRED. The BAP MUST implement the `on_init` endpoint on the url specified in the `context.bap_uri` field sent during `init`. In case of permissioned networks, this URL MUST match the `Subscriber.url` present on the respective entry in the Network Registry + +#### 1.2.2.3 Confirming the logistics service order +- REQUIRED. The BAP MUST hit the `confirm` endpoint on the url specified in the `context.bpp_uri` field sent during `on_search`. +- REQUIRED. The BAP MUST implement the `on_confirm` endpoint on the url specified in URL specified in the `context.bap_uri` field sent during `confirm`. In case of permissioned networks, this URL MUST match the `Subscriber.url` present on the respective entry in the Network Registry + +### 1.2.3 Example Workflow + +### 1.2.3 Example Requests + +Below is an example of a `select` request +``` + +``` + +Below is an example of an `on_select` callback +``` + +``` + + +Below is an example of a `init` request +``` + +``` + +Below is an example of an `on_init` callback +``` + +``` + +Below is an example of a `confirm` request +``` + +``` +Below is an example of an `on_confirm` callback +``` + +``` + +## 1.3 Fulfillment of a logistics order +This section contains recommendations for implementing the APIs related to fulfilling a logistics order + +### 1.3.1 Recommendations for BPPs + +#### 1.3.1.1 Sending status updates +- REQUIRED. The BPP MUST implement the `status` endpoint on the url specified in URL specified in the `context.bpp_uri` field sent during `on_search`. In case of permissioned networks, this URL MUST match the `Subscriber.url` present on the respective entry in the Network Registry + +#### 1.3.1.2 Updating a logistics order +- REQUIRED. The BPP MUST implement the `update` endpoint on the url specified in URL specified in the `context.bpp_uri` field sent during `on_search`. In case of permissioned networks, this URL MUST match the `Subscriber.url` present on the respective entry in the Network Registry + +#### 1.3.1.3 Cancelling a logistics order +- REQUIRED. The BPP MUST implement the `cancel` endpoint on the url specified in URL specified in the `context.bpp_uri` field sent during `on_search`. In case of permissioned networks, this URL MUST match the `Subscriber.url` present on the respective entry in the Network Registry +- REQUIRED. The BPP MUST implement the `get_cancellation_reasons` endpoint on the url specified in URL specified in the `context.bpp_uri` field sent during `on_search`. In case of permissioned networks, this URL MUST match the `Subscriber.url` present on the respective entry in the Network Registry + +#### 1.3.1.4 Real-time tracking +- REQUIRED. The BPP MUST implement the `track` endpoint on the url specified in URL specified in the `context.bpp_uri` field sent during `on_search`. In case of permissioned networks, this URL MUST match the `Subscriber.url` present on the respective entry in the Network Registry + +### 1.3.2 Recommendations for BAPs + +#### 1.3.2.1 Receiving status updates +- REQUIRED. The BAP MUST implement the `on_status` endpoint on the url specified in URL specified in the `context.bap_uri` field sent during `status`. In case of permissioned networks, this URL MUST match the `Subscriber.url` present on the respective entry in the Network Registry + +#### 1.3.2.2 Updating a logistics order +- REQUIRED. The BAP MUST implement the `on_update` endpoint on the url specified in URL specified in the `context.bap_uri` field sent during `update`. In case of permissioned networks, this URL MUST match the `Subscriber.url` present on the respective entry in the Network Registry + +#### 1.3.2.3 Cancelling a logistics order +- REQUIRED. The BAP MUST implement the `on_cancel` endpoint on the url specified in URL specified in the `context.bap_uri` field sent during `cancel`. In case of permissioned networks, this URL MUST match the `Subscriber.url` present on the respective entry in the Network Registry +- REQUIRED. The BAP MUST implement the `cancellation_reasons` endpoint on the url specified in URL specified in the `context.bap_uri` field sent during `get_cancellation_reasons`. In case of permissioned networks, this URL MUST match the `Subscriber.url` present on the respective entry in the Network Registry + +#### 1.3.2.4 Real-time tracking +- REQUIRED. The BAP MUST implement the `on_track` endpoint on the url specified in URL specified in the `context.bap_uri` field sent during `track`. In case of permissioned networks, this URL MUST match the `Subscriber.url` present on the respective entry in the Network Registry + +### 1.3.3 Example Workflow + +### 1.3.4 Example Requests + +Below is an example of a `status` request +``` + +``` + +Below is an example of an `on_status` callback +``` + +``` + +## 1.4 Post-fulfillment of logistics order +This section contains recommendations for implementing the APIs after fulfilling a logistics order + +### 1.4.1 Recommendations for BPPs + +#### 1.4.1.1 Rating and Feedback +- REQUIRED. The BPP MUST implement the `rating` endpoint on the url specified in URL specified in the `context.bpp_uri` field sent during `on_search`. In case of permissioned networks, this URL MUST match the `Subscriber.url` present on the respective entry in the Network Registry +- REQUIRED. The BPP MUST implement the `get_rating_categories` endpoint on the url specified in URL specified in the `context.bpp_uri` field sent during `on_search`. In case of permissioned networks, this URL MUST match the `Subscriber.url` present on the respective entry in the Network Registry + +#### 1.4.1.2 Providing Support +- REQUIRED. The BPP MUST implement the `support` endpoint on the url specified in URL specified in the `context.bpp_uri` field sent during `on_search`. In case of permissioned networks, this URL MUST match the `Subscriber.url` present on the respective entry in the Network Registry + +### 1.4.2 Recommendations for BAPs + +#### 1.4.2.1 Rating and Feedback +- REQUIRED. The BAP MUST implement the `on_rating` endpoint on the url specified in URL specified in the `context.bap_uri` field sent during `rating`. In case of permissioned networks, this URL MUST match the `Subscriber.url` present on the respective entry in the Network Registry +- REQUIRED. The BAP MUST implement the `rating_categories` endpoint on the url specified in URL specified in the `context.bap_uri` field sent during `get_rating_categories`. In case of permissioned networks, this URL MUST match the `Subscriber.url` present on the respective entry in the Network Registry + +#### 1.4.2.2 Providing Support +- REQUIRED. The BAP MUST implement the `on_support` endpoint on the url specified in URL specified in the `context.bap_uri` field sent during `support`. In case of permissioned networks, this URL MUST match the `Subscriber.url` present on the respective entry in the Network Registry + +### 1.4.3 Example Workflow + +### 1.4.4 Example Requests + +Below is an example of a `get_rating_categories` request +``` + +``` + +Below is an example of an `rating_categories` callback +``` + +``` + +Below is an example of a `rating` request + +``` + +``` +Below is an example of an `on_rating` callback +``` + +``` + +Below is an example of a `support` request +``` + +``` + +Below is an example of an `on_support` callback +``` + +``` From 16574b204190dc38b768c41fa18976064b7115e8 Mon Sep 17 00:00:00 2001 From: Rajaneesh Date: Fri, 19 Jan 2024 15:38:15 +0530 Subject: [PATCH 12/26] making spec chnages in yaml --- api/logistics.yaml | 7 +-- examples/cancel/on-cancel.json | 47 +++++++++++++------- examples/confirm/confirm.json | 14 +++--- examples/confirm/on-confirm.json | 50 ++++++++++++++-------- examples/init/init.json | 2 +- examples/init/on-init.json | 23 +++++++--- examples/search/on-search.json | 27 ++++++++---- examples/search/search-by-fulfillment.json | 9 +--- examples/search/search.json | 7 --- examples/select/on-select.json | 40 ++++++++++++++--- examples/select/select.json | 20 ++++++++- examples/status/on-status.json | 49 +++++++++++++-------- examples/update/on-update.json | 49 +++++++++++++-------- 13 files changed, 224 insertions(+), 120 deletions(-) diff --git a/api/logistics.yaml b/api/logistics.yaml index 7e1bdd3..071c71d 100644 --- a/api/logistics.yaml +++ b/api/logistics.yaml @@ -1135,9 +1135,10 @@ components: description: 'A code that describes the mode of fulfillment. This is typically set when there are multiple ways an order can be fulfilled. For example, a retail order can be fulfilled either via store pickup or a home delivery. Similarly, a medical consultation can be provided either in-person or via tele-consultation. The network policy must publish standard fulfillment type codes for the different modes of fulfillment.' type: string enum: - - Home-Delivery - - Store-Pickup - - Store-Pickup-And-Home-Delivery + - Air-Shipping + - Ocean-Shipping + - road-Shipping + - Rail-Shipping rateable: description: Whether the fulfillment can be rated or not type: boolean diff --git a/examples/cancel/on-cancel.json b/examples/cancel/on-cancel.json index ee0797a..adac9cb 100644 --- a/examples/cancel/on-cancel.json +++ b/examples/cancel/on-cancel.json @@ -1,4 +1,3 @@ - { "context": { "domain": "logistics", @@ -24,14 +23,14 @@ "message": { "order": { "id": "oid/12", - "provider": { - "id":"P1", - "descriptor": { - "name":"Logistics", - "short_desc":"Logistics Org", - "long_desc":"Logistics Org" + "provider": { + "id": "P1", + "descriptor": { + "name": "Logistics", + "short_desc": "Logistics Org", + "long_desc": "Logistics Org" }, - "locations":[ + "locations": [ { "id": "L1", "gps": "13.786587,76.872309", @@ -59,10 +58,25 @@ "category_ids": [ "category1" ], - "time":{ + "time": { "duration": "PT60M", - "timestamp":"2024-01-14T16: 00: 00.000Z" + "timestamp": "2024-01-14T16: 00: 00.000Z" }, + "tags": [ + { + "descriptor": { + "name": "charges" + }, + "List": [ + { + "descriptor": { + "code": "Min-Chargable-Weight-in-KG" + }, + "value": "10" + } + ] + } + ], "quantity": { "selected": { "count": "1", @@ -74,7 +88,7 @@ } } ], - "quote" :{ + "quote": { "price": { "currency": "INR", "value": "50" @@ -94,7 +108,7 @@ }, "fulfillments": [ { - "type": "Home-Delivery", + "type": "Road-Shipping", "stops": [ { "location": { @@ -129,10 +143,11 @@ "status": "PAID", "type": "PRE-FULFILLMENT", "params": { - "amount": "1500", - "currency": "INR", - "bank_code": "INB0004321", - "bank_account_number": "1234002341" + "transaction_id": "tid/6737457", + "amount": "1500", + "currency": "INR", + "bank_code": "INB0004321", + "bank_account_number": "1234002341" } } } diff --git a/examples/confirm/confirm.json b/examples/confirm/confirm.json index dfb131f..913a972 100644 --- a/examples/confirm/confirm.json +++ b/examples/confirm/confirm.json @@ -1,4 +1,3 @@ - { "context": { "domain": "logistics", @@ -26,7 +25,7 @@ "provider": { "id": "P1" }, - "items":[ + "items": [ { "id": "I1", "quantity": { @@ -42,7 +41,7 @@ ], "fulfillments": [ { - "type": "Home-Delivery", + "type": "Road-Shipping", "stops": [ { "location": { @@ -72,10 +71,11 @@ "status": "PAID", "type": "PRE-FULFILLMENT", "params": { - "amount": "1500", - "currency": "INR", - "bank_code": "INB0004321", - "bank_account_number": "1234002341" + "transaction_id": "tid/6737457", + "amount": "1500", + "currency": "INR", + "bank_code": "INB0004321", + "bank_account_number": "1234002341" } } } diff --git a/examples/confirm/on-confirm.json b/examples/confirm/on-confirm.json index 776b1d5..a47d791 100644 --- a/examples/confirm/on-confirm.json +++ b/examples/confirm/on-confirm.json @@ -20,17 +20,17 @@ "timestamp": "2024-01-15T16:00:00.000Z", "ttl": "PT30S" }, - "message": { + "message": { "order": { "id": "oid/12", - "provider": { - "id":"P1", - "descriptor": { - "name":"Logistics", - "short_desc":"Logistics Org", - "long_desc":"Logistics Org" + "provider": { + "id": "P1", + "descriptor": { + "name": "Logistics", + "short_desc": "Logistics Org", + "long_desc": "Logistics Org" }, - "locations":[ + "locations": [ { "id": "L1", "gps": "13.786587,76.872309", @@ -58,10 +58,21 @@ "category_ids": [ "category1" ], - "time":{ - "duration": "PT60M", - "timestamp":"2024-01-14T16: 00: 00.000Z" - }, + "tags": [ + { + "descriptor": { + "name": "charges" + }, + "List": [ + { + "descriptor": { + "code": "Min-Chargable-Weight-in-KG" + }, + "value": "10" + } + ] + } + ], "quantity": { "selected": { "count": "1", @@ -73,7 +84,7 @@ } } ], - "quote" :{ + "quote": { "price": { "currency": "INR", "value": "50" @@ -86,14 +97,14 @@ }, "price": { "currency": "INR", - "value": "50" + "value": "starting from 50.0" } } ] }, "fulfillments": [ { - "type": "Home-Delivery", + "type": "Road-Shipping", "stops": [ { "location": { @@ -128,10 +139,11 @@ "status": "PAID", "type": "PRE-FULFILLMENT", "params": { - "amount": "1500", - "currency": "INR", - "bank_code": "INB0004321", - "bank_account_number": "1234002341" + "transaction_id": "tid/6737457", + "amount": "1500", + "currency": "INR", + "bank_code": "INB0004321", + "bank_account_number": "1234002341" } } } diff --git a/examples/init/init.json b/examples/init/init.json index c2904f9..6e3dc14 100644 --- a/examples/init/init.json +++ b/examples/init/init.json @@ -41,7 +41,7 @@ ], "fulfillments": [ { - "type": "Home-Delivery", + "type": "Road-Shipping", "stops": [ { "location": { diff --git a/examples/init/on-init.json b/examples/init/on-init.json index 65058fb..9604ede 100644 --- a/examples/init/on-init.json +++ b/examples/init/on-init.json @@ -52,15 +52,26 @@ }, "price": { "currency": "INR", - "value": "50.0" + "value": "starting from 50.0" }, "category_ids": [ "category1" ], - "time":{ - "duration": "PT60M", - "timestamp":"2024-01-14T16: 00: 00.000Z" - }, + "tags": [ + { + "descriptor": { + "name": "charges" + }, + "List": [ + { + "descriptor": { + "code": "Min-Chargable-Weight-in-KG" + }, + "value": "10" + } + ] + } + ], "quantity": { "selected": { "count": "1", @@ -92,7 +103,7 @@ }, "fulfillments": [ { - "type": "Home-Delivery", + "type": "Road-Shipping", "stops": [ { "location": { diff --git a/examples/search/on-search.json b/examples/search/on-search.json index 783dd58..413e3ec 100644 --- a/examples/search/on-search.json +++ b/examples/search/on-search.json @@ -54,15 +54,15 @@ "fulfillments": [ { "id":"1", - "type":"Home-Delivery" + "type":"Road-Shipping" }, { "id":"2", - "type":"Store-Pickup" + "type":"Rail-Shipping" }, { "id":"3", - "type":"Store-Pickup-And-Home-Delivery" + "type":"Air-Shipping" } ], "items": [ @@ -75,7 +75,7 @@ }, "price": { "currency": "INR", - "value": "50.0" + "value": "starting from 50.0" }, "category_ids": [ "category1" @@ -83,10 +83,21 @@ "fulfillment_ids": [ "1" ], - "time":{ - "duration": "PT60M", - "timestamp":"2024-01-14T16: 00: 00.000Z" - } + "tags": [ + { + "descriptor": { + "name": "charges" + }, + "List": [ + { + "descriptor": { + "code": "Min-Chargable-Weight-in-KG" + }, + "value": "10" + } + ] + } + ] } ] } diff --git a/examples/search/search-by-fulfillment.json b/examples/search/search-by-fulfillment.json index 907a015..d6cb5d5 100644 --- a/examples/search/search-by-fulfillment.json +++ b/examples/search/search-by-fulfillment.json @@ -25,13 +25,6 @@ "name": "Fast delivery" } }, - "provider": { - "locations": [ - { - "id": "loc/1" - } - ] - }, "fulfillment": { "stops": [ { @@ -46,7 +39,7 @@ "location": { "gps": "14.433424,77.928379", "address": { - "area_code": "320042" + "area_code": "540045" } } } diff --git a/examples/search/search.json b/examples/search/search.json index 186847f..d608e59 100644 --- a/examples/search/search.json +++ b/examples/search/search.json @@ -24,13 +24,6 @@ "descriptor": { "name": "Fast delivery" } - }, - "provider": { - "locations": [ - { - "id": "loc/1" - } - ] } } } diff --git a/examples/select/on-select.json b/examples/select/on-select.json index fe5aae5..43a0176 100644 --- a/examples/select/on-select.json +++ b/examples/select/on-select.json @@ -52,15 +52,26 @@ }, "price": { "currency": "INR", - "value": "50.0" + "value": "starting from 50.0" }, "category_ids": [ "category1" ], - "time":{ - "duration": "PT60M", - "timestamp":"2024-01-14T16: 00: 00.000Z" - }, + "tags": [ + { + "descriptor": { + "name": "charges" + }, + "List": [ + { + "descriptor": { + "code": "Min-Chargable-Weight-in-KG" + }, + "value": "10" + } + ] + } + ], "quantity": { "selected": { "count": "1", @@ -75,7 +86,24 @@ "fulfillments": [ { "id":"1", - "type":"Home-Delivery" + "stops": [ + { + "location": { + "gps": "14.785638,76.454553", + "address": { + "area_code": "320042" + } + } + }, + { + "location": { + "gps": "14.433424,77.928379", + "address": { + "area_code": "320042" + } + } + } + ] } ], "quote" :{ diff --git a/examples/select/select.json b/examples/select/select.json index 3d8bac6..95974d2 100644 --- a/examples/select/select.json +++ b/examples/select/select.json @@ -41,7 +41,25 @@ ], "fulfillments": [ { - "id": "1" + "id": "1", + "stops": [ + { + "location": { + "gps": "14.785638,76.454553", + "address": { + "area_code": "320042" + } + } + }, + { + "location": { + "gps": "14.433424,77.928379", + "address": { + "area_code": "320042" + } + } + } + ] } ] } diff --git a/examples/status/on-status.json b/examples/status/on-status.json index efb1ea4..36446bf 100644 --- a/examples/status/on-status.json +++ b/examples/status/on-status.json @@ -1,4 +1,3 @@ - { "context": { "domain": "logistics", @@ -24,14 +23,14 @@ "message": { "order": { "id": "oid/12", - "provider": { - "id":"P1", - "descriptor": { - "name":"Logistics", - "short_desc":"Logistics Org", - "long_desc":"Logistics Org" + "provider": { + "id": "P1", + "descriptor": { + "name": "Logistics", + "short_desc": "Logistics Org", + "long_desc": "Logistics Org" }, - "locations":[ + "locations": [ { "id": "L1", "gps": "13.786587,76.872309", @@ -54,15 +53,26 @@ }, "price": { "currency": "INR", - "value": "50.0" + "value": "starting from 50.0" }, "category_ids": [ "category1" ], - "time":{ - "duration": "PT60M", - "timestamp":"2024-01-14T16: 00: 00.000Z" - }, + "tags": [ + { + "descriptor": { + "name": "charges" + }, + "List": [ + { + "descriptor": { + "code": "Min-Chargable-Weight-in-KG" + }, + "value": "10" + } + ] + } + ], "quantity": { "selected": { "count": "1", @@ -74,7 +84,7 @@ } } ], - "quote" :{ + "quote": { "price": { "currency": "INR", "value": "50" @@ -94,7 +104,7 @@ }, "fulfillments": [ { - "type": "Home-Delivery", + "type": "Road-Shipping", "stops": [ { "location": { @@ -129,10 +139,11 @@ "status": "PAID", "type": "PRE-FULFILLMENT", "params": { - "amount": "1500", - "currency": "INR", - "bank_code": "INB0004321", - "bank_account_number": "1234002341" + "transaction_id": "tid/6737457", + "amount": "1500", + "currency": "INR", + "bank_code": "INB0004321", + "bank_account_number": "1234002341" } } } diff --git a/examples/update/on-update.json b/examples/update/on-update.json index 6f4c2a3..0e82ec1 100644 --- a/examples/update/on-update.json +++ b/examples/update/on-update.json @@ -1,4 +1,3 @@ - { "context": { "domain": "logistics", @@ -24,14 +23,14 @@ "message": { "order": { "id": "oid/12", - "provider": { - "id":"P1", - "descriptor": { - "name":"Logistics", - "short_desc":"Logistics Org", - "long_desc":"Logistics Org" + "provider": { + "id": "P1", + "descriptor": { + "name": "Logistics", + "short_desc": "Logistics Org", + "long_desc": "Logistics Org" }, - "locations":[ + "locations": [ { "id": "L1", "gps": "13.786587,76.872309", @@ -54,15 +53,26 @@ }, "price": { "currency": "INR", - "value": "50.0" + "value": "starting from 50.0" }, "category_ids": [ "category1" ], - "time":{ - "duration": "PT60M", - "timestamp":"2024-01-14T16: 00: 00.000Z" - }, + "tags": [ + { + "descriptor": { + "name": "charges" + }, + "List": [ + { + "descriptor": { + "code": "Min-Chargable-Weight-in-KG" + }, + "value": "10" + } + ] + } + ], "quantity": { "selected": { "count": "1", @@ -74,7 +84,7 @@ } } ], - "quote" :{ + "quote": { "price": { "currency": "INR", "value": "50" @@ -94,7 +104,7 @@ }, "fulfillments": [ { - "type": "Home-Delivery", + "type": "Road-Shipping", "stops": [ { "location": { @@ -129,10 +139,11 @@ "status": "PAID", "type": "PRE-FULFILLMENT", "params": { - "amount": "1500", - "currency": "INR", - "bank_code": "INB0004321", - "bank_account_number": "1234002341" + "transaction_id": "tid/6737457", + "amount": "1500", + "currency": "INR", + "bank_code": "INB0004321", + "bank_account_number": "1234002341" } } } From 478d7a37ade2c634d57cf8ac0b451bd4515873e9 Mon Sep 17 00:00:00 2001 From: Rajaneesh Date: Fri, 19 Jan 2024 15:45:47 +0530 Subject: [PATCH 13/26] changing quantity params in item --- examples/confirm/confirm.json | 5 ++--- examples/confirm/on-confirm.json | 5 ++--- examples/init/init.json | 5 ++--- examples/init/on-init.json | 5 ++--- examples/select/on-select.json | 5 ++--- examples/select/select.json | 5 ++--- examples/status/on-status.json | 5 ++--- examples/update/on-update.json | 5 ++--- 8 files changed, 16 insertions(+), 24 deletions(-) diff --git a/examples/confirm/confirm.json b/examples/confirm/confirm.json index 913a972..ba2c0b4 100644 --- a/examples/confirm/confirm.json +++ b/examples/confirm/confirm.json @@ -30,10 +30,9 @@ "id": "I1", "quantity": { "selected": { - "count": "1", + "count": "5", "measure": { - "unit": "KG", - "value": "1" + "unit": "KG" } } } diff --git a/examples/confirm/on-confirm.json b/examples/confirm/on-confirm.json index a47d791..a17a6a7 100644 --- a/examples/confirm/on-confirm.json +++ b/examples/confirm/on-confirm.json @@ -75,10 +75,9 @@ ], "quantity": { "selected": { - "count": "1", + "count": "5", "measure": { - "unit": "KG", - "value": "1" + "unit": "KG" } } } diff --git a/examples/init/init.json b/examples/init/init.json index 6e3dc14..1e76f4a 100644 --- a/examples/init/init.json +++ b/examples/init/init.json @@ -30,10 +30,9 @@ "id": "I1", "quantity": { "selected": { - "count": "1", + "count": "5", "measure": { - "unit": "KG", - "value": "1" + "unit": "KG" } } } diff --git a/examples/init/on-init.json b/examples/init/on-init.json index 9604ede..4a32609 100644 --- a/examples/init/on-init.json +++ b/examples/init/on-init.json @@ -74,10 +74,9 @@ ], "quantity": { "selected": { - "count": "1", + "count": "5", "measure": { - "unit": "KG", - "value": "1" + "unit": "KG" } } } diff --git a/examples/select/on-select.json b/examples/select/on-select.json index 43a0176..ebd9bbf 100644 --- a/examples/select/on-select.json +++ b/examples/select/on-select.json @@ -74,10 +74,9 @@ ], "quantity": { "selected": { - "count": "1", + "count": "5", "measure": { - "unit": "KG", - "value": "1" + "unit": "KG" } } } diff --git a/examples/select/select.json b/examples/select/select.json index 95974d2..6d8c456 100644 --- a/examples/select/select.json +++ b/examples/select/select.json @@ -30,10 +30,9 @@ "id": "I1", "quantity": { "selected": { - "count": "1", + "count": "5", "measure": { - "unit": "KG", - "value": "1" + "unit": "KG" } } } diff --git a/examples/status/on-status.json b/examples/status/on-status.json index 36446bf..96fc90e 100644 --- a/examples/status/on-status.json +++ b/examples/status/on-status.json @@ -75,10 +75,9 @@ ], "quantity": { "selected": { - "count": "1", + "count": "5", "measure": { - "unit": "KG", - "value": "1" + "unit": "KG" } } } diff --git a/examples/update/on-update.json b/examples/update/on-update.json index 0e82ec1..76cfa31 100644 --- a/examples/update/on-update.json +++ b/examples/update/on-update.json @@ -75,10 +75,9 @@ ], "quantity": { "selected": { - "count": "1", + "count": "5", "measure": { - "unit": "KG", - "value": "1" + "unit": "KG" } } } From 44a18b7d7afd380921fe54bb003f4d90c1aa6811 Mon Sep 17 00:00:00 2001 From: Rajaneesh Date: Fri, 19 Jan 2024 16:12:09 +0530 Subject: [PATCH 14/26] adding pickup time in fulfillment --- examples/cancel/on-cancel.json | 6 ++++++ examples/confirm/confirm.json | 6 ++++++ examples/confirm/on-confirm.json | 6 ++++++ examples/init/init.json | 6 ++++++ examples/init/on-init.json | 6 ++++++ examples/search/search-by-fulfillment.json | 2 ++ examples/select/on-select.json | 2 ++ examples/select/select.json | 2 ++ examples/status/on-status.json | 6 ++++++ examples/update/on-update.json | 6 ++++++ 10 files changed, 48 insertions(+) diff --git a/examples/cancel/on-cancel.json b/examples/cancel/on-cancel.json index adac9cb..b6e44f4 100644 --- a/examples/cancel/on-cancel.json +++ b/examples/cancel/on-cancel.json @@ -108,9 +108,11 @@ }, "fulfillments": [ { + "id": "1", "type": "Road-Shipping", "stops": [ { + "type": "Pickup", "location": { "gps": "14.785638,76.454553", "address": { @@ -119,11 +121,15 @@ } }, { + "type": "Drop", "location": { "gps": "14.433424,77.928379", "address": { "area_code": "320042" } + }, + "time": { + "timestamp": "2024-01-15T16:00:00.000Z" } } ], diff --git a/examples/confirm/confirm.json b/examples/confirm/confirm.json index ba2c0b4..a60e1ff 100644 --- a/examples/confirm/confirm.json +++ b/examples/confirm/confirm.json @@ -40,17 +40,23 @@ ], "fulfillments": [ { + "id": "1", "type": "Road-Shipping", "stops": [ { + "type": "Pickup", "location": { "gps": "14.785638,76.454553", "address": { "area_code": "320042" } + }, + "time": { + "timestamp": "2024-01-15T16:00:00.000Z" } }, { + "type": "Drop", "location": { "gps": "14.433424,77.928379", "address": { diff --git a/examples/confirm/on-confirm.json b/examples/confirm/on-confirm.json index a17a6a7..7c8f007 100644 --- a/examples/confirm/on-confirm.json +++ b/examples/confirm/on-confirm.json @@ -103,17 +103,23 @@ }, "fulfillments": [ { + "id": "1", "type": "Road-Shipping", "stops": [ { + "type": "Pickup", "location": { "gps": "14.785638,76.454553", "address": { "area_code": "320042" } + }, + "time": { + "timestamp": "2024-01-15T16:00:00.000Z" } }, { + "type": "Drop", "location": { "gps": "14.433424,77.928379", "address": { diff --git a/examples/init/init.json b/examples/init/init.json index 1e76f4a..12d89f2 100644 --- a/examples/init/init.json +++ b/examples/init/init.json @@ -40,17 +40,23 @@ ], "fulfillments": [ { + "id": "1", "type": "Road-Shipping", "stops": [ { + "type": "Pickup", "location": { "gps": "14.785638,76.454553", "address": { "area_code": "320042" } + }, + "time": { + "timestamp": "2024-01-15T16:00:00.000Z" } }, { + "type": "Drop", "location": { "gps": "14.433424,77.928379", "address": { diff --git a/examples/init/on-init.json b/examples/init/on-init.json index 4a32609..e1188ba 100644 --- a/examples/init/on-init.json +++ b/examples/init/on-init.json @@ -102,17 +102,23 @@ }, "fulfillments": [ { + "id": "1", "type": "Road-Shipping", "stops": [ { + "type": "Pickup", "location": { "gps": "14.785638,76.454553", "address": { "area_code": "320042" } + }, + "time": { + "timestamp": "2024-01-15T16:00:00.000Z" } }, { + "type": "Drop", "location": { "gps": "14.433424,77.928379", "address": { diff --git a/examples/search/search-by-fulfillment.json b/examples/search/search-by-fulfillment.json index d6cb5d5..f8357d2 100644 --- a/examples/search/search-by-fulfillment.json +++ b/examples/search/search-by-fulfillment.json @@ -28,6 +28,7 @@ "fulfillment": { "stops": [ { + "type": "Pickup", "location": { "gps": "14.785638,76.454553", "address": { @@ -36,6 +37,7 @@ } }, { + "type": "Drop", "location": { "gps": "14.433424,77.928379", "address": { diff --git a/examples/select/on-select.json b/examples/select/on-select.json index ebd9bbf..10969ca 100644 --- a/examples/select/on-select.json +++ b/examples/select/on-select.json @@ -87,6 +87,7 @@ "id":"1", "stops": [ { + "type": "Pickup", "location": { "gps": "14.785638,76.454553", "address": { @@ -95,6 +96,7 @@ } }, { + "type": "Drop", "location": { "gps": "14.433424,77.928379", "address": { diff --git a/examples/select/select.json b/examples/select/select.json index 6d8c456..d83f7de 100644 --- a/examples/select/select.json +++ b/examples/select/select.json @@ -43,6 +43,7 @@ "id": "1", "stops": [ { + "type": "Pickup", "location": { "gps": "14.785638,76.454553", "address": { @@ -51,6 +52,7 @@ } }, { + "type": "Drop", "location": { "gps": "14.433424,77.928379", "address": { diff --git a/examples/status/on-status.json b/examples/status/on-status.json index 96fc90e..acbeb24 100644 --- a/examples/status/on-status.json +++ b/examples/status/on-status.json @@ -103,17 +103,23 @@ }, "fulfillments": [ { + "id": "1", "type": "Road-Shipping", "stops": [ { + "type": "Pickup", "location": { "gps": "14.785638,76.454553", "address": { "area_code": "320042" } + }, + "time": { + "timestamp": "2024-01-15T16:00:00.000Z" } }, { + "type": "Drop", "location": { "gps": "14.433424,77.928379", "address": { diff --git a/examples/update/on-update.json b/examples/update/on-update.json index 76cfa31..49a430e 100644 --- a/examples/update/on-update.json +++ b/examples/update/on-update.json @@ -103,17 +103,23 @@ }, "fulfillments": [ { + "id": "1", "type": "Road-Shipping", "stops": [ { + "type": "Pickup", "location": { "gps": "14.785638,76.454553", "address": { "area_code": "320042" } + }, + "time": { + "timestamp": "2024-01-15T16:00:00.000Z" } }, { + "type": "Drop", "location": { "gps": "14.433424,77.928379", "address": { From e7b6ee84683fb8ce473d20633a02b7289ba72a59 Mon Sep 17 00:00:00 2001 From: Rajaneesh Date: Mon, 22 Jan 2024 14:52:08 +0530 Subject: [PATCH 15/26] adding example jsons in implementation guide --- docs/implementation-guide/1_Logistics.md | 1139 +++++++++++++++++++++- 1 file changed, 1130 insertions(+), 9 deletions(-) diff --git a/docs/implementation-guide/1_Logistics.md b/docs/implementation-guide/1_Logistics.md index 8ba4320..25eb46e 100644 --- a/docs/implementation-guide/1_Logistics.md +++ b/docs/implementation-guide/1_Logistics.md @@ -32,12 +32,169 @@ The following recommendations need to be considered when implementing discovery ### Example A search request for a logistics service provider may look like this ``` - +{ + "context": { + "domain": "logistics", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, + "action": "search", + "version": "1.1.0", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "7a47a08d-69e0-4a14-9216-a95bfde08965", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "intent": { + "category": { + "descriptor": { + "name": "Fast delivery" + } + }, + "fulfillment": { + "stops": [ + { + "type": "Pickup", + "location": { + "gps": "14.785638,76.454553", + "address": { + "area_code": "320042" + } + } + }, + { + "type": "Drop", + "location": { + "gps": "14.433424,77.928379", + "address": { + "area_code": "540045" + } + } + } + ] + } + } + } +} ``` An example catalog of a logistics service provider may look like this ``` - +{ + "context": { + "domain": "logistics", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, + "action": "on_search", + "version": "1.1.0", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "catalog": { + "descriptor": { + "name":"XYZLogistics" + }, + "providers": [ + { + "id":"P1", + "descriptor": { + "name":"Logistics", + "short_desc":"Logistics Org", + "long_desc":"Logistics Org" + }, + "locations":[ + { + "id": "L1", + "gps": "13.786587,76.872309", + "address": "Shubhash nagar, 3rd block", + "city": "Bengaluru", + "area_code": "560042", + "state": "KA" + } + ], + "categories": [ + { + "id": "category1", + "descriptor": { + "name": "Fast delivery" + } + } + ], + "fulfillments": [ + { + "id":"1", + "type":"Road-Shipping" + }, + { + "id":"2", + "type":"Rail-Shipping" + }, + { + "id":"3", + "type":"Air-Shipping" + } + ], + "items": [ + { + "id": "I1", + "descriptor": { + "Name": "Lightweight delivery", + "short_desc": "Delivery in just 1 hours", + "long_desc": "Delivery in just 1 hours" + }, + "price": { + "currency": "INR", + "value": "starting from 50.0" + }, + "category_ids": [ + "category1" + ], + "fulfillment_ids": [ + "1" + ], + "tags": [ + { + "descriptor": { + "name": "charges" + }, + "List": [ + { + "descriptor": { + "code": "Min-Chargable-Weight-in-KG" + }, + "value": "10" + } + ] + } + ] + } + ] + } + ] + } + } +} ``` ## 1.2 Initiating an order for a logistics service @@ -77,32 +234,694 @@ This section provides recommendations for implementing the APIs related to a log Below is an example of a `select` request ``` - +{ + "context": { + "domain": "logistics", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, + "action": "select", + "version": "1.1.0", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "order": { + "provider": { + "id": "P1" + }, + "items":[ + { + "id": "I1", + "quantity": { + "selected": { + "count": "5", + "measure": { + "unit": "KG" + } + } + } + } + ], + "fulfillments": [ + { + "id": "1", + "stops": [ + { + "type": "Pickup", + "location": { + "gps": "14.785638,76.454553", + "address": { + "area_code": "320042" + } + } + }, + { + "type": "Drop", + "location": { + "gps": "14.433424,77.928379", + "address": { + "area_code": "320042" + } + } + } + ] + } + ] + } + } +} ``` Below is an example of an `on_select` callback ``` - +{ + "context": { + "domain": "logistics", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, + "action": "on_select", + "version": "1.1.0", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "order": { + "provider": { + "id":"P1", + "descriptor": { + "name":"Logistics", + "short_desc":"Logistics Org", + "long_desc":"Logistics Org" + }, + "locations":[ + { + "id": "L1", + "gps": "13.786587,76.872309", + "address": { + "street": "Shubhash nagar, 3rd block", + "city": "Bengaluru", + "area_code": "560042", + "state": "KA" + } + } + ] + }, + "items": [ + { + "id": "I1", + "descriptor": { + "Name": "Lightweight delivery", + "short_desc": "Delivery in just 1 hours", + "long_desc": "Delivery in just 1 hours" + }, + "price": { + "currency": "INR", + "value": "starting from 50.0" + }, + "category_ids": [ + "category1" + ], + "tags": [ + { + "descriptor": { + "name": "charges" + }, + "List": [ + { + "descriptor": { + "code": "Min-Chargable-Weight-in-KG" + }, + "value": "10" + } + ] + } + ], + "quantity": { + "selected": { + "count": "5", + "measure": { + "unit": "KG" + } + } + } + } + ], + "fulfillments": [ + { + "id":"1", + "stops": [ + { + "type": "Pickup", + "location": { + "gps": "14.785638,76.454553", + "address": { + "area_code": "320042" + } + } + }, + { + "type": "Drop", + "location": { + "gps": "14.433424,77.928379", + "address": { + "area_code": "320042" + } + } + } + ] + } + ], + "quote" :{ + "price": { + "currency": "INR", + "value": "50" + }, + "breakup": [ + { + "type": "item", + "item": { + "id": "I1" + }, + "price": { + "currency": "INR", + "value": "50" + } + } + ] + } + } + } +} ``` Below is an example of a `init` request ``` - +{ + "context": { + "domain": "logistics", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, + "action": "init", + "version": "1.1.0", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "order": { + "provider": { + "id": "P1" + }, + "items":[ + { + "id": "I1", + "quantity": { + "selected": { + "count": "5", + "measure": { + "unit": "KG" + } + } + } + } + ], + "fulfillments": [ + { + "id": "1", + "type": "Road-Shipping", + "stops": [ + { + "type": "Pickup", + "location": { + "gps": "14.785638,76.454553", + "address": { + "area_code": "320042" + } + }, + "time": { + "timestamp": "2024-01-15T16:00:00.000Z" + } + }, + { + "type": "Drop", + "location": { + "gps": "14.433424,77.928379", + "address": { + "area_code": "320042" + } + } + } + ] + } + ], + "billing": { + "name": "Paul Sterling", + "phone": "+919876345623", + "email": "sample@gmail.com" + } + } + } +} ``` Below is an example of an `on_init` callback ``` - +{ + "context": { + "domain": "logistics", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, + "action": "on_init", + "version": "1.1.0", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "order": { + "provider": { + "id":"P1", + "descriptor": { + "name":"Logistics", + "short_desc":"Logistics Org", + "long_desc":"Logistics Org" + }, + "locations":[ + { + "id": "L1", + "gps": "13.786587,76.872309", + "address": { + "street": "Shubhash nagar, 3rd block", + "city": "Bengaluru", + "area_code": "560042", + "state": "KA" + } + } + ] + }, + "items": [ + { + "id": "I1", + "descriptor": { + "Name": "Lightweight delivery", + "short_desc": "Delivery in just 1 hours", + "long_desc": "Delivery in just 1 hours" + }, + "price": { + "currency": "INR", + "value": "starting from 50.0" + }, + "category_ids": [ + "category1" + ], + "tags": [ + { + "descriptor": { + "name": "charges" + }, + "List": [ + { + "descriptor": { + "code": "Min-Chargable-Weight-in-KG" + }, + "value": "10" + } + ] + } + ], + "quantity": { + "selected": { + "count": "5", + "measure": { + "unit": "KG" + } + } + } + } + ], + "quote" :{ + "price": { + "currency": "INR", + "value": "50" + }, + "breakup": [ + { + "type": "item", + "item": { + "id": "I1" + }, + "price": { + "currency": "INR", + "value": "50" + } + } + ] + }, + "fulfillments": [ + { + "id": "1", + "type": "Road-Shipping", + "stops": [ + { + "type": "Pickup", + "location": { + "gps": "14.785638,76.454553", + "address": { + "area_code": "320042" + } + }, + "time": { + "timestamp": "2024-01-15T16:00:00.000Z" + } + }, + { + "type": "Drop", + "location": { + "gps": "14.433424,77.928379", + "address": { + "area_code": "320042" + } + } + } + ] + } + ], + "billing": { + "name": "Paul Sterling", + "phone": "+919876345623", + "email": "sample@gmail.com" + }, + "payment": { + "status": "NOT-PAID", + "type": "PRE-FULFILLMENT", + "params": { + "amount": "1500", + "currency": "INR", + "bank_code": "INB0004321", + "bank_account_number": "1234002341" + } + } + } + } +} ``` Below is an example of a `confirm` request ``` - +{ + "context": { + "domain": "logistics", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, + "action": "confirm", + "version": "1.1.0", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "order": { + "provider": { + "id": "P1" + }, + "items": [ + { + "id": "I1", + "quantity": { + "selected": { + "count": "5", + "measure": { + "unit": "KG" + } + } + } + } + ], + "fulfillments": [ + { + "id": "1", + "type": "Road-Shipping", + "stops": [ + { + "type": "Pickup", + "location": { + "gps": "14.785638,76.454553", + "address": { + "area_code": "320042" + } + }, + "time": { + "timestamp": "2024-01-15T16:00:00.000Z" + } + }, + { + "type": "Drop", + "location": { + "gps": "14.433424,77.928379", + "address": { + "area_code": "320042" + } + } + } + ] + } + ], + "billing": { + "name": "Paul Sterling", + "phone": "+919876345623", + "email": "sample@gmail.com" + }, + "payment": { + "status": "PAID", + "type": "PRE-FULFILLMENT", + "params": { + "transaction_id": "tid/6737457", + "amount": "1500", + "currency": "INR", + "bank_code": "INB0004321", + "bank_account_number": "1234002341" + } + } + } + } +} ``` Below is an example of an `on_confirm` callback ``` - +{ + "context": { + "domain": "logistics", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, + "action": "on_confirm", + "version": "1.1.0", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "order": { + "id": "oid/12", + "provider": { + "id": "P1", + "descriptor": { + "name": "Logistics", + "short_desc": "Logistics Org", + "long_desc": "Logistics Org" + }, + "locations": [ + { + "id": "L1", + "gps": "13.786587,76.872309", + "address": { + "street": "Shubhash nagar, 3rd block", + "city": "Bengaluru", + "area_code": "560042", + "state": "KA" + } + } + ] + }, + "items": [ + { + "id": "I1", + "descriptor": { + "Name": "Lightweight delivery", + "short_desc": "Delivery in just 1 hours", + "long_desc": "Delivery in just 1 hours" + }, + "price": { + "currency": "INR", + "value": "50.0" + }, + "category_ids": [ + "category1" + ], + "tags": [ + { + "descriptor": { + "name": "charges" + }, + "List": [ + { + "descriptor": { + "code": "Min-Chargable-Weight-in-KG" + }, + "value": "10" + } + ] + } + ], + "quantity": { + "selected": { + "count": "5", + "measure": { + "unit": "KG" + } + } + } + } + ], + "quote": { + "price": { + "currency": "INR", + "value": "50" + }, + "breakup": [ + { + "type": "item", + "item": { + "id": "I1" + }, + "price": { + "currency": "INR", + "value": "starting from 50.0" + } + } + ] + }, + "fulfillments": [ + { + "id": "1", + "type": "Road-Shipping", + "stops": [ + { + "type": "Pickup", + "location": { + "gps": "14.785638,76.454553", + "address": { + "area_code": "320042" + } + }, + "time": { + "timestamp": "2024-01-15T16:00:00.000Z" + } + }, + { + "type": "Drop", + "location": { + "gps": "14.433424,77.928379", + "address": { + "area_code": "320042" + } + } + } + ], + "state": { + "descriptor": { + "code": "Pending-Fulfillment" + } + } + } + ], + "billing": { + "name": "Paul Sterling", + "phone": "+919876345623", + "email": "sample@gmail.com" + }, + "payment": { + "status": "PAID", + "type": "PRE-FULFILLMENT", + "params": { + "transaction_id": "tid/6737457", + "amount": "1500", + "currency": "INR", + "bank_code": "INB0004321", + "bank_account_number": "1234002341" + } + } + } + } +} ``` ## 1.3 Fulfillment of a logistics order @@ -145,11 +964,192 @@ This section contains recommendations for implementing the APIs related to fulfi Below is an example of a `status` request ``` +{ + "context": { + "domain": "logistics", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, + "action": "status", + "version": "1.1.0", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "order_id": "oid/12" + } +} ``` Below is an example of an `on_status` callback ``` - +{ + "context": { + "domain": "logistics", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, + "action": "on_status", + "version": "1.1.0", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "order": { + "id": "oid/12", + "provider": { + "id": "P1", + "descriptor": { + "name": "Logistics", + "short_desc": "Logistics Org", + "long_desc": "Logistics Org" + }, + "locations": [ + { + "id": "L1", + "gps": "13.786587,76.872309", + "address": { + "street": "Shubhash nagar, 3rd block", + "city": "Bengaluru", + "area_code": "560042", + "state": "KA" + } + } + ] + }, + "items": [ + { + "id": "I1", + "descriptor": { + "Name": "Lightweight delivery", + "short_desc": "Delivery in just 1 hours", + "long_desc": "Delivery in just 1 hours" + }, + "price": { + "currency": "INR", + "value": "starting from 50.0" + }, + "category_ids": [ + "category1" + ], + "tags": [ + { + "descriptor": { + "name": "charges" + }, + "List": [ + { + "descriptor": { + "code": "Min-Chargable-Weight-in-KG" + }, + "value": "10" + } + ] + } + ], + "quantity": { + "selected": { + "count": "5", + "measure": { + "unit": "KG" + } + } + } + } + ], + "quote": { + "price": { + "currency": "INR", + "value": "50" + }, + "breakup": [ + { + "type": "item", + "item": { + "id": "I1" + }, + "price": { + "currency": "INR", + "value": "50" + } + } + ] + }, + "fulfillments": [ + { + "id": "1", + "type": "Road-Shipping", + "stops": [ + { + "type": "Pickup", + "location": { + "gps": "14.785638,76.454553", + "address": { + "area_code": "320042" + } + }, + "time": { + "timestamp": "2024-01-15T16:00:00.000Z" + } + }, + { + "type": "Drop", + "location": { + "gps": "14.433424,77.928379", + "address": { + "area_code": "320042" + } + } + } + ], + "state": { + "descriptor": { + "code": "Shipped" + } + } + } + ], + "billing": { + "name": "Paul Sterling", + "phone": "+919876345623", + "email": "sample@gmail.com" + }, + "payment": { + "status": "PAID", + "type": "PRE-FULFILLMENT", + "params": { + "transaction_id": "tid/6737457", + "amount": "1500", + "currency": "INR", + "bank_code": "INB0004321", + "bank_account_number": "1234002341" + } + } + } + } +} ``` ## 1.4 Post-fulfillment of logistics order @@ -191,18 +1191,139 @@ Below is an example of a `rating` request ``` +{ + "context": { + "domain": "logistics", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, + "action": "rating", + "version": "1.1.0", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "ratings": [ + { + "rating_category": "Order", + "id": "oid/12", + "value": "4" + } + ] + } +} ``` Below is an example of an `on_rating` callback ``` +{ + "context": { + "domain": "logistics", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, + "action": "on_rating", + "version": "1.1.0", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "feedback_form": { + "form": { + "url": "https://form/url" + } + } + } +} ``` Below is an example of a `support` request ``` +{ + "context": { + "domain": "logistics", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, + "action": "support", + "version": "1.1.0", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "support": { + "type": "Order", + "ref_id": "oid/12", + "callback_phone": "+919876564534" + } + } +} ``` Below is an example of an `on_support` callback ``` +{ + "context": { + "domain": "logistics", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, + "action": "on_support", + "version": "1.1.0", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "support": { + "phone": "+918675453298", + "email": "helpline@logistics.com" + } + } +} ``` From ba23ec58fc453e715e8fe45573be80c2f20a11d4 Mon Sep 17 00:00:00 2001 From: Rajaneesh Date: Tue, 23 Jan 2024 12:34:50 +0530 Subject: [PATCH 16/26] adding get-rating-categories and rating categories examples --- docs/implementation-guide/1_Logistics.md | 58 +++++++++++++++++++++- examples/rating/get-rating-categories.json | 23 +++++++++ examples/rating/rating-categories.json | 33 ++++++++++++ 3 files changed, 112 insertions(+), 2 deletions(-) create mode 100644 examples/rating/get-rating-categories.json create mode 100644 examples/rating/rating-categories.json diff --git a/docs/implementation-guide/1_Logistics.md b/docs/implementation-guide/1_Logistics.md index 25eb46e..cff9876 100644 --- a/docs/implementation-guide/1_Logistics.md +++ b/docs/implementation-guide/1_Logistics.md @@ -1179,12 +1179,66 @@ This section contains recommendations for implementing the APIs after fulfilling Below is an example of a `get_rating_categories` request ``` - +{ + "context": { + "domain": "logistics", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, + "action": "get_rating_categories", + "version": "1.1.0", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + } +} ``` Below is an example of an `rating_categories` callback ``` - +{ + "context": { + "domain": "logistics", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, + "action": "rating_categories", + "version": "1.1.0", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "rating_categories" : [ + "Item", + "Order", + "Fulfillment", + "provider", + "Agent", + "SUpport" + ] + } +} ``` Below is an example of a `rating` request diff --git a/examples/rating/get-rating-categories.json b/examples/rating/get-rating-categories.json new file mode 100644 index 0000000..5620fab --- /dev/null +++ b/examples/rating/get-rating-categories.json @@ -0,0 +1,23 @@ +{ + "context": { + "domain": "logistics", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, + "action": "get_rating_categories", + "version": "1.1.0", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + } +} \ No newline at end of file diff --git a/examples/rating/rating-categories.json b/examples/rating/rating-categories.json new file mode 100644 index 0000000..2b90d0e --- /dev/null +++ b/examples/rating/rating-categories.json @@ -0,0 +1,33 @@ +{ + "context": { + "domain": "logistics", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, + "action": "rating_categories", + "version": "1.1.0", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "rating_categories" : [ + "Item", + "Order", + "Fulfillment", + "provider", + "Agent", + "SUpport" + ] + } +} \ No newline at end of file From edf6278058c4c02b44ac528eedf0487ce90f60d7 Mon Sep 17 00:00:00 2001 From: Rajaneesh Date: Wed, 6 Mar 2024 09:09:18 +0530 Subject: [PATCH 17/26] adding docs in the Logistics specification --- NP-Logs/Logs-Upload-Instructions.md | 21 ---------------- docs/1_Introduction.md | 37 +++++++++++++++++++++++++++++ docs/2_Terminology.md | 0 docs/3_Scope.md | 0 docs/4_Enumerations.md | 33 +++++++++++++++++++++++++ docs/README.md | 6 +++++ 6 files changed, 76 insertions(+), 21 deletions(-) delete mode 100644 NP-Logs/Logs-Upload-Instructions.md create mode 100644 docs/1_Introduction.md create mode 100644 docs/2_Terminology.md create mode 100644 docs/3_Scope.md create mode 100644 docs/4_Enumerations.md create mode 100644 docs/README.md diff --git a/NP-Logs/Logs-Upload-Instructions.md b/NP-Logs/Logs-Upload-Instructions.md deleted file mode 100644 index 4046f75..0000000 --- a/NP-Logs/Logs-Upload-Instructions.md +++ /dev/null @@ -1,21 +0,0 @@ -# Instructions for Network Participants to Upload Their Logs - -1. **Navigate to the NP Logs Folder:** - - Open the file explorer or command line interface. - - Locate and navigate to the designated NP Logs Folder on the shared network drive or platform. - -2. **Create a New Folder with Your Name:** - - Within the NP Logs Folder, create a new folder with your name (NP Name). - - Use this folder to organize and store your logs securely. - -3. **Upload All Logs into Respective Subfolders:** - - Inside your named folder, create subfolders such as 'search,' 'select,' 'init,' 'confirm,' etc. - - Upload the corresponding logs into their respective subfolders. - - Ensure that all logs are organized according to their specific categories. - -4. **Create a Pull Request (PR) with the Draft Branch:** - - After successfully uploading your logs, navigate to the version control system or platform used by the project. - - Commit the changes made to your forked repository and create a Pull Request (PR) for your changes with the `draft` branch, providing a clear description of the updates and logs added. - - Assign relevant reviewers and wait for approval before merging the changes into the main branch. - -By following these instructions, you will contribute to maintaining an organized and traceable log system for the network participants. diff --git a/docs/1_Introduction.md b/docs/1_Introduction.md new file mode 100644 index 0000000..26d084f --- /dev/null +++ b/docs/1_Introduction.md @@ -0,0 +1,37 @@ +# 1. Introduction + +## 1.1 Unifying the local retail through Public Digital Infrastructure + +Local retail offen struggles with limited customer reach. Without an online platform local retail faces challenges in reaching a broader audience, capitalizing on e-commerce trends, and competing with digitally enabled counterparts, hindering potential growth and adaptability in the modern retail landscape. To address these issues, a unifying framework is essential. This article explores the concept of a public digital infrastructure that leverages a common protocol standard known as local-retail. + +## 1.2 Beckn Protocol: A Primer + +The Beckn Protocol serves as a foundational layer for this digital infrastructure. It is an open protocol that allows businesses across any industry to be discovered and engaged by any Beckn-enabled application. The protocol is a collection of open specifications consisting of APIs, message formats, network design, and reference architectures. It enables server-to-server communication, allowing consumer-facing platforms to discover and transact with any business with minimal implementation overhead. The protocol decouples the demand and supply sides, enabling services to be available on any online consumer interface that has mainstream adoption in a city (source). + +## 1.3 Local retail Protocol + +Local Reatil is an adaptation of Beckn Protocol tailored for the retail sector. It provides a set of configurable, extendable, modular open-source digital building blocks. Platforms offering services in retail can implement Local-Retail specification to ensure seamless discovery of opportunities and trust in transactions. + +## 1.4 Key Digital Functionalities of Local-Retail enabled platforms + +1. Discovery: Discovery, browsing of catalogs containing retail items offered by various providers. +1. Ordering: Selecting items from the catalog and doing payment for retail items from any provider. +1. Fulfillment: Manages post-order activities like tracking and status updates during the fulfillment of any of the activities mentioned above. +1. Post-Fulfillment: Handles activities like rating, feedback, support, and issuing of verifiable credentials. + + +## 1.5 Transporting Verifiable Credentials: Enhancing Trust and Reliability + +One of the most transformative aspects of the Beckn Protocol and Local-Retail is the ability to transport verifiable credentials securely. This feature is particularly crucial in retial sector, where the verification of the providers is paramount. By embedding these credentials within the protocol, customers can instantly verify the authenticity of the providers, thereby greatly enhancing the trust and reliability of transactions. + +## 1.6 Benefits of a Unified Digital Infrastructure + +1. Reduced Information Asymmetry: A common protocol allows for standardized information sharing, reducing gaps in knowledge and expectations. +1. Cost-Effective Trust Verification: The protocol's inherent security features minimize the cost of trust verification. +1. Enhanced Discoverability: The infrastructure allows for the seamless discovery of opportunities across multiple platforms. +1. Portability: Users can easily switch between different service providers without losing their data or trust credentials. + +## 1.7 Conclusion + + +Embracing a Local Retail as a public digital infrastructure holds the transformative power to revolutionize the local retail landscape. This scalable, secure, and efficient platform connects stakeholders seamlessly, paving the way for a frictionless exchange in areas such as inventory management, marketing, and supply chain services. By fostering innovation and collaboration, LLocal Retail can turn challenges into opportunities, creating a more equitable, efficient, and effective ecosystem for local businesses, and elevating trust through features like transparent transactions and reliable customer feedback. diff --git a/docs/2_Terminology.md b/docs/2_Terminology.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/3_Scope.md b/docs/3_Scope.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/4_Enumerations.md b/docs/4_Enumerations.md new file mode 100644 index 0000000..aea2b2c --- /dev/null +++ b/docs/4_Enumerations.md @@ -0,0 +1,33 @@ + +# Domain Enumerations + +This documentation outlines the example enumerations for the Beckn Logistics API Specification. Enumerations such as FulfillmentType, OrderStatus, PaymentStatus, TrackingStatus are defined alongside their respective states, providing clarity on the status of delivery, orders, payment, tracking and much more within the Logistics system. Network facilitaotrs can refer to this document while implementing Beckn protocol for logistics. + +Note: This is not a global data standard. It is just an example of how the network facilitators implementing Beckn protocol for logistics use cases can create network specific data standards, enums, and policy. + + +## Examples: +| Attribute Name | Description | Enumerations | +|-----------------------------------------|---------------------------------------|--------------------------------------------------------------------------------------------------------| +| Ack.status | The status of the acknowledgement. If the request passes the validation criteria of the BPP, then this is set to ACK. If the request fails the validation criteria, then this is set to NACK.| ACK,NACK | +| Cancellation.cancelled_by | Represent the user who has cancelled the order| CONSUMER,PROVIDER| +| Descriptor.additional_desc.content_type| Different mime-type of the content in additional description | text/plain,text/html,application/json| +| Error.type | Type of errors a NP can send | CONTEXT-ERROR,CORE-ERROR,DOMAIN-ERROR,POLICY-ERROR,JSON_SCHEMA-ERROR| +| Form.mime_type | This field indicates the nature and format of the form received by querying the url. MIME types are defined and standardized in IETF's RFC 6838.| text/html, application/xml| +| Fulfillment.type| A code that describes the mode of fulfillment. This is typically set when there are multiple ways an order can be fulfilled(delivered)| Home-Delivery,Store-Pickup,Store-Pickup-And-Home-Delivery| +| FulfillmentDescriptor.code| A code that describes the status of the fulfillment.| Pending-Fulfillment, Packing, Picking, Shipped, Out-for-Delivery, Delivered, Failed-Fulfillment, Canceled, Returned| +| Image.size_type|The size of the image. The network policy can define the default dimensions of each type| xs,sm,md,lg,xl,custom| +| Order.status|Status of the order. Allowed values can be defined by the network policy| Initiated,Acknowledged,Packed,Shipped,Delivered,Cancelled| +| Order.type| This is used to indicate the type of order being created to BPPs. Sometimes orders can be linked to previous orders, like a replacement order.| DEFAULT, DRAFT| +| Payment.collected_by|This field indicates who is the collector of payment. The BAP can set this value to 'bap' if it wants to collect the payment first and settle it to the BPP. If the BPP agrees to those terms, the BPP should not send the payment url. Alternatively, the BPP can set this field with the value 'bpp' if it wants the payment to be made directly.|BAP,BPP| +| Payment.status| Status of the Payment transaction| PAID,NOT-PAID| +| Payment.type| This field indicates the type of the payment. BPP can set this value depending on the phase when they need the order payment to be paid by the buyer| On-Order,Pre-Fulfillment,On-Fulfillment,Post-Fulfillment| +| Quotation.breakup.type| This field indicates the category of the individual breakup object.| Item, Offer, Add-on, Fulfillment| +| Rating.rating_category| Category of the entity being rated| Item,Order,Provider,Fulfillment,Agent,Support| +| Region.dimentions| The number of dimensions that are used to describe any point inside that region. The most common dimensionality of a region is 2, that represents an area on a map.| 1,2,3| +| Scalar.type| NA |CONSTANT,VARIABLE| +| Support.type| This field indicates the type of entity on which support is needed| order,billing,fulfillment| +| Tracking.status| This value indicates if the tracking is currently active or not. If this value is `active`, then the BAP can begin tracking the order. If this value is `inactive`, the tracking URL is considered to be expired and the BAP should stop tracking the order. | ACTIVE,INACTIVE| + +## Contributing to the Enums: +To Contribute to Enums, contributor are requested to submit a PR with updated Enums.md file to the `draft` branch. diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..4957fa4 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,6 @@ +1. [Introduction](./1_Introduction.md) +2. [Terminology](./2_Terminologies.md) +3. [Scope](./3_Scope.md) +4. [Enumerations](./4_Enumerations.md) +5. Implementation Guide + - [Logistics](./implementation-guide/1_Logistics.md) \ No newline at end of file From 9e07ed82fb05d53a7bcd64b8db52774643e1b8a8 Mon Sep 17 00:00:00 2001 From: Rajaneesh Date: Wed, 6 Mar 2024 09:11:52 +0530 Subject: [PATCH 18/26] fixing typos in docs --- docs/1_Introduction.md | 37 ------------------------------------- docs/README.md | 2 +- 2 files changed, 1 insertion(+), 38 deletions(-) diff --git a/docs/1_Introduction.md b/docs/1_Introduction.md index 26d084f..e69de29 100644 --- a/docs/1_Introduction.md +++ b/docs/1_Introduction.md @@ -1,37 +0,0 @@ -# 1. Introduction - -## 1.1 Unifying the local retail through Public Digital Infrastructure - -Local retail offen struggles with limited customer reach. Without an online platform local retail faces challenges in reaching a broader audience, capitalizing on e-commerce trends, and competing with digitally enabled counterparts, hindering potential growth and adaptability in the modern retail landscape. To address these issues, a unifying framework is essential. This article explores the concept of a public digital infrastructure that leverages a common protocol standard known as local-retail. - -## 1.2 Beckn Protocol: A Primer - -The Beckn Protocol serves as a foundational layer for this digital infrastructure. It is an open protocol that allows businesses across any industry to be discovered and engaged by any Beckn-enabled application. The protocol is a collection of open specifications consisting of APIs, message formats, network design, and reference architectures. It enables server-to-server communication, allowing consumer-facing platforms to discover and transact with any business with minimal implementation overhead. The protocol decouples the demand and supply sides, enabling services to be available on any online consumer interface that has mainstream adoption in a city (source). - -## 1.3 Local retail Protocol - -Local Reatil is an adaptation of Beckn Protocol tailored for the retail sector. It provides a set of configurable, extendable, modular open-source digital building blocks. Platforms offering services in retail can implement Local-Retail specification to ensure seamless discovery of opportunities and trust in transactions. - -## 1.4 Key Digital Functionalities of Local-Retail enabled platforms - -1. Discovery: Discovery, browsing of catalogs containing retail items offered by various providers. -1. Ordering: Selecting items from the catalog and doing payment for retail items from any provider. -1. Fulfillment: Manages post-order activities like tracking and status updates during the fulfillment of any of the activities mentioned above. -1. Post-Fulfillment: Handles activities like rating, feedback, support, and issuing of verifiable credentials. - - -## 1.5 Transporting Verifiable Credentials: Enhancing Trust and Reliability - -One of the most transformative aspects of the Beckn Protocol and Local-Retail is the ability to transport verifiable credentials securely. This feature is particularly crucial in retial sector, where the verification of the providers is paramount. By embedding these credentials within the protocol, customers can instantly verify the authenticity of the providers, thereby greatly enhancing the trust and reliability of transactions. - -## 1.6 Benefits of a Unified Digital Infrastructure - -1. Reduced Information Asymmetry: A common protocol allows for standardized information sharing, reducing gaps in knowledge and expectations. -1. Cost-Effective Trust Verification: The protocol's inherent security features minimize the cost of trust verification. -1. Enhanced Discoverability: The infrastructure allows for the seamless discovery of opportunities across multiple platforms. -1. Portability: Users can easily switch between different service providers without losing their data or trust credentials. - -## 1.7 Conclusion - - -Embracing a Local Retail as a public digital infrastructure holds the transformative power to revolutionize the local retail landscape. This scalable, secure, and efficient platform connects stakeholders seamlessly, paving the way for a frictionless exchange in areas such as inventory management, marketing, and supply chain services. By fostering innovation and collaboration, LLocal Retail can turn challenges into opportunities, creating a more equitable, efficient, and effective ecosystem for local businesses, and elevating trust through features like transparent transactions and reliable customer feedback. diff --git a/docs/README.md b/docs/README.md index 4957fa4..1805c70 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,5 +1,5 @@ 1. [Introduction](./1_Introduction.md) -2. [Terminology](./2_Terminologies.md) +2. [Terminology](./2_Terminology.md) 3. [Scope](./3_Scope.md) 4. [Enumerations](./4_Enumerations.md) 5. Implementation Guide From 7aaa9509ed9d4e0c3c8f2d5060b58c972eab1d45 Mon Sep 17 00:00:00 2001 From: Rajaneesh Date: Wed, 6 Mar 2024 11:18:49 +0530 Subject: [PATCH 19/26] Adding a descriotion of the search flow in the implementation guide --- docs/implementation-guide/1_Logistics.md | 33 ++++++++++++++++-------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/docs/implementation-guide/1_Logistics.md b/docs/implementation-guide/1_Logistics.md index cff9876..37f787b 100644 --- a/docs/implementation-guide/1_Logistics.md +++ b/docs/implementation-guide/1_Logistics.md @@ -1,33 +1,44 @@ # 1. Implementation Guide -This document contains the REQUIRED and RECOMMENDED standard functionality that must be implemented by any logistics service provider Platform a.k.a BPPs and logistics Consumer Platform a.k.a BAPs. +This document contains the REQUIRED and RECOMMENDED standard functionality that must be implemented by any logistics service provider platform a.k.a BPPs and logistics Consumer platform a.k.a BAPs. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119]. -## 1.1 Discovery of logistics service providers +Note: The term "BPP" will used to refer to the "logistics service provider platform" and the term "BAP" will be used to refer to the "logistics service consumer platform" from hereon. +A logistics service provider platform can have multiple logistics service providers. -### 1.1.1 Recommendations for BPPs -The following recommendations need to be considered when implementing discovery functionality for a logistics BPP +## 1.1 Discovery of logistics services + +### 1.1.1 Recommendations for Logistics BPPs +The following recommendations need to be considered when implementing discovery functionality for a BPP - REQUIRED. The BPP MUST implement the `search` endpoint to receive an `Intent` object sent by BAPs - REQUIRED. The BPP MUST return a catalog of logistics services on the `on_search` callback endpoint specified in the `context.bap_uri` field of the `search` request body. - REQUIRED. The BPP MUST map its logistics services to the `Item` schema. - REQUIRED. Any logistics service provider related information like name, logo, short description must be mapped to the `Provider.descriptor` schema -- REQUIRED. Any form that must be filled before receiving a quotation must be mapped to the `XInput` schema -- REQUIRED. If the platform wants to group its services under a specific category, it must map each category to the `Category` schema -- REQUIRED. Any order fulfillment-related information MUST be mapped to the `Fulfillment` schema. +- REQUIRED. Any form that must be filled before receiving a quotation on a logistics service must be mapped to the `XInput` schema +- REQUIRED. If the logistics service provider wants to group its services under a specific category, it must map each category to the `Category` schema +- REQUIRED. Any order delivery information MUST be mapped to the `Fulfillment` schema. - REQUIRED. If the BPP does not want to respond to a search request, it MUST return a `ack.status` value equal to `NACK` - RECOMMENDED. Upon receiving a `search` request, the BPP SHOULD return a catalog that best matches the intent. This can be done by indexing the catalog against the various probable paths in the `Intent` schema relevant to typical logistics use cases ### 1.1.2 Recommendations for BAPs -- REQUIRED. The BAP MUST call the `search` endpoint of the BG to discover multiple BPPs on a network -- REQUIRED. The BAP MUST implement the `on_search` endpoint to consume the `Catalog` objects containing logistics services sent by BPPs. -- REQUIRED. The BAP MUST expect multiple catalogs sent by the respective logistics service providers on the network +- REQUIRED. The BAP MUST call the `search` endpoint of the Beckn Gateway(BG) to discover all the BPPs registered on a network +- REQUIRED. The BAP MUST implement the `on_search` endpoint to consume the `Catalog` objects containing logistics services sent by multiple BPPs. +- REQUIRED. The BAP MUST expect multiple catalogs sent by each logistics service providers of a Logistics BPP. - REQUIRED. The logistics services can be found in the `Catalog.providers[].items[]` array in the `on_search` request - REQUIRED. If the `catalog.providers[].items[].xinput` object is present, then the BAP MUST redirect the user to, or natively render the form present on the link specified on the `items[].xinput.form.url` field. - REQUIRED. If the `catalog.providers[].items[].xinput.required` field is set to `"true"` , then the BAP MUST NOT fire a `select`, `init` or `confirm` call until the form is submitted and a successful response is received - RECOMMENDED. If the `catalog.providers[].items[].xinput.required` field is set to `"false"` , then the BAP SHOULD allow the user to skip filling the form +### Discovery Flow of a Logistics service. +Note: This is just one of the many ways to implement the Beckn Logistics specification. The implementors may want to implememt the Beckn Logistics specification as per their need. + +1. A customer looking for logistics services logs in to a logistics app, or a website, and makes a search request by providing the details of the services required, for example, the start and end location of the shipment, the type and weight of the object to be shipped etc. +2. The logistics app forms a search request as per the Beckn logistics specification and sends the request to the Gateway Gateway. A Beckn Gateway is a component in a network where all the BAPs and BPPs register themselves. +3. The Beckn Gateway(BG) broadcast the search request to all the BPPs registered on the Gateway. BG calls the search/ API endpoint implemented by the BPPs to broadcast the messages. +4. The BPPs create a filtered catalogue based on the search request. +5. Each of the BPPs calls the /on_search API endpoint implemented by the BAP to send a the filtered catalogue. ### Example A search request for a logistics service provider may look like this @@ -196,7 +207,7 @@ An example catalog of a logistics service provider may look like this } } ``` - +//TODO ## 1.2 Initiating an order for a logistics service This section provides recommendations for implementing the APIs related to a logistics service. From e21792674e68bf14bc792afc9d8db4f4f5188c70 Mon Sep 17 00:00:00 2001 From: Rajaneesh Date: Wed, 10 Apr 2024 14:22:50 +0530 Subject: [PATCH 20/26] Small tweaks in the implementation guide language --- docs/implementation-guide/1_Logistics.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/implementation-guide/1_Logistics.md b/docs/implementation-guide/1_Logistics.md index 37f787b..755eb3f 100644 --- a/docs/implementation-guide/1_Logistics.md +++ b/docs/implementation-guide/1_Logistics.md @@ -19,7 +19,7 @@ The following recommendations need to be considered when implementing discovery - REQUIRED. Any form that must be filled before receiving a quotation on a logistics service must be mapped to the `XInput` schema - REQUIRED. If the logistics service provider wants to group its services under a specific category, it must map each category to the `Category` schema - REQUIRED. Any order delivery information MUST be mapped to the `Fulfillment` schema. -- REQUIRED. If the BPP does not want to respond to a search request, it MUST return a `ack.status` value equal to `NACK` +- REQUIRED. If the BPP does not want to respond to a search request, it MUST return an acknowledgement with the `ack.status` value equal to `NACK` - RECOMMENDED. Upon receiving a `search` request, the BPP SHOULD return a catalog that best matches the intent. This can be done by indexing the catalog against the various probable paths in the `Intent` schema relevant to typical logistics use cases ### 1.1.2 Recommendations for BAPs @@ -209,14 +209,14 @@ An example catalog of a logistics service provider may look like this ``` //TODO ## 1.2 Initiating an order for a logistics service -This section provides recommendations for implementing the APIs related to a logistics service. +This section provides recommendations for implementing the APIs related to booking a logistics service. ### 1.2.1 Recommendations for BPPs #### 1.2.1.1 Selecting a logistics service from the catalog - REQUIRED. The BPP MUST implement the `select` endpoint on the url specified in the `context.bpp_uri` field sent during `on_search`. In case of permissioned networks, this URL MUST match the `Subscriber.url` present on the respective entry in the Network Registry -- REQUIRED. The BPP MUST check for a form submission at the URL specified on the `xinput.form.url` before acknowledging a `select` request. -- REQUIRED. If the logistics service provider has successfully received the information submitted by the consumer, the BPP must return an acknowledgement with `ack.status` set to `ACK` in response to the `select` request +- OPTIONAL. The BPP MUST check for a form submission at the URL specified on the `xinput.form.url` before acknowledging a `select` request. +- REQUIRED. If the logistics service provider has successfully received the information submitted by the customer, the BPP must return an acknowledgement with `ack.status` set to `ACK` in response to the `select` request - REQUIRED. If the logistics service provider has returned a successful acknowledgement to a `select` request, it MUST send the offer encapsulated in an `Order` object #### 1.2.1.2 Initializing a logistics service order @@ -228,10 +228,12 @@ This section provides recommendations for implementing the APIs related to a log ### 1.2.2 Recommendations for BAPs #### 1.2.1.1 Selecting a logistics service from the catalog -- REQUIRED. The BAP user MUST submit the form on the url received from `on_search` under `xinput.form.url`. - REQUIRED. The BAP MUST implement the `on_select` endpoint on the url specified in the `context.bap_uri` field sent during `select`. In case of permissioned networks, this URL MUST match the `Subscriber.url` present on the respective entry in the Network Registry +- OPTIONAL. The BAP user MUST submit the form at the URL received from `on_search`, if any, under `xinput.form.url`. +- OPTIONAL. The BPP MUST check for a form submission at the URL specified on the `xinput.form.url` before acknowledging a `select` request. #### 1.2.2.2 Initializing a logistics service order +- OPTIONAL. The BAP user MUST submit the form at the URL received from `on_select`, if any, under `xinput.form.url`. - REQUIRED. The BAP MUST hit the `init` endpoint on the url specified in the `context.bpp_uri` field sent during `on_search`. - REQUIRED. The BAP MUST implement the `on_init` endpoint on the url specified in the `context.bap_uri` field sent during `init`. In case of permissioned networks, this URL MUST match the `Subscriber.url` present on the respective entry in the Network Registry @@ -239,7 +241,7 @@ This section provides recommendations for implementing the APIs related to a log - REQUIRED. The BAP MUST hit the `confirm` endpoint on the url specified in the `context.bpp_uri` field sent during `on_search`. - REQUIRED. The BAP MUST implement the `on_confirm` endpoint on the url specified in URL specified in the `context.bap_uri` field sent during `confirm`. In case of permissioned networks, this URL MUST match the `Subscriber.url` present on the respective entry in the Network Registry -### 1.2.3 Example Workflow +### 1.2.3 Example Workflow for Initiating a booking for a logistics service. ### 1.2.3 Example Requests From 4bd62f0a3d05cce860e1858a1525d4afe69eff48 Mon Sep 17 00:00:00 2001 From: Rajaneesh Date: Wed, 10 Apr 2024 15:58:56 +0530 Subject: [PATCH 21/26] Fixing issues with the example JSONs --- examples/cancel/on-cancel.json | 61 ++++--- examples/confirm/confirm.json | 28 +++- examples/confirm/on-confirm.json | 61 ++++--- examples/init/init.json | 24 ++- examples/init/on-init.json | 58 +++++-- examples/search/on-search.json | 25 ++- examples/search/search-by-fulfillment.json | 8 +- examples/select/on-select.json | 35 ++-- examples/select/select.json | 10 +- examples/status/on-status.json | 67 +++++--- examples/status/on-status_In-Transit.json | 185 +++++++++++++++++++++ examples/support/support.json | 1 - examples/update/on-update.json | 59 ++++--- examples/update/update.json | 2 +- 14 files changed, 478 insertions(+), 146 deletions(-) create mode 100644 examples/status/on-status_In-Transit.json diff --git a/examples/cancel/on-cancel.json b/examples/cancel/on-cancel.json index b6e44f4..bcb9281 100644 --- a/examples/cancel/on-cancel.json +++ b/examples/cancel/on-cancel.json @@ -28,18 +28,29 @@ "descriptor": { "name": "Logistics", "short_desc": "Logistics Org", - "long_desc": "Logistics Org" + "long_desc": "Logistics Org", + "images": [ + { + "url": "https://logistics-guru-image.png", + "size_type": "sm" + } + ] }, "locations": [ { "id": "L1", "gps": "13.786587,76.872309", - "address": { - "street": "Shubhash nagar, 3rd block", - "city": "Bengaluru", - "area_code": "560042", - "state": "KA" - } + "address": "Shubhash nagar, 3rd block", + "city": { + "name": "Bengaluru" + }, + "state": { + "name": "Karnataka" + }, + "country": { + "name": "India" + }, + "area_code": "560042" } ] }, @@ -95,7 +106,7 @@ }, "breakup": [ { - "type": "item", + "title": "item price", "item": { "id": "I1" }, @@ -115,8 +126,17 @@ "type": "Pickup", "location": { "gps": "14.785638,76.454553", - "address": { - "area_code": "320042" + "area_code": "320042" + }, + "time": { + "timestamp": "2024-01-15T16:00:00.000Z" + }, + "customer": { + "person": { + "name": "Paul Sterling" + }, + "contact": { + "phone": "+913333333333" } } }, @@ -124,25 +144,28 @@ "type": "Drop", "location": { "gps": "14.433424,77.928379", - "address": { - "area_code": "320042" - } + "area_code": "320042" }, - "time": { - "timestamp": "2024-01-15T16:00:00.000Z" + "customer": { + "person": { + "name": "Anand Ahuja" + }, + "contact": { + "phone": "+914444444444" + } } } ], "state": { "descriptor": { - "code": "Canceled" + "code": "Order-Cancelled" } } } ], "billing": { "name": "Paul Sterling", - "phone": "+919876345623", + "phone": "+913333333333", "email": "sample@gmail.com" }, "payment": { @@ -151,9 +174,7 @@ "params": { "transaction_id": "tid/6737457", "amount": "1500", - "currency": "INR", - "bank_code": "INB0004321", - "bank_account_number": "1234002341" + "currency": "INR" } } } diff --git a/examples/confirm/confirm.json b/examples/confirm/confirm.json index a60e1ff..388738e 100644 --- a/examples/confirm/confirm.json +++ b/examples/confirm/confirm.json @@ -47,20 +47,32 @@ "type": "Pickup", "location": { "gps": "14.785638,76.454553", - "address": { - "area_code": "320042" - } + "area_code": "320042" }, "time": { "timestamp": "2024-01-15T16:00:00.000Z" + }, + "customer": { + "person": { + "name": "Paul Sterling" + }, + "contact": { + "phone": "+913333333333" + } } }, { "type": "Drop", "location": { "gps": "14.433424,77.928379", - "address": { - "area_code": "320042" + "area_code": "320042" + }, + "customer": { + "person": { + "name": "Anand Ahuja" + }, + "contact": { + "phone": "+914444444444" } } } @@ -77,10 +89,8 @@ "type": "PRE-FULFILLMENT", "params": { "transaction_id": "tid/6737457", - "amount": "1500", - "currency": "INR", - "bank_code": "INB0004321", - "bank_account_number": "1234002341" + "amount": "50", + "currency": "INR" } } } diff --git a/examples/confirm/on-confirm.json b/examples/confirm/on-confirm.json index 7c8f007..b8be2e5 100644 --- a/examples/confirm/on-confirm.json +++ b/examples/confirm/on-confirm.json @@ -26,20 +26,31 @@ "provider": { "id": "P1", "descriptor": { - "name": "Logistics", + "name": "Logistics Guru", "short_desc": "Logistics Org", - "long_desc": "Logistics Org" + "long_desc": "Logistics Org", + "images": [ + { + "url": "https://logistics-guru-image.png", + "size_type": "sm" + } + ] }, "locations": [ { "id": "L1", "gps": "13.786587,76.872309", - "address": { - "street": "Shubhash nagar, 3rd block", - "city": "Bengaluru", - "area_code": "560042", - "state": "KA" - } + "address": "Shubhash nagar, 3rd block", + "city": { + "name": "Bengaluru" + }, + "state": { + "name": "Karnataka" + }, + "country": { + "name": "India" + }, + "area_code": "560042" } ] }, @@ -90,7 +101,7 @@ }, "breakup": [ { - "type": "item", + "title": "item price", "item": { "id": "I1" }, @@ -110,34 +121,46 @@ "type": "Pickup", "location": { "gps": "14.785638,76.454553", - "address": { - "area_code": "320042" - } + "area_code": "320042" }, "time": { "timestamp": "2024-01-15T16:00:00.000Z" + }, + "customer": { + "person": { + "name": "Paul Sterling" + }, + "contact": { + "phone": "+913333333333" + } } }, { "type": "Drop", "location": { "gps": "14.433424,77.928379", - "address": { - "area_code": "320042" + "area_code": "320042" + }, + "customer": { + "person": { + "name": "Anand Ahuja" + }, + "contact": { + "phone": "+914444444444" } } } ], "state": { "descriptor": { - "code": "Pending-Fulfillment" + "code": "Order_Initiated" } } } ], "billing": { "name": "Paul Sterling", - "phone": "+919876345623", + "phone": "+913333333333", "email": "sample@gmail.com" }, "payment": { @@ -145,10 +168,8 @@ "type": "PRE-FULFILLMENT", "params": { "transaction_id": "tid/6737457", - "amount": "1500", - "currency": "INR", - "bank_code": "INB0004321", - "bank_account_number": "1234002341" + "amount": "50", + "currency": "INR" } } } diff --git a/examples/init/init.json b/examples/init/init.json index 12d89f2..a2eae40 100644 --- a/examples/init/init.json +++ b/examples/init/init.json @@ -47,20 +47,32 @@ "type": "Pickup", "location": { "gps": "14.785638,76.454553", - "address": { - "area_code": "320042" - } + "area_code": "320042" }, "time": { "timestamp": "2024-01-15T16:00:00.000Z" + }, + "customer": { + "person": { + "name": "Paul Sterling" + }, + "contact": { + "phone": "+913333333333" + } } }, { "type": "Drop", "location": { "gps": "14.433424,77.928379", - "address": { - "area_code": "320042" + "area_code": "320042" + }, + "customer": { + "person": { + "name": "Anand Ahuja" + }, + "contact": { + "phone": "+914444444444" } } } @@ -69,7 +81,7 @@ ], "billing": { "name": "Paul Sterling", - "phone": "+919876345623", + "phone": "+913333333333", "email": "sample@gmail.com" } } diff --git a/examples/init/on-init.json b/examples/init/on-init.json index e1188ba..76d5940 100644 --- a/examples/init/on-init.json +++ b/examples/init/on-init.json @@ -27,18 +27,29 @@ "descriptor": { "name":"Logistics", "short_desc":"Logistics Org", - "long_desc":"Logistics Org" + "long_desc":"Logistics Org", + "images": [ + { + "url": "https://logistics-guru-image.png", + "size_type": "sm" + } + ] }, "locations":[ { "id": "L1", "gps": "13.786587,76.872309", - "address": { - "street": "Shubhash nagar, 3rd block", - "city": "Bengaluru", - "area_code": "560042", - "state": "KA" - } + "address": "Shubhash nagar, 3rd block", + "city": { + "name": "Bengaluru" + }, + "state": { + "name": "Karnataka" + }, + "country": { + "name": "India" + }, + "area_code": "560042" } ] }, @@ -89,7 +100,7 @@ }, "breakup": [ { - "type": "item", + "title": "item price", "item": { "id": "I1" }, @@ -109,20 +120,32 @@ "type": "Pickup", "location": { "gps": "14.785638,76.454553", - "address": { - "area_code": "320042" - } + "area_code": "320042" }, "time": { "timestamp": "2024-01-15T16:00:00.000Z" + }, + "customer": { + "person": { + "name": "Paul Sterling" + }, + "contact": { + "phone": "+913333333333" + } } }, { "type": "Drop", "location": { "gps": "14.433424,77.928379", - "address": { - "area_code": "320042" + "area_code": "320042" + }, + "customer": { + "person": { + "name": "Anand Ahuja" + }, + "contact": { + "phone": "+914444444444" } } } @@ -131,17 +154,16 @@ ], "billing": { "name": "Paul Sterling", - "phone": "+919876345623", + "phone": "+913333333333", "email": "sample@gmail.com" }, "payment": { "status": "NOT-PAID", "type": "PRE-FULFILLMENT", + "url": "https://payment-url-link/pay/secure.html", "params": { - "amount": "1500", - "currency": "INR", - "bank_code": "INB0004321", - "bank_account_number": "1234002341" + "amount": "50", + "currency": "INR" } } } diff --git a/examples/search/on-search.json b/examples/search/on-search.json index 413e3ec..f872a6a 100644 --- a/examples/search/on-search.json +++ b/examples/search/on-search.json @@ -26,21 +26,34 @@ "name":"XYZLogistics" }, "providers": [ - { + { "id":"P1", "descriptor": { - "name":"Logistics", + "name":"Logistics Guru", "short_desc":"Logistics Org", - "long_desc":"Logistics Org" + "long_desc":"Logistics Org", + "images": [ + { + "url": "https://logistics-guru-image.png", + "size_type": "sm" + } + ] }, "locations":[ { "id": "L1", "gps": "13.786587,76.872309", "address": "Shubhash nagar, 3rd block", - "city": "Bengaluru", - "area_code": "560042", - "state": "KA" + "city": { + "name": "Bengaluru" + }, + "state": { + "name": "Karnataka" + }, + "country": { + "name": "India" + }, + "area_code": "560042" } ], "categories": [ diff --git a/examples/search/search-by-fulfillment.json b/examples/search/search-by-fulfillment.json index f8357d2..c35e445 100644 --- a/examples/search/search-by-fulfillment.json +++ b/examples/search/search-by-fulfillment.json @@ -31,18 +31,14 @@ "type": "Pickup", "location": { "gps": "14.785638,76.454553", - "address": { - "area_code": "320042" - } + "area_code": "320042" } }, { "type": "Drop", "location": { "gps": "14.433424,77.928379", - "address": { - "area_code": "540045" - } + "area_code": "540045" } } ] diff --git a/examples/select/on-select.json b/examples/select/on-select.json index 10969ca..6d68acd 100644 --- a/examples/select/on-select.json +++ b/examples/select/on-select.json @@ -27,18 +27,29 @@ "descriptor": { "name":"Logistics", "short_desc":"Logistics Org", - "long_desc":"Logistics Org" + "long_desc":"Logistics Org", + "images": [ + { + "url": "https://logistics-guru-image.png", + "size_type": "sm" + } + ] }, "locations":[ { "id": "L1", "gps": "13.786587,76.872309", - "address": { - "street": "Shubhash nagar, 3rd block", - "city": "Bengaluru", - "area_code": "560042", - "state": "KA" - } + "address": "Shubhash nagar, 3rd block", + "city": { + "name": "Bengaluru" + }, + "state": { + "name": "Karnataka" + }, + "country": { + "name": "India" + }, + "area_code": "560042" } ] }, @@ -90,18 +101,14 @@ "type": "Pickup", "location": { "gps": "14.785638,76.454553", - "address": { - "area_code": "320042" - } + "area_code": "320042" } }, { "type": "Drop", "location": { "gps": "14.433424,77.928379", - "address": { - "area_code": "320042" - } + "area_code": "320042" } } ] @@ -114,7 +121,7 @@ }, "breakup": [ { - "type": "item", + "title": "item price", "item": { "id": "I1" }, diff --git a/examples/select/select.json b/examples/select/select.json index d83f7de..10092d0 100644 --- a/examples/select/select.json +++ b/examples/select/select.json @@ -25,7 +25,7 @@ "provider": { "id": "P1" }, - "items":[ + "items": [ { "id": "I1", "quantity": { @@ -46,18 +46,14 @@ "type": "Pickup", "location": { "gps": "14.785638,76.454553", - "address": { - "area_code": "320042" - } + "area_code": "320042" } }, { "type": "Drop", "location": { "gps": "14.433424,77.928379", - "address": { - "area_code": "320042" - } + "area_code": "320042" } } ] diff --git a/examples/status/on-status.json b/examples/status/on-status.json index acbeb24..8ae0f7d 100644 --- a/examples/status/on-status.json +++ b/examples/status/on-status.json @@ -28,18 +28,29 @@ "descriptor": { "name": "Logistics", "short_desc": "Logistics Org", - "long_desc": "Logistics Org" + "long_desc": "Logistics Org", + "images": [ + { + "url": "https://logistics-guru-image.png", + "size_type": "sm" + } + ] }, "locations": [ { "id": "L1", "gps": "13.786587,76.872309", - "address": { - "street": "Shubhash nagar, 3rd block", - "city": "Bengaluru", - "area_code": "560042", - "state": "KA" - } + "address": "Shubhash nagar, 3rd block", + "city": { + "name": "Bengaluru" + }, + "state": { + "name": "Karnataka" + }, + "country": { + "name": "India" + }, + "area_code": "560042" } ] }, @@ -90,7 +101,7 @@ }, "breakup": [ { - "type": "item", + "title": "item price", "item": { "id": "I1" }, @@ -110,34 +121,54 @@ "type": "Pickup", "location": { "gps": "14.785638,76.454553", - "address": { - "area_code": "320042" - } + "area_code": "320042" }, "time": { "timestamp": "2024-01-15T16:00:00.000Z" + }, + "customer": { + "person": { + "name": "Paul Sterling" + }, + "contact": { + "phone": "+913333333333" + } } }, { "type": "Drop", "location": { "gps": "14.433424,77.928379", - "address": { - "area_code": "320042" + "area_code": "320042" + }, + "customer": { + "person": { + "name": "Anand Ahuja" + }, + "contact": { + "phone": "+914444444444" } } } ], "state": { "descriptor": { - "code": "Shipped" + "code": "Agent-Assigned" + } + }, + "agent": { + "person": { + "name": "Ramesh" + }, + "contact": { + "phone": "+915555555555" } } } ], "billing": { "name": "Paul Sterling", - "phone": "+919876345623", + "phone": "+913333333333", "email": "sample@gmail.com" }, "payment": { @@ -145,10 +176,8 @@ "type": "PRE-FULFILLMENT", "params": { "transaction_id": "tid/6737457", - "amount": "1500", - "currency": "INR", - "bank_code": "INB0004321", - "bank_account_number": "1234002341" + "amount": "50", + "currency": "INR" } } } diff --git a/examples/status/on-status_In-Transit.json b/examples/status/on-status_In-Transit.json new file mode 100644 index 0000000..4816f1a --- /dev/null +++ b/examples/status/on-status_In-Transit.json @@ -0,0 +1,185 @@ +{ + "context": { + "domain": "logistics", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, + "action": "on_status", + "version": "1.1.0", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "order": { + "id": "oid/12", + "provider": { + "id": "P1", + "descriptor": { + "name": "Logistics", + "short_desc": "Logistics Org", + "long_desc": "Logistics Org", + "images": [ + { + "url": "https://logistics-guru-image.png", + "size_type": "sm" + } + ] + }, + "locations": [ + { + "id": "L1", + "gps": "13.786587,76.872309", + "address": "Shubhash nagar, 3rd block", + "city": { + "name": "Bengaluru" + }, + "state": { + "name": "Karnataka" + }, + "country": { + "name": "India" + }, + "area_code": "560042" + } + ] + }, + "items": [ + { + "id": "I1", + "descriptor": { + "Name": "Lightweight delivery", + "short_desc": "Delivery in just 1 hours", + "long_desc": "Delivery in just 1 hours" + }, + "price": { + "currency": "INR", + "value": "starting from 50.0" + }, + "category_ids": [ + "category1" + ], + "tags": [ + { + "descriptor": { + "name": "charges" + }, + "List": [ + { + "descriptor": { + "code": "Min-Chargable-Weight-in-KG" + }, + "value": "10" + } + ] + } + ], + "quantity": { + "selected": { + "count": "5", + "measure": { + "unit": "KG" + } + } + } + } + ], + "quote": { + "price": { + "currency": "INR", + "value": "50" + }, + "breakup": [ + { + "title": "item price", + "item": { + "id": "I1" + }, + "price": { + "currency": "INR", + "value": "50" + } + } + ] + }, + "fulfillments": [ + { + "id": "1", + "type": "Road-Shipping", + "stops": [ + { + "type": "Pickup", + "location": { + "gps": "14.785638,76.454553", + "area_code": "320042" + }, + "time": { + "timestamp": "2024-01-15T16:00:00.000Z" + }, + "customer": { + "person": { + "name": "Paul Sterling" + }, + "contact": { + "phone": "+913333333333" + } + } + }, + { + "type": "Drop", + "location": { + "gps": "14.433424,77.928379", + "area_code": "320042" + }, + "customer": { + "person": { + "name": "Anand Ahuja" + }, + "contact": { + "phone": "+914444444444" + } + } + } + ], + "state": { + "descriptor": { + "code": "In-Transit" + } + }, + "agent": { + "person": { + "name": "Ramesh" + }, + "contact": { + "phone": "+915555555555" + } + } + } + ], + "billing": { + "name": "Paul Sterling", + "phone": "+913333333333", + "email": "sample@gmail.com" + }, + "payment": { + "status": "PAID", + "type": "PRE-FULFILLMENT", + "params": { + "transaction_id": "tid/6737457", + "amount": "50", + "currency": "INR" + } + } + } + } +} \ No newline at end of file diff --git a/examples/support/support.json b/examples/support/support.json index 34c6502..1f3f5ca 100644 --- a/examples/support/support.json +++ b/examples/support/support.json @@ -23,7 +23,6 @@ }, "message": { "support": { - "type": "Order", "ref_id": "oid/12", "callback_phone": "+919876564534" } diff --git a/examples/update/on-update.json b/examples/update/on-update.json index 49a430e..4aa634c 100644 --- a/examples/update/on-update.json +++ b/examples/update/on-update.json @@ -28,18 +28,29 @@ "descriptor": { "name": "Logistics", "short_desc": "Logistics Org", - "long_desc": "Logistics Org" + "long_desc": "Logistics Org", + "images": [ + { + "url": "https://logistics-guru-image.png", + "size_type": "sm" + } + ] }, "locations": [ { "id": "L1", "gps": "13.786587,76.872309", - "address": { - "street": "Shubhash nagar, 3rd block", - "city": "Bengaluru", - "area_code": "560042", - "state": "KA" - } + "address": "Shubhash nagar, 3rd block", + "city": { + "name": "Bengaluru" + }, + "state": { + "name": "Karnataka" + }, + "country": { + "name": "India" + }, + "area_code": "560042" } ] }, @@ -90,7 +101,7 @@ }, "breakup": [ { - "type": "item", + "title": "item price", "item": { "id": "I1" }, @@ -110,34 +121,46 @@ "type": "Pickup", "location": { "gps": "14.785638,76.454553", - "address": { - "area_code": "320042" - } + "area_code": "320042" }, "time": { "timestamp": "2024-01-15T16:00:00.000Z" + }, + "customer": { + "person": { + "name": "Paul Sterling" + }, + "contact": { + "phone": "+913333333333" + } } }, { "type": "Drop", "location": { "gps": "14.433424,77.928379", - "address": { - "area_code": "320042" + "area_code": "320042" + }, + "customer": { + "person": { + "name": "Anand Ahuja" + }, + "contact": { + "phone": "+914444444444" } } } ], "state": { "descriptor": { - "code": "Shipped" + "code": "Order_Initiated" } } } ], "billing": { "name": "Paul Sterling", - "phone": "+919876345623", + "phone": "+913333333333", "email": "sterling@gmail.com" }, "payment": { @@ -145,10 +168,8 @@ "type": "PRE-FULFILLMENT", "params": { "transaction_id": "tid/6737457", - "amount": "1500", - "currency": "INR", - "bank_code": "INB0004321", - "bank_account_number": "1234002341" + "amount": "50", + "currency": "INR" } } } diff --git a/examples/update/update.json b/examples/update/update.json index bdea698..f353d07 100644 --- a/examples/update/update.json +++ b/examples/update/update.json @@ -26,7 +26,7 @@ "order": { "billing": { "name": "Paul Sterling", - "phone": "+919876345623", + "phone": "+913333333333", "email": "sterling@gmail.com" } } From 0ed4c63d182862813fec1ad030f2e0da2c746975 Mon Sep 17 00:00:00 2001 From: Rajaneesh Date: Thu, 11 Apr 2024 16:01:43 +0530 Subject: [PATCH 22/26] adding updated example jsons in the implementation guide --- docs/implementation-guide/1_Logistics.md | 317 +++++++++++++++-------- 1 file changed, 211 insertions(+), 106 deletions(-) diff --git a/docs/implementation-guide/1_Logistics.md b/docs/implementation-guide/1_Logistics.md index 755eb3f..d7052a3 100644 --- a/docs/implementation-guide/1_Logistics.md +++ b/docs/implementation-guide/1_Logistics.md @@ -76,18 +76,14 @@ A search request for a logistics service provider may look like this "type": "Pickup", "location": { "gps": "14.785638,76.454553", - "address": { - "area_code": "320042" - } + "area_code": "320042" } }, { "type": "Drop", "location": { "gps": "14.433424,77.928379", - "address": { - "area_code": "540045" - } + "area_code": "540045" } } ] @@ -127,21 +123,34 @@ An example catalog of a logistics service provider may look like this "name":"XYZLogistics" }, "providers": [ - { + { "id":"P1", "descriptor": { - "name":"Logistics", + "name":"Logistics Guru", "short_desc":"Logistics Org", - "long_desc":"Logistics Org" + "long_desc":"Logistics Org", + "images": [ + { + "url": "https://logistics-guru-image.png", + "size_type": "sm" + } + ] }, "locations":[ { "id": "L1", "gps": "13.786587,76.872309", "address": "Shubhash nagar, 3rd block", - "city": "Bengaluru", - "area_code": "560042", - "state": "KA" + "city": { + "name": "Bengaluru" + }, + "state": { + "name": "Karnataka" + }, + "country": { + "name": "India" + }, + "area_code": "560042" } ], "categories": [ @@ -274,7 +283,7 @@ Below is an example of a `select` request "provider": { "id": "P1" }, - "items":[ + "items": [ { "id": "I1", "quantity": { @@ -295,18 +304,14 @@ Below is an example of a `select` request "type": "Pickup", "location": { "gps": "14.785638,76.454553", - "address": { - "area_code": "320042" - } + "area_code": "320042" } }, { "type": "Drop", "location": { "gps": "14.433424,77.928379", - "address": { - "area_code": "320042" - } + "area_code": "320042" } } ] @@ -348,18 +353,29 @@ Below is an example of an `on_select` callback "descriptor": { "name":"Logistics", "short_desc":"Logistics Org", - "long_desc":"Logistics Org" + "long_desc":"Logistics Org", + "images": [ + { + "url": "https://logistics-guru-image.png", + "size_type": "sm" + } + ] }, "locations":[ { "id": "L1", "gps": "13.786587,76.872309", - "address": { - "street": "Shubhash nagar, 3rd block", - "city": "Bengaluru", - "area_code": "560042", - "state": "KA" - } + "address": "Shubhash nagar, 3rd block", + "city": { + "name": "Bengaluru" + }, + "state": { + "name": "Karnataka" + }, + "country": { + "name": "India" + }, + "area_code": "560042" } ] }, @@ -411,18 +427,14 @@ Below is an example of an `on_select` callback "type": "Pickup", "location": { "gps": "14.785638,76.454553", - "address": { - "area_code": "320042" - } + "area_code": "320042" } }, { "type": "Drop", "location": { "gps": "14.433424,77.928379", - "address": { - "area_code": "320042" - } + "area_code": "320042" } } ] @@ -435,7 +447,7 @@ Below is an example of an `on_select` callback }, "breakup": [ { - "type": "item", + "title": "item price", "item": { "id": "I1" }, @@ -503,20 +515,32 @@ Below is an example of a `init` request "type": "Pickup", "location": { "gps": "14.785638,76.454553", - "address": { - "area_code": "320042" - } + "area_code": "320042" }, "time": { "timestamp": "2024-01-15T16:00:00.000Z" + }, + "customer": { + "person": { + "name": "Paul Sterling" + }, + "contact": { + "phone": "+913333333333" + } } }, { "type": "Drop", "location": { "gps": "14.433424,77.928379", - "address": { - "area_code": "320042" + "area_code": "320042" + }, + "customer": { + "person": { + "name": "Anand Ahuja" + }, + "contact": { + "phone": "+914444444444" } } } @@ -525,7 +549,7 @@ Below is an example of a `init` request ], "billing": { "name": "Paul Sterling", - "phone": "+919876345623", + "phone": "+913333333333", "email": "sample@gmail.com" } } @@ -564,18 +588,29 @@ Below is an example of an `on_init` callback "descriptor": { "name":"Logistics", "short_desc":"Logistics Org", - "long_desc":"Logistics Org" + "long_desc":"Logistics Org", + "images": [ + { + "url": "https://logistics-guru-image.png", + "size_type": "sm" + } + ] }, "locations":[ { "id": "L1", "gps": "13.786587,76.872309", - "address": { - "street": "Shubhash nagar, 3rd block", - "city": "Bengaluru", - "area_code": "560042", - "state": "KA" - } + "address": "Shubhash nagar, 3rd block", + "city": { + "name": "Bengaluru" + }, + "state": { + "name": "Karnataka" + }, + "country": { + "name": "India" + }, + "area_code": "560042" } ] }, @@ -626,7 +661,7 @@ Below is an example of an `on_init` callback }, "breakup": [ { - "type": "item", + "title": "item price", "item": { "id": "I1" }, @@ -646,20 +681,32 @@ Below is an example of an `on_init` callback "type": "Pickup", "location": { "gps": "14.785638,76.454553", - "address": { - "area_code": "320042" - } + "area_code": "320042" }, "time": { "timestamp": "2024-01-15T16:00:00.000Z" + }, + "customer": { + "person": { + "name": "Paul Sterling" + }, + "contact": { + "phone": "+913333333333" + } } }, { "type": "Drop", "location": { "gps": "14.433424,77.928379", - "address": { - "area_code": "320042" + "area_code": "320042" + }, + "customer": { + "person": { + "name": "Anand Ahuja" + }, + "contact": { + "phone": "+914444444444" } } } @@ -668,17 +715,16 @@ Below is an example of an `on_init` callback ], "billing": { "name": "Paul Sterling", - "phone": "+919876345623", + "phone": "+913333333333", "email": "sample@gmail.com" }, "payment": { "status": "NOT-PAID", "type": "PRE-FULFILLMENT", + "url": "https://payment-url-link/pay/secure.html", "params": { - "amount": "1500", - "currency": "INR", - "bank_code": "INB0004321", - "bank_account_number": "1234002341" + "amount": "50", + "currency": "INR" } } } @@ -737,20 +783,32 @@ Below is an example of a `confirm` request "type": "Pickup", "location": { "gps": "14.785638,76.454553", - "address": { - "area_code": "320042" - } + "area_code": "320042" }, "time": { "timestamp": "2024-01-15T16:00:00.000Z" + }, + "customer": { + "person": { + "name": "Paul Sterling" + }, + "contact": { + "phone": "+913333333333" + } } }, { "type": "Drop", "location": { "gps": "14.433424,77.928379", - "address": { - "area_code": "320042" + "area_code": "320042" + }, + "customer": { + "person": { + "name": "Anand Ahuja" + }, + "contact": { + "phone": "+914444444444" } } } @@ -767,10 +825,8 @@ Below is an example of a `confirm` request "type": "PRE-FULFILLMENT", "params": { "transaction_id": "tid/6737457", - "amount": "1500", - "currency": "INR", - "bank_code": "INB0004321", - "bank_account_number": "1234002341" + "amount": "50", + "currency": "INR" } } } @@ -807,20 +863,31 @@ Below is an example of an `on_confirm` callback "provider": { "id": "P1", "descriptor": { - "name": "Logistics", + "name": "Logistics Guru", "short_desc": "Logistics Org", - "long_desc": "Logistics Org" + "long_desc": "Logistics Org", + "images": [ + { + "url": "https://logistics-guru-image.png", + "size_type": "sm" + } + ] }, "locations": [ { "id": "L1", "gps": "13.786587,76.872309", - "address": { - "street": "Shubhash nagar, 3rd block", - "city": "Bengaluru", - "area_code": "560042", - "state": "KA" - } + "address": "Shubhash nagar, 3rd block", + "city": { + "name": "Bengaluru" + }, + "state": { + "name": "Karnataka" + }, + "country": { + "name": "India" + }, + "area_code": "560042" } ] }, @@ -871,7 +938,7 @@ Below is an example of an `on_confirm` callback }, "breakup": [ { - "type": "item", + "title": "item price", "item": { "id": "I1" }, @@ -891,34 +958,46 @@ Below is an example of an `on_confirm` callback "type": "Pickup", "location": { "gps": "14.785638,76.454553", - "address": { - "area_code": "320042" - } + "area_code": "320042" }, "time": { "timestamp": "2024-01-15T16:00:00.000Z" + }, + "customer": { + "person": { + "name": "Paul Sterling" + }, + "contact": { + "phone": "+913333333333" + } } }, { "type": "Drop", "location": { "gps": "14.433424,77.928379", - "address": { - "area_code": "320042" + "area_code": "320042" + }, + "customer": { + "person": { + "name": "Anand Ahuja" + }, + "contact": { + "phone": "+914444444444" } } } ], "state": { "descriptor": { - "code": "Pending-Fulfillment" + "code": "Order_Initiated" } } } ], "billing": { "name": "Paul Sterling", - "phone": "+919876345623", + "phone": "+913333333333", "email": "sample@gmail.com" }, "payment": { @@ -926,10 +1005,8 @@ Below is an example of an `on_confirm` callback "type": "PRE-FULFILLMENT", "params": { "transaction_id": "tid/6737457", - "amount": "1500", - "currency": "INR", - "bank_code": "INB0004321", - "bank_account_number": "1234002341" + "amount": "50", + "currency": "INR" } } } @@ -1037,18 +1114,29 @@ Below is an example of an `on_status` callback "descriptor": { "name": "Logistics", "short_desc": "Logistics Org", - "long_desc": "Logistics Org" + "long_desc": "Logistics Org", + "images": [ + { + "url": "https://logistics-guru-image.png", + "size_type": "sm" + } + ] }, "locations": [ { "id": "L1", "gps": "13.786587,76.872309", - "address": { - "street": "Shubhash nagar, 3rd block", - "city": "Bengaluru", - "area_code": "560042", - "state": "KA" - } + "address": "Shubhash nagar, 3rd block", + "city": { + "name": "Bengaluru" + }, + "state": { + "name": "Karnataka" + }, + "country": { + "name": "India" + }, + "area_code": "560042" } ] }, @@ -1099,7 +1187,7 @@ Below is an example of an `on_status` callback }, "breakup": [ { - "type": "item", + "title": "item price", "item": { "id": "I1" }, @@ -1119,34 +1207,54 @@ Below is an example of an `on_status` callback "type": "Pickup", "location": { "gps": "14.785638,76.454553", - "address": { - "area_code": "320042" - } + "area_code": "320042" }, "time": { "timestamp": "2024-01-15T16:00:00.000Z" + }, + "customer": { + "person": { + "name": "Paul Sterling" + }, + "contact": { + "phone": "+913333333333" + } } }, { "type": "Drop", "location": { "gps": "14.433424,77.928379", - "address": { - "area_code": "320042" + "area_code": "320042" + }, + "customer": { + "person": { + "name": "Anand Ahuja" + }, + "contact": { + "phone": "+914444444444" } } } ], "state": { "descriptor": { - "code": "Shipped" + "code": "In-Transit" + } + }, + "agent": { + "person": { + "name": "Ramesh" + }, + "contact": { + "phone": "+915555555555" } } } ], "billing": { "name": "Paul Sterling", - "phone": "+919876345623", + "phone": "+913333333333", "email": "sample@gmail.com" }, "payment": { @@ -1154,10 +1262,8 @@ Below is an example of an `on_status` callback "type": "PRE-FULFILLMENT", "params": { "transaction_id": "tid/6737457", - "amount": "1500", - "currency": "INR", - "bank_code": "INB0004321", - "bank_account_number": "1234002341" + "amount": "50", + "currency": "INR" } } } @@ -1353,7 +1459,6 @@ Below is an example of a `support` request }, "message": { "support": { - "type": "Order", "ref_id": "oid/12", "callback_phone": "+919876564534" } From b022cfef5aa180a2c892517d89a82df6d328657a Mon Sep 17 00:00:00 2001 From: Rajaneesh Date: Thu, 11 Apr 2024 17:20:04 +0530 Subject: [PATCH 23/26] Adding the example workflows for service discovery, service initialisation, service fulfillment and post fulfillment stages --- docs/implementation-guide/1_Logistics.md | 528 ++++++++++++++++++++++- 1 file changed, 523 insertions(+), 5 deletions(-) diff --git a/docs/implementation-guide/1_Logistics.md b/docs/implementation-guide/1_Logistics.md index d7052a3..9ef74de 100644 --- a/docs/implementation-guide/1_Logistics.md +++ b/docs/implementation-guide/1_Logistics.md @@ -31,14 +31,14 @@ The following recommendations need to be considered when implementing discovery - REQUIRED. If the `catalog.providers[].items[].xinput.required` field is set to `"true"` , then the BAP MUST NOT fire a `select`, `init` or `confirm` call until the form is submitted and a successful response is received - RECOMMENDED. If the `catalog.providers[].items[].xinput.required` field is set to `"false"` , then the BAP SHOULD allow the user to skip filling the form -### Discovery Flow of a Logistics service. +### Example Workflow of the Discovery Process for a Logistics Service. Note: This is just one of the many ways to implement the Beckn Logistics specification. The implementors may want to implememt the Beckn Logistics specification as per their need. 1. A customer looking for logistics services logs in to a logistics app, or a website, and makes a search request by providing the details of the services required, for example, the start and end location of the shipment, the type and weight of the object to be shipped etc. -2. The logistics app forms a search request as per the Beckn logistics specification and sends the request to the Gateway Gateway. A Beckn Gateway is a component in a network where all the BAPs and BPPs register themselves. +2. The logistics app forms a search request as per the Beckn logistics specification and sends the request to the Beckn Gateway. A Beckn Gateway is a component in a network where all the BAPs and BPPs register themselves. 3. The Beckn Gateway(BG) broadcast the search request to all the BPPs registered on the Gateway. BG calls the search/ API endpoint implemented by the BPPs to broadcast the messages. 4. The BPPs create a filtered catalogue based on the search request. -5. Each of the BPPs calls the /on_search API endpoint implemented by the BAP to send a the filtered catalogue. +5. Each of the BPPs calls the /on_search API endpoint implemented by the BAP to send a the filtered catalogue to the BAP. ### Example A search request for a logistics service provider may look like this @@ -236,6 +236,7 @@ This section provides recommendations for implementing the APIs related to booki ### 1.2.2 Recommendations for BAPs + #### 1.2.1.1 Selecting a logistics service from the catalog - REQUIRED. The BAP MUST implement the `on_select` endpoint on the url specified in the `context.bap_uri` field sent during `select`. In case of permissioned networks, this URL MUST match the `Subscriber.url` present on the respective entry in the Network Registry - OPTIONAL. The BAP user MUST submit the form at the URL received from `on_search`, if any, under `xinput.form.url`. @@ -252,6 +253,13 @@ This section provides recommendations for implementing the APIs related to booki ### 1.2.3 Example Workflow for Initiating a booking for a logistics service. +1. The customer selects a service from the catalogue, triggering the BAP to generate a select request. This request includes details of the service provider, the chosen service, and the preferred type of fulfillment. Subsequently, the select request is directly forwarded to the BPP. +2. Upon receiving the select request, the BPP processes the information and promptly responds to the BAP, furnishing details of the selected service along with a corresponding quote. This exchange occurs within the on_select callback mechanism. +3. With the service details provided, the customer proceeds to fill in pertinent fulfillment information, encompassing delivery address, shipping preferences, and other relevant data. Subsequently, the BAP initiates a request to the BPP, conveying the fulfillment and billing particulars. +4. Upon receipt of the fulfillment and billing information, the BPP engages in processing the request and invokes the on_init API. This API encapsulates essential payment details, such as the payable amount and, if applicable, a payment URL. +5. Once the customer completes the payment process, the BAP triggers the confirm API of the BPP, transmitting the associated payment transaction ID. +6. The BPP, upon receiving the confirm request, proceeds to process the transaction and invokes the on_confirm API. Within this callback, the BAP is furnished with an order ID, indicating the successful placement of the order. + ### 1.2.3 Example Requests Below is an example of a `select` request @@ -1047,7 +1055,12 @@ This section contains recommendations for implementing the APIs related to fulfi #### 1.3.2.4 Real-time tracking - REQUIRED. The BAP MUST implement the `on_track` endpoint on the url specified in URL specified in the `context.bap_uri` field sent during `track`. In case of permissioned networks, this URL MUST match the `Subscriber.url` present on the respective entry in the Network Registry -### 1.3.3 Example Workflow +### 1.3.3 Example Workflow for fulfillment of a logistics order + +1. The BAP offers the option to receive regular unsolicited status updates from the BPP for confirmed orders. Upon order confirmation, the BPP triggers the /on_status callback URL of the BAP to deliver updates. Furthermore, the BAP can proactively request status updates from the BPP by calling the /status endpoint. The BPP responds by sending the status information via the /on_status callback after receiving the /status call. +2. To update order details, the BAP can utilize the /update endpoint of the BPP. Upon updating, the BPP triggers the /on_update endpoint of the BAP, providing the latest order details. +3. For order delivery location tracking, the BAP can invoke the /track endpoint of the BPP. The BPP, in turn, employs the on_track callback endpoint of the BAP to furnish a URL for tracking the delivery location. +4. Should the need arise to cancel an active order, the BAP can call the /cancel endpoint of the BPP. Subsequently, the BPP sends the order details post-cancellation to the /on_cancel callback endpoint of the BAP. ### 1.3.4 Example Requests @@ -1271,6 +1284,508 @@ Below is an example of an `on_status` callback } ``` +Below is an example of a `update` request +``` + +{ + "context": { + "domain": "logistics", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, + "action": "update", + "version": "1.1.0", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "update_target": "order.billing", + "order": { + "billing": { + "name": "Paul Sterling", + "phone": "+913333333333", + "email": "sterling@gmail.com" + } + } + } +} +``` + +Below is an example of a `on_update` callback +``` +{ + "context": { + "domain": "logistics", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, + "action": "on_update", + "version": "1.1.0", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "order": { + "id": "oid/12", + "provider": { + "id": "P1", + "descriptor": { + "name": "Logistics", + "short_desc": "Logistics Org", + "long_desc": "Logistics Org", + "images": [ + { + "url": "https://logistics-guru-image.png", + "size_type": "sm" + } + ] + }, + "locations": [ + { + "id": "L1", + "gps": "13.786587,76.872309", + "address": "Shubhash nagar, 3rd block", + "city": { + "name": "Bengaluru" + }, + "state": { + "name": "Karnataka" + }, + "country": { + "name": "India" + }, + "area_code": "560042" + } + ] + }, + "items": [ + { + "id": "I1", + "descriptor": { + "Name": "Lightweight delivery", + "short_desc": "Delivery in just 1 hours", + "long_desc": "Delivery in just 1 hours" + }, + "price": { + "currency": "INR", + "value": "starting from 50.0" + }, + "category_ids": [ + "category1" + ], + "tags": [ + { + "descriptor": { + "name": "charges" + }, + "List": [ + { + "descriptor": { + "code": "Min-Chargable-Weight-in-KG" + }, + "value": "10" + } + ] + } + ], + "quantity": { + "selected": { + "count": "5", + "measure": { + "unit": "KG" + } + } + } + } + ], + "quote": { + "price": { + "currency": "INR", + "value": "50" + }, + "breakup": [ + { + "title": "item price", + "item": { + "id": "I1" + }, + "price": { + "currency": "INR", + "value": "50" + } + } + ] + }, + "fulfillments": [ + { + "id": "1", + "type": "Road-Shipping", + "stops": [ + { + "type": "Pickup", + "location": { + "gps": "14.785638,76.454553", + "area_code": "320042" + }, + "time": { + "timestamp": "2024-01-15T16:00:00.000Z" + }, + "customer": { + "person": { + "name": "Paul Sterling" + }, + "contact": { + "phone": "+913333333333" + } + } + }, + { + "type": "Drop", + "location": { + "gps": "14.433424,77.928379", + "area_code": "320042" + }, + "customer": { + "person": { + "name": "Anand Ahuja" + }, + "contact": { + "phone": "+914444444444" + } + } + } + ], + "state": { + "descriptor": { + "code": "Order_Initiated" + } + } + } + ], + "billing": { + "name": "Paul Sterling", + "phone": "+913333333333", + "email": "sterling@gmail.com" + }, + "payment": { + "status": "PAID", + "type": "PRE-FULFILLMENT", + "params": { + "transaction_id": "tid/6737457", + "amount": "50", + "currency": "INR" + } + } + } + } +} +``` + +Below is an example of a `track` request +``` + +{ + "context": { + "domain": "logistics", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, + "action": "track", + "version": "1.1.0", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "order_id": "oid/12" + } +} +``` + +Below is an example of a `on_track` callback +``` + +{ + "context": { + "domain": "logistics", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, + "action": "on_track", + "version": "1.1.0", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "tracking": { + "url": "https://sample/tracking/url", + "status": "active" + } + } +} +``` + +Below is an example of a `cancel` request +``` + +{ + "context": { + "domain": "logistics", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, + "action": "cancel", + "version": "1.1.0", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "order_id": "oid/12", + "cancellation_reason_id": "3" + } +} +``` + +Below is an example of a `on_cancel` callback +``` +{ + "context": { + "domain": "logistics", + "location": { + "country": { + "code": "IND" + }, + "city": { + "code": "std:0806" + } + }, + "action": "on_cancel", + "version": "1.1.0", + "bap_id": "logistics_bap", + "bap_uri": "https://logistics_bap.com", + "bpp_id": "logistics_bpp", + "bpp_uri": "https://logistics_bpp.com", + "transaction_id": "aa77b78e-66b0-47a5-9560-527a36cf0d9f", + "message_id": "9d498536-4dba-4c69-a47e-bed245623ecc", + "timestamp": "2024-01-15T16:00:00.000Z", + "ttl": "PT30S" + }, + "message": { + "order": { + "id": "oid/12", + "provider": { + "id": "P1", + "descriptor": { + "name": "Logistics", + "short_desc": "Logistics Org", + "long_desc": "Logistics Org", + "images": [ + { + "url": "https://logistics-guru-image.png", + "size_type": "sm" + } + ] + }, + "locations": [ + { + "id": "L1", + "gps": "13.786587,76.872309", + "address": "Shubhash nagar, 3rd block", + "city": { + "name": "Bengaluru" + }, + "state": { + "name": "Karnataka" + }, + "country": { + "name": "India" + }, + "area_code": "560042" + } + ] + }, + "items": [ + { + "id": "I1", + "descriptor": { + "Name": "Lightweight delivery", + "short_desc": "Delivery in just 1 hours", + "long_desc": "Delivery in just 1 hours" + }, + "price": { + "currency": "INR", + "value": "50.0" + }, + "category_ids": [ + "category1" + ], + "time": { + "duration": "PT60M", + "timestamp": "2024-01-14T16: 00: 00.000Z" + }, + "tags": [ + { + "descriptor": { + "name": "charges" + }, + "List": [ + { + "descriptor": { + "code": "Min-Chargable-Weight-in-KG" + }, + "value": "10" + } + ] + } + ], + "quantity": { + "selected": { + "count": "1", + "measure": { + "unit": "KG", + "value": "1" + } + } + } + } + ], + "quote": { + "price": { + "currency": "INR", + "value": "50" + }, + "breakup": [ + { + "title": "item price", + "item": { + "id": "I1" + }, + "price": { + "currency": "INR", + "value": "50" + } + } + ] + }, + "fulfillments": [ + { + "id": "1", + "type": "Road-Shipping", + "stops": [ + { + "type": "Pickup", + "location": { + "gps": "14.785638,76.454553", + "area_code": "320042" + }, + "time": { + "timestamp": "2024-01-15T16:00:00.000Z" + }, + "customer": { + "person": { + "name": "Paul Sterling" + }, + "contact": { + "phone": "+913333333333" + } + } + }, + { + "type": "Drop", + "location": { + "gps": "14.433424,77.928379", + "area_code": "320042" + }, + "customer": { + "person": { + "name": "Anand Ahuja" + }, + "contact": { + "phone": "+914444444444" + } + } + } + ], + "state": { + "descriptor": { + "code": "Order-Cancelled" + } + } + } + ], + "billing": { + "name": "Paul Sterling", + "phone": "+913333333333", + "email": "sample@gmail.com" + }, + "payment": { + "status": "PAID", + "type": "PRE-FULFILLMENT", + "params": { + "transaction_id": "tid/6737457", + "amount": "1500", + "currency": "INR" + } + } + } + } +} +``` + ## 1.4 Post-fulfillment of logistics order This section contains recommendations for implementing the APIs after fulfilling a logistics order @@ -1292,7 +1807,10 @@ This section contains recommendations for implementing the APIs after fulfilling #### 1.4.2.2 Providing Support - REQUIRED. The BAP MUST implement the `on_support` endpoint on the url specified in URL specified in the `context.bap_uri` field sent during `support`. In case of permissioned networks, this URL MUST match the `Subscriber.url` present on the respective entry in the Network Registry -### 1.4.3 Example Workflow +### 1.4.3 Example Workflow for Accessing Post-Fulfillment Services in Logistics + +1. Customers have the option to provide ratings for various aspects such as Item, Order, Fulfillment, Provider, Agent, or Support. The BAP can initiate this process by calling the /rating endpoint of the BPP, enabling users to select a rating category (such as Item, Order, Fulfillment, Provider, Agent, or Support) and provide a corresponding rating value. +2. Customers can easily reach out to the customer support team by invoking the /support endpoint through the BAP. Upon this request, the BPP responds by triggering the /on_support callback, providing essential contact information such as helpline numbers or email addresses for customer support assistance. ### 1.4.4 Example Requests From f751d6ee7542aefce68ca34b68102465da036a61 Mon Sep 17 00:00:00 2001 From: Rajaneesh Date: Thu, 30 May 2024 12:53:39 +0530 Subject: [PATCH 24/26] adding layer2 config --- api/l2-config/logistics_delivery_1.1.0.yaml | 2257 +++++++++++++++++++ 1 file changed, 2257 insertions(+) create mode 100644 api/l2-config/logistics_delivery_1.1.0.yaml diff --git a/api/l2-config/logistics_delivery_1.1.0.yaml b/api/l2-config/logistics_delivery_1.1.0.yaml new file mode 100644 index 0000000..52b10ba --- /dev/null +++ b/api/l2-config/logistics_delivery_1.1.0.yaml @@ -0,0 +1,2257 @@ +openapi: 3.0.0 +info: + title: Beckn Logistics API specification + description: The Beckn Logistics API Specification outlines the technical standards and protocols for integrating logistics services into the Beckn network. + version: 1.1.0 +security: + - SubscriberAuth: [] +paths: + /search: + post: + tags: + - Beckn Provider Platform (BPP) + - Beckn Gateway (BG) + description: BAP declares the customer's intent + requestBody: + content: + application/json: + schema: + type: object + properties: + context: + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - search + message: + type: object + properties: + intent: + $ref: '#/components/schemas/Intent' + required: + - context + - message + responses: + default: + $ref: '#/paths/~1init/post/responses/default' + /select: + post: + tags: + - Beckn Provider Platform (BPP) + description: BAP declares the customer's cart (or equivalent) created by selecting objects from the catalog + requestBody: + content: + application/json: + schema: + type: object + properties: + context: + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - select + required: + - action + required: + - bpp_id + - bpp_uri + message: + type: object + properties: + order: + $ref: '#/components/schemas/Order' + required: + - order + required: + - context + - message + responses: + default: + $ref: '#/paths/~1init/post/responses/default' + /init: + post: + tags: + - Beckn Provider Platform (BPP) + description: Initialize an order by providing billing and/or shipping details + requestBody: + content: + application/json: + schema: + type: object + properties: + context: + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - init + required: + - bpp_id + - bpp_uri + message: + type: object + properties: + order: + $ref: '#/components/schemas/Order' + required: + - order + required: + - context + - message + responses: + default: + description: Acknowledgement of message received after successful validation of schema and signature + content: + application/json: + schema: + type: object + properties: + message: + type: object + properties: + ack: + allOf: + - $ref: '#/components/schemas/Ack' + - properties: + status: + enum: + - ACK + - NACK + required: + - ack + error: + $ref: '#/components/schemas/Error' + required: + - message + /confirm: + post: + tags: + - Beckn Provider Platform (BPP) + description: Initialize an order by providing billing and/or shipping details + requestBody: + content: + application/json: + schema: + type: object + properties: + context: + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - confirm + required: + - bpp_id + - bpp_uri + message: + type: object + properties: + order: + $ref: '#/components/schemas/Order' + required: + - order + required: + - context + - message + responses: + default: + $ref: '#/paths/~1init/post/responses/default' + /status: + post: + tags: + - Beckn Provider Platform (BPP) + description: Fetch the latest order object + requestBody: + content: + application/json: + schema: + type: object + properties: + context: + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - status + required: + - bpp_id + - bpp_uri + message: + type: object + properties: + order_id: + $ref: '#/components/schemas/Order/properties/id' + required: + - order_id + required: + - context + - message + responses: + default: + $ref: '#/paths/~1init/post/responses/default' + /track: + post: + tags: + - Beckn Provider Platform (BPP) + description: Track an active order + requestBody: + content: + application/json: + schema: + type: object + properties: + context: + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - track + required: + - bpp_id + - bpp_uri + message: + type: object + properties: + order_id: + $ref: '#/components/schemas/Order/properties/id' + callback_url: + type: string + format: uri + required: + - order_id + required: + - context + - message + responses: + default: + $ref: '#/paths/~1init/post/responses/default' + /cancel: + post: + tags: + - Beckn Provider Platform (BPP) + description: Cancel an order + requestBody: + content: + application/json: + schema: + type: object + properties: + context: + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - cancel + required: + - bpp_id + - bpp_uri + message: + type: object + properties: + order_id: + $ref: '#/components/schemas/Order/properties/id' + cancellation_reason_id: + $ref: '#/components/schemas/Option/properties/id' + descriptor: + $ref: '#/components/schemas/Descriptor' + required: + - order_id + required: + - context + - message + responses: + default: + $ref: '#/paths/~1init/post/responses/default' + /update: + post: + tags: + - Beckn Provider Platform (BPP) + description: Remove object + requestBody: + content: + application/json: + schema: + type: object + properties: + context: + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - update + required: + - bpp_id + - bpp_uri + message: + type: object + properties: + update_target: + description: 'Comma separated values of order objects being updated. For example: ```"update_target":"item,billing,fulfillment"```' + type: string + order: + description: Updated order object + allOf: + - $ref: '#/components/schemas/Order' + required: + - update_target + - order + required: + - context + - message + responses: + default: + $ref: '#/paths/~1init/post/responses/default' + /rating: + post: + tags: + - Beckn Provider Platform (BPP) + description: Provide feedback on a service + requestBody: + content: + application/json: + schema: + type: object + properties: + context: + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - rating + required: + - bpp_id + - bpp_uri + message: + type: object + properties: + ratings: + type: array + items: + $ref: '#/components/schemas/Rating' + required: + - context + - message + responses: + default: + $ref: '#/paths/~1init/post/responses/default' + /support: + post: + tags: + - Beckn Provider Platform (BPP) + description: Contact support + requestBody: + content: + application/json: + schema: + type: object + properties: + context: + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - support + required: + - bpp_id + - bpp_uri + message: + type: object + properties: + support: + $ref: '#/components/schemas/Support' + required: + - context + - message + responses: + default: + $ref: '#/paths/~1init/post/responses/default' + /on_search: + post: + tags: + - Beckn Application Platform (BAP) + - Beckn Gateway (BG) + description: BPP sends its catalog in response to a search request. + requestBody: + content: + application/json: + schema: + type: object + properties: + context: + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - on_search + required: + - bpp_id + - bpp_uri + message: + type: object + properties: + catalog: + $ref: '#/components/schemas/Catalog' + required: + - catalog + error: + $ref: '#/components/schemas/Error' + required: + - context + responses: + default: + $ref: '#/paths/~1init/post/responses/default' + /on_select: + post: + tags: + - Beckn Application Platform (BAP) + description: Send draft order object with quoted price for selected items + requestBody: + content: + application/json: + schema: + type: object + properties: + context: + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - on_select + required: + - bpp_id + - bpp_uri + message: + type: object + properties: + order: + $ref: '#/components/schemas/Order' + error: + $ref: '#/components/schemas/Error' + required: + - context + responses: + default: + $ref: '#/paths/~1init/post/responses/default' + /on_init: + post: + tags: + - Beckn Application Platform (BAP) + description: Send order object with payment details updated + requestBody: + content: + application/json: + schema: + type: object + properties: + context: + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - on_init + required: + - bpp_id + - bpp_uri + message: + type: object + properties: + order: + $ref: '#/components/schemas/Order' + required: + - order + error: + $ref: '#/components/schemas/Error' + required: + - context + responses: + default: + $ref: '#/paths/~1init/post/responses/default' + /on_confirm: + post: + tags: + - Beckn Application Platform (BAP) + description: Send active order object + requestBody: + content: + application/json: + schema: + type: object + properties: + context: + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - on_confirm + required: + - bpp_id + - bpp_uri + message: + type: object + properties: + order: + $ref: '#/components/schemas/Order' + required: + - order + error: + $ref: '#/components/schemas/Error' + required: + - context + responses: + default: + $ref: '#/paths/~1init/post/responses/default' + /on_track: + post: + tags: + - Beckn Application Platform (BAP) + description: Send tracking details of an active order + requestBody: + content: + application/json: + schema: + type: object + properties: + context: + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - on_track + required: + - bpp_id + - bpp_uri + message: + type: object + properties: + tracking: + $ref: '#/components/schemas/Tracking' + required: + - tracking + error: + $ref: '#/components/schemas/Error' + required: + - context + responses: + default: + $ref: '#/paths/~1init/post/responses/default' + /on_cancel: + post: + tags: + - Beckn Application Platform (BAP) + description: Send cancellation request_id with reasons list in case of cancellation request. Else send cancelled order object + requestBody: + content: + application/json: + schema: + type: object + properties: + context: + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - on_cancel + required: + - bpp_id + - bpp_uri + message: + type: object + properties: + order: + $ref: '#/components/schemas/Order' + required: + - order + error: + $ref: '#/components/schemas/Error' + required: + - context + responses: + default: + $ref: '#/paths/~1init/post/responses/default' + /on_update: + post: + tags: + - Beckn Application Platform (BAP) + description: Returns updated service with updated runtime object + requestBody: + content: + application/json: + schema: + type: object + properties: + context: + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - on_update + required: + - bpp_id + - bpp_uri + message: + type: object + properties: + order: + $ref: '#/components/schemas/Order' + required: + - order + error: + $ref: '#/components/schemas/Error' + required: + - context + responses: + default: + $ref: '#/paths/~1init/post/responses/default' + /on_status: + post: + tags: + - Beckn Application Platform (BAP) + description: Fetch the status of a Service + requestBody: + content: + application/json: + schema: + type: object + properties: + context: + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - on_status + required: + - bpp_id + - bpp_uri + message: + type: object + properties: + order: + $ref: '#/components/schemas/Order' + required: + - order + error: + $ref: '#/components/schemas/Error' + required: + - context + responses: + default: + $ref: '#/paths/~1init/post/responses/default' + /on_rating: + post: + tags: + - Beckn Application Platform (BAP) + description: Provide feedback on a service + requestBody: + content: + application/json: + schema: + type: object + properties: + context: + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - on_rating + required: + - bpp_id + - bpp_uri + message: + type: object + properties: + feedback_form: + description: A feedback form to allow the user to provide additional information on the rating provided + allOf: + - $ref: '#/components/schemas/XInput' + error: + $ref: '#/components/schemas/Error' + required: + - context + - message + responses: + default: + $ref: '#/paths/~1init/post/responses/default' + /on_support: + post: + tags: + - Beckn Application Platform (BAP) + description: Contact Support + requestBody: + content: + application/json: + schema: + type: object + properties: + context: + allOf: + - $ref: '#/components/schemas/Context' + - properties: + action: + enum: + - on_support + required: + - bpp_id + - bpp_uri + message: + type: object + properties: + support: + $ref: '#/components/schemas/Support' + error: + $ref: '#/components/schemas/Error' + required: + - context + responses: + default: + $ref: '#/paths/~1init/post/responses/default' +components: + securitySchemes: + SubscriberAuth: + type: apiKey + in: header + name: Authorization + description: 'Signature of message body using BAP or BPP subscriber''s signing public key.

Format:

Authorization : Signature keyId="{subscriber_id}|{unique_key_id}|{algorithm}",algorithm="ed25519",created="1606970629",expires="1607030629",headers="(created) (expires) digest",signature="Base64(signing string)"' + schemas: + Ack: + description: 'Describes the acknowledgement sent in response to an API call. If the implementation uses HTTP/S, then Ack must be returned in the same session. Every API call to a BPP must be responded to with an Ack whether the BPP intends to respond with a callback or not. This has one property called `status` that indicates the status of the Acknowledgement.' + type: object + properties: + status: + type: string + description: 'The status of the acknowledgement. If the request passes the validation criteria of the BPP, then this is set to ACK. If a BPP responds with status = `ACK` to a request, it is required to respond with a callback. If the request fails the validation criteria, then this is set to NACK. Additionally, if a BPP does not intend to respond with a callback even after the request meets the validation criteria, it should set this value to `NACK`.' + enum: + - ACK + - NACK + tags: + description: A list of tags containing any additional information sent along with the Acknowledgement. + type: array + items: + $ref: '#/components/schemas/TagGroup' + AddOn: + description: Describes an additional item offered as a value-addition to a product or service. This does not exist independently in a catalog and is always associated with an item. + type: object + properties: + id: + description: Provider-defined ID of the add-on + type: string + descriptor: + $ref: '#/components/schemas/Descriptor' + price: + $ref: '#/components/schemas/Price' + Address: + description: Describes a postal address. + type: string + Agent: + description: 'Describes the direct performer, driver or executor that fulfills an order. It is usually a person. But in some rare cases, it could be a non-living entity like a drone, or a bot. Some examples of agents are Doctor in the healthcare sector, a driver in the mobility sector, or a delivery person in the logistics sector. This object can be set at any stage of the order lifecycle. This can be set at the discovery stage when the BPP wants to provide details on the agent fulfilling the order, like in healthcare, where the doctor''s name appears during search. This object can also used to search for a particular person that the customer wants fulfilling an order. Sometimes, this object gets instantiated after the order is confirmed, like in the case of on-demand taxis, where the driver is assigned after the user confirms the ride.' + properties: + person: + $ref: '#/components/schemas/Person' + contact: + $ref: '#/components/schemas/Contact' + organization: + $ref: '#/components/schemas/Organization' + rating: + $ref: '#/components/schemas/Rating/properties/value' + Authorization: + description: 'Describes an authorization mechanism used to start or end the fulfillment of an order. For example, in the mobility sector, the driver may require a one-time password to initiate the ride. In the healthcare sector, a patient may need to provide a password to open a video conference link during a teleconsultation.' + type: object + properties: + type: + description: Type of authorization mechanism used. The allowed values for this field can be published as part of the network policy. + type: string + token: + description: 'Token used for authorization. This is typically generated at the BPP. The BAP can send this value to the user via any channel that it uses to authenticate the user like SMS, Email, Push notification, or in-app rendering.' + type: string + valid_from: + description: Timestamp in RFC3339 format from which token is valid + type: string + format: date-time + valid_to: + description: Timestamp in RFC3339 format until which token is valid + type: string + format: date-time + status: + description: Status of the token + type: string + Billing: + description: 'Describes the billing details of an entity.
This has properties like name,organization,address,email,phone,time,tax_number, created_at,updated_at' + type: object + properties: + name: + description: Name of the billable entity + type: string + organization: + description: Details of the organization being billed. + allOf: + - $ref: '#/components/schemas/Organization' + address: + description: The address of the billable entity + allOf: + - $ref: '#/components/schemas/Address' + state: + description: The state where the billable entity resides. This is important for state-level tax calculation + allOf: + - $ref: '#/components/schemas/State' + city: + description: The city where the billable entity resides. + allOf: + - $ref: '#/components/schemas/City' + email: + description: Email address where the bill is sent to + type: string + format: email + phone: + description: Phone number of the billable entity + type: string + time: + description: Details regarding the billing period + allOf: + - $ref: '#/components/schemas/Time' + tax_id: + description: ID of the billable entity as recognized by the taxation authority + type: string + Cancellation: + description: Describes a cancellation event + type: object + properties: + time: + description: Date-time when the order was cancelled by the buyer + type: string + format: date-time + cancelled_by: + type: string + enum: + - CONSUMER + - PROVIDER + reason: + description: The reason for cancellation + allOf: + - $ref: '#/components/schemas/Option' + additional_description: + description: Any additional information regarding the nature of cancellation + allOf: + - $ref: '#/components/schemas/Descriptor' + CancellationTerm: + description: Describes the cancellation terms of an item or an order. This can be referenced at an item or order level. Item-level cancellation terms can override the terms at the order level. + type: object + properties: + fulfillment_state: + description: The state of fulfillment during which this term is applicable. + allOf: + - $ref: '#/components/schemas/FulfillmentState' + reason_required: + description: Indicates whether a reason is required to cancel the order + type: boolean + cancel_by: + description: Information related to the time of cancellation. + allOf: + - $ref: '#/components/schemas/Time' + cancellation_fee: + $ref: '#/components/schemas/Fee' + xinput: + $ref: '#/components/schemas/XInput' + external_ref: + $ref: '#/components/schemas/MediaFile' + Catalog: + description: 'Describes the products or services offered by a BPP. This is typically sent as the response to a search intent from a BAP. The payment terms, offers and terms of fulfillment supported by the BPP can also be included here. The BPP can show hierarchical nature of products/services in its catalog using the parent_category_id in categories. The BPP can also send a ttl (time to live) in the context which is the duration for which a BAP can cache the catalog and use the cached catalog.
This has properties like bbp/descriptor,bbp/categories,bbp/fulfillments,bbp/payments,bbp/offers,bbp/providers and exp
This is used in the following situations.
  • This is typically used in the discovery stage when the BPP sends the details of the products and services it offers as response to a search intent from the BAP.
' + type: object + properties: + descriptor: + $ref: '#/components/schemas/Descriptor' + fulfillments: + description: Fulfillment modes offered at the BPP level. This is used when a BPP itself offers fulfillments on behalf of the providers it has onboarded. + type: array + items: + $ref: '#/components/schemas/Fulfillment' + payments: + description: Payment terms offered by the BPP for all transactions. This can be overriden at the provider level. + type: array + items: + $ref: '#/components/schemas/Payment' + offers: + description: Offers at the BPP-level. This is common across all providers onboarded by the BPP. + type: array + items: + $ref: '#/components/schemas/Offer' + providers: + type: array + items: + $ref: '#/components/schemas/Provider' + exp: + description: Timestamp after which catalog will expire + type: string + format: date-time + ttl: + description: Duration in seconds after which this catalog will expire + type: string + Category: + description: A label under which a collection of items can be grouped. + type: object + properties: + id: + description: ID of the category + type: string + parent_category_id: + $ref: '#/components/schemas/Category/properties/id' + descriptor: + $ref: '#/components/schemas/Descriptor' + time: + $ref: '#/components/schemas/Time' + ttl: + description: Time to live for an instance of this schema + tags: + type: array + items: + $ref: '#/components/schemas/TagGroup' + Circle: + description: Describes a circular region of a specified radius centered at a specified GPS coordinate. + type: object + properties: + gps: + $ref: '#/components/schemas/Gps' + radius: + $ref: '#/components/schemas/Scalar' + City: + description: Describes a city + type: object + properties: + name: + description: Name of the city + type: string + code: + description: City code + type: string + Contact: + description: Describes the contact information of an entity + type: object + properties: + phone: + type: string + email: + type: string + jcard: + type: object + description: A Jcard object as per draft-ietf-jcardcal-jcard-03 specification + Context: + description: 'Every API call in beckn protocol has a context. It provides a high-level overview to the receiver about the nature of the intended transaction. Typically, it is the BAP that sets the transaction context based on the consumer''s location and action on their UI. But sometimes, during unsolicited callbacks, the BPP also sets the transaction context but it is usually the same as the context of a previous full-cycle, request-callback interaction between the BAP and the BPP. The context object contains four types of fields.
  1. Demographic information about the transaction using fields like `domain`, `country`, and `region`.
  2. Addressing details like the sending and receiving platform''s ID and API URL.
  3. Interoperability information like the protocol version that implemented by the sender and,
  4. Transaction details like the method being called at the receiver''s endpoint, the transaction_id that represents an end-to-end user session at the BAP, a message ID to pair requests with callbacks, a timestamp to capture sending times, a ttl to specifiy the validity of the request, and a key to encrypt information if necessary.
This object must be passed in every interaction between a BAP and a BPP. In HTTP/S implementations, it is not necessary to send the context during the synchronous response. However, in asynchronous protocols, the context must be sent during all interactions,' + type: object + properties: + domain: + description: Domain code that is relevant to this transaction context + allOf: + - $ref: '#/components/schemas/Domain/properties/code' + location: + description: The location where the transaction is intended to be fulfilled. + allOf: + - $ref: '#/components/schemas/Location' + action: + description: The Beckn protocol method being called by the sender and executed at the receiver. + type: string + version: + type: string + description: Version of transaction protocol being used by the sender. + bap_id: + description: Subscriber ID of the BAP + allOf: + - description: 'A globally unique identifier of the platform, Typically it is the fully qualified domain name (FQDN) of the platform.' + type: string + bap_uri: + description: Subscriber URL of the BAP for accepting callbacks from BPPs. + allOf: + - description: The callback URL of the Subscriber. This should necessarily contain the same domain name as set in `subscriber_id``. + type: string + format: uri + bpp_id: + description: Subscriber ID of the BPP + allOf: + - $ref: '#/components/schemas/Context/properties/bap_id/allOf/0' + bpp_uri: + description: Subscriber URL of the BPP for accepting calls from BAPs. + allOf: + - $ref: '#/components/schemas/Context/properties/bap_uri/allOf/0' + transaction_id: + description: 'This is a unique value which persists across all API calls from `search` through `confirm`. This is done to indicate an active user session across multiple requests. The BPPs can use this value to push personalized recommendations, and dynamic offerings related to an ongoing transaction despite being unaware of the user active on the BAP.' + type: string + format: uuid + message_id: + description: 'This is a unique value which persists during a request / callback cycle. Since beckn protocol APIs are asynchronous, BAPs need a common value to match an incoming callback from a BPP to an earlier call. This value can also be used to ignore duplicate messages coming from the BPP. It is recommended to generate a fresh message_id for every new interaction. When sending unsolicited callbacks, BPPs must generate a new message_id.' + type: string + format: uuid + timestamp: + description: Time of request generation in RFC3339 format + type: string + format: date-time + key: + description: The encryption public key of the sender + type: string + ttl: + description: The duration in ISO8601 format after timestamp for which this message holds valid + type: string + required: + - action + - domain + - version + - bap_id + - bap_uri + - transaction_id + - message_id + Country: + description: Describes a country + type: object + properties: + name: + type: string + description: Name of the country + code: + type: string + description: Country code as per ISO 3166-1 and ISO 3166-2 format + Credential: + description: Describes a credential of an entity - Person or Organization + type: object + properties: + id: + type: string + type: + type: string + default: VerifiableCredential + url: + description: URL of the credential + type: string + format: uri + Customer: + description: Describes a customer buying/availing a product or a service + type: object + properties: + person: + $ref: '#/components/schemas/Person' + contact: + $ref: '#/components/schemas/Contact' + DecimalValue: + description: Describes a numerical value in decimal form + type: string + pattern: '[+-]?([0-9]*[.])?[0-9]+' + Descriptor: + description: Physical description of something. + type: object + properties: + name: + type: string + code: + type: string + short_desc: + type: string + long_desc: + type: string + additional_desc: + type: object + properties: + url: + type: string + content_type: + type: string + enum: + - text/plain + - text/html + - application/json + media: + type: array + items: + $ref: '#/components/schemas/MediaFile' + images: + type: array + items: + $ref: '#/components/schemas/Image' + Domain: + description: 'Described the industry sector or sub-sector. The network policy should contain codes for all the industry sectors supported by the network. Domains can be created in varying levels of granularity. The granularity of a domain can be decided by the participants of the network. Too broad domains will result in irrelevant search broadcast calls to BPPs that don''t have services supporting the domain. Too narrow domains will result in a large number of registry entries for each BPP. It is recommended that network facilitators actively collaborate with various working groups and network participants to carefully choose domain codes keeping in mind relevance, performance, and opportunity cost. It is recommended that networks choose broad domains like mobility, logistics, healthcare etc, and progressively granularize them as and when the number of network participants for each domain grows large.' + type: object + properties: + name: + description: Name of the domain + type: string + code: + description: 'Standard code representing the domain. The standard is usually published as part of the network policy. Furthermore, the network facilitator should also provide a mechanism to provide the supported domains of a network.' + type: string + enum: + - logistics:delivery + additional_info: + description: A url that contains addtional information about that domain. + allOf: + - $ref: '#/components/schemas/MediaFile' + Duration: + description: Describes duration as per ISO8601 format + type: string + Error: + description: 'Describes an error object that is returned by a BAP, BPP or BG as a response or callback to an action by another network participant. This object is sent when any request received by a network participant is unacceptable. This object can be sent either during Ack or with the callback.' + type: object + properties: + type: + type: string + enum: + - CONTEXT-ERROR + - CORE-ERROR + - DOMAIN-ERROR + - POLICY-ERROR + - JSON_SCHEMA-ERROR + code: + type: string + description: 'Standard error code. For full list of error codes, refer to docs/protocol-drafts/BECKN-005-ERROR-CODES-DRAFT-01.md of this repo"' + paths: + type: string + description: Path to json schema generating the error. Used only during json schema validation errors + message: + type: string + description: Human readable message describing the error. Used mainly for logging. Not recommended to be shown to the user. + Fee: + description: A fee applied on a particular entity + type: object + properties: + percentage: + description: Percentage of a value + allOf: + - $ref: '#/components/schemas/DecimalValue' + amount: + description: A fixed value + allOf: + - $ref: '#/components/schemas/Price' + Form: + description: Describes a form + type: object + properties: + url: + description: 'The URL from where the form can be fetched. The content fetched from the url must be processed as per the mime_type specified in this object. Once fetched, the rendering platform can choosed to render the form as-is as an embeddable element; or process it further to blend with the theme of the application. In case the interface is non-visual, the the render can process the form data and reproduce it as per the standard specified in the form.' + type: string + format: uri + data: + description: The form submission data + type: object + additionalProperties: + type: string + mime_type: + description: This field indicates the nature and format of the form received by querying the url. MIME types are defined and standardized in IETF's RFC 6838. + type: string + enum: + - text/html + - application/xml + submission_id: + type: string + format: uuid + Fulfillment: + description: Describes how a an order will be rendered/fulfilled to the end-customer + type: object + properties: + id: + description: Unique reference ID to the fulfillment of an order + type: string + type: + description: 'A code that describes the mode of fulfillment. This is typically set when there are multiple ways an order can be fulfilled.' + type: string + enum: + - Air-Shipping + - Ocean-Shipping + - Road-Shipping + - Rail-Shipping + rateable: + description: Whether the fulfillment can be rated or not + type: boolean + rating: + description: The rating value of the fulfullment service. + allOf: + - $ref: '#/components/schemas/Rating/properties/value' + state: + description: The current state of fulfillment. The BPP must set this value whenever the state of the order fulfillment changes and fire an unsolicited `on_status` call. + allOf: + - $ref: '#/components/schemas/FulfillmentState' + tracking: + type: boolean + description: Indicates whether the fulfillment allows tracking + default: false + customer: + description: The person that will ultimately receive the order + allOf: + - $ref: '#/components/schemas/Customer' + agent: + description: The agent that is currently handling the fulfillment of the order + allOf: + - $ref: '#/components/schemas/Agent' + contact: + $ref: '#/components/schemas/Contact' + vehicle: + $ref: '#/components/schemas/Vehicle' + stops: + description: The list of logical stops encountered during the fulfillment of an order. + type: array + items: + $ref: '#/components/schemas/Stop' + path: + description: The physical path taken by the agent that can be rendered on a map. The allowed format of this property can be set by the network. + type: string + tags: + type: array + items: + $ref: '#/components/schemas/TagGroup' + FulfillmentState: + description: Describes the state of fulfillment + type: object + properties: + descriptor: + $ref: '#/components/schemas/FulfillmentDescriptor' + updated_at: + type: string + format: date-time + updated_by: + type: string + description: ID of entity which changed the state + FulfillmentDescriptor: + description: Description of fulfillment . + type: object + properties: + name: + type: string + code: + type: string + enum: + - Pending-Fulfillment + - Packing + - Picking + - Shipped + - Out-for-Delivery + - Delivered + - Failed-Fulfillment + - Canceled + - Returned + short_desc: + type: string + long_desc: + type: string + additional_desc: + type: object + properties: + url: + type: string + content_type: + type: string + enum: + - text/plain + - text/html + - application/json + Gps: + description: Describes a GPS coordinate + type: string + pattern: '^[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?),\s*[-+]?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?)$' + Image: + description: Describes an image + type: object + properties: + url: + description: URL to the image. This can be a data url or an remote url + type: string + format: uri + size_type: + description: The size of the image. The network policy can define the default dimensions of each type + type: string + enum: + - xs + - sm + - md + - lg + - xl + - custom + width: + description: Width of the image in pixels + type: string + height: + description: Height of the image in pixels + type: string + Intent: + description: 'The intent to buy or avail a product or a service. The BAP can declare the intent of the consumer containing
  • What they want (A product, service, offer)
  • Who they want (A seller, service provider, agent etc)
  • Where they want it and where they want it from
  • When they want it (start and end time of fulfillment
  • How they want to pay for it

This has properties like descriptor,provider,fulfillment,payment,category,offer,item,tags
This is typically used by the BAP to send the purpose of the user''s search to the BPP. This will be used by the BPP to find products or services it offers that may match the user''s intent.
For example, in Mobility, the mobility consumer declares a mobility intent. In this case, the mobility consumer declares information that describes various aspects of their journey like,
  • Where would they like to begin their journey (intent.fulfillment.start.location)
  • Where would they like to end their journey (intent.fulfillment.end.location)
  • When would they like to begin their journey (intent.fulfillment.start.time)
  • When would they like to end their journey (intent.fulfillment.end.time)
  • Who is the transport service provider they would like to avail services from (intent.provider)
  • Who is traveling (This is not recommended in public networks) (intent.fulfillment.customer)
  • What kind of fare product would they like to purchase (intent.item)
  • What add-on services would they like to avail
  • What offers would they like to apply on their booking (intent.offer)
  • What category of services would they like to avail (intent.category)
  • What additional luggage are they carrying
  • How would they like to pay for their journey (intent.payment)

For example, in health domain, a consumer declares the intent for a lab booking the describes various aspects of their booking like,
  • Where would they like to get their scan/test done (intent.fulfillment.start.location)
  • When would they like to get their scan/test done (intent.fulfillment.start.time)
  • When would they like to get the results of their test/scan (intent.fulfillment.end.time)
  • Who is the service provider they would like to avail services from (intent.provider)
  • Who is getting the test/scan (intent.fulfillment.customer)
  • What kind of test/scan would they like to purchase (intent.item)
  • What category of services would they like to avail (intent.category)
  • How would they like to pay for their journey (intent.payment)
' + type: object + properties: + descriptor: + description: 'A raw description of the search intent. Free text search strings, raw audio, etc can be sent in this object.' + allOf: + - $ref: '#/components/schemas/Descriptor' + provider: + description: The provider from which the customer wants to place to the order from + allOf: + - $ref: '#/components/schemas/Provider' + fulfillment: + description: Details on how the customer wants their order fulfilled + allOf: + - $ref: '#/components/schemas/Fulfillment' + payment: + description: Details on how the customer wants to pay for the order + allOf: + - $ref: '#/components/schemas/Payment' + category: + description: Details on the item category + allOf: + - $ref: '#/components/schemas/Category' + offer: + description: details on the offer the customer wants to avail + allOf: + - $ref: '#/components/schemas/Offer' + item: + description: Details of the item that the consumer wants to order + allOf: + - $ref: '#/components/schemas/Item' + tags: + type: array + items: + $ref: '#/components/schemas/TagGroup' + ItemQuantity: + description: Describes the count or amount of an item + type: object + properties: + allocated: + description: This represents the exact quantity allocated for purchase of the item. + type: object + properties: + count: + type: integer + minimum: 0 + measure: + $ref: '#/components/schemas/Scalar' + available: + description: This represents the exact quantity available for purchase of the item. The buyer can only purchase multiples of this + type: object + properties: + count: + type: integer + minimum: 0 + measure: + $ref: '#/components/schemas/Scalar' + maximum: + description: This represents the maximum quantity allowed for purchase of the item + type: object + properties: + count: + type: integer + minimum: 1 + measure: + $ref: '#/components/schemas/Scalar' + minimum: + description: This represents the minimum quantity allowed for purchase of the item + type: object + properties: + count: + type: integer + minimum: 0 + measure: + $ref: '#/components/schemas/Scalar' + selected: + description: This represents the quantity selected for purchase of the item + type: object + properties: + count: + type: integer + minimum: 0 + measure: + $ref: '#/components/schemas/Scalar' + unitized: + description: This represents the quantity available in a single unit of the item + type: object + properties: + count: + type: integer + minimum: 1 + maximum: 1 + measure: + $ref: '#/components/schemas/Scalar' + Item: + description: 'Describes a product or a service offered to the end consumer by the provider.' + type: object + properties: + id: + description: ID of the item. + type: string + parent_item_id: + description: 'ID of the item, this item is a variant of' + allOf: + - $ref: '#/components/schemas/Item/properties/id' + parent_item_quantity: + description: The number of units of the parent item this item is a multiple of + allOf: + - $ref: '#/components/schemas/ItemQuantity' + descriptor: + description: Physical description of the item + allOf: + - $ref: '#/components/schemas/Descriptor' + creator: + description: The creator of this item + allOf: + - $ref: '#/components/schemas/Organization' + price: + description: 'The price of this item, if it has intrinsic value' + allOf: + - $ref: '#/components/schemas/Price' + quantity: + description: The selling quantity of the item + allOf: + - $ref: '#/components/schemas/ItemQuantity' + category_ids: + description: Categories this item can be listed under + type: array + items: + allOf: + - $ref: '#/components/schemas/Category/properties/id' + fulfillment_ids: + description: Modes through which this item can be fulfilled + type: array + items: + allOf: + - $ref: '#/components/schemas/Fulfillment/properties/id' + location_ids: + description: Provider Locations this item is available in + type: array + items: + allOf: + - $ref: '#/components/schemas/Location/properties/id' + payment_ids: + description: Payment modalities through which this item can be ordered + type: array + items: + allOf: + - $ref: '#/components/schemas/Payment/properties/id' + add_ons: + type: array + items: + $ref: '#/components/schemas/AddOn' + cancellation_terms: + description: Cancellation terms of this item + type: array + items: + $ref: '#/components/schemas/CancellationTerm' + refund_terms: + description: Refund terms of this item + type: array + items: + description: Refund term of an item or an order + type: object + properties: + fulfillment_state: + description: The state of fulfillment during which this term is applicable. + allOf: + - $ref: '#/components/schemas/State' + refund_eligible: + description: Indicates if cancellation will result in a refund + type: boolean + refund_within: + description: Time within which refund will be processed after successful cancellation. + allOf: + - $ref: '#/components/schemas/Time' + refund_amount: + $ref: '#/components/schemas/Price' + replacement_terms: + description: Terms that are applicable be met when this item is replaced + type: array + items: + $ref: '#/components/schemas/ReplacementTerm' + return_terms: + description: Terms that are applicable when this item is returned + type: array + items: + $ref: '#/components/schemas/ReturnTerm' + xinput: + description: Additional input required from the customer to purchase / avail this item + allOf: + - $ref: '#/components/schemas/XInput' + time: + description: Temporal attributes of this item. This property is used when the item exists on the catalog only for a limited period of time. + allOf: + - $ref: '#/components/schemas/Time' + rateable: + description: Whether this item can be rated + type: boolean + rating: + description: The rating of the item + allOf: + - $ref: '#/components/schemas/Rating/properties/value' + matched: + description: Whether this item is an exact match of the request + type: boolean + related: + description: Whether this item is a related item to the exactly matched item + type: boolean + recommended: + description: Whether this item is a recommended item to a response + type: boolean + ttl: + description: Time to live in seconds for an instance of this schema + type: string + tags: + type: array + items: + $ref: '#/components/schemas/TagGroup' + Location: + description: The physical location of something + type: object + properties: + id: + type: string + descriptor: + $ref: '#/components/schemas/Descriptor' + map_url: + description: The url to the map of the location. This can be a globally recognized map url or the one specified by the network policy. + type: string + format: uri + gps: + description: The GPS co-ordinates of this location. + allOf: + - $ref: '#/components/schemas/Gps' + address: + description: The address of this location. + allOf: + - $ref: '#/components/schemas/Address' + city: + description: 'The city this location is, or is located within' + allOf: + - $ref: '#/components/schemas/City' + district: + description: 'The state this location is, or is located within' + type: string + state: + description: 'The state this location is, or is located within' + allOf: + - $ref: '#/components/schemas/State' + country: + description: 'The country this location is, or is located within' + allOf: + - $ref: '#/components/schemas/Country' + area_code: + type: string + circle: + $ref: '#/components/schemas/Circle' + polygon: + description: The boundary polygon of this location + type: string + 3dspace: + description: The three dimensional region describing this location + type: string + rating: + description: The rating of this location + allOf: + - $ref: '#/components/schemas/Rating/properties/value' + MediaFile: + description: This object contains a url to a media file. + type: object + properties: + mimetype: + description: 'indicates the nature and format of the document, file, or assortment of bytes. MIME types are defined and standardized in IETF''s RFC 6838' + type: string + url: + description: The URL of the file + type: string + format: uri + signature: + description: The digital signature of the file signed by the sender + type: string + dsa: + description: The signing algorithm used by the sender + type: string + Offer: + description: An offer associated with a catalog. This is typically used to promote a particular product and enable more purchases. + type: object + properties: + id: + type: string + descriptor: + $ref: '#/components/schemas/Descriptor' + location_ids: + type: array + items: + $ref: '#/components/schemas/Location/properties/id' + category_ids: + type: array + items: + $ref: '#/components/schemas/Category/properties/id' + item_ids: + type: array + items: + $ref: '#/components/schemas/Item/properties/id' + time: + $ref: '#/components/schemas/Time' + tags: + type: array + items: + $ref: '#/components/schemas/TagGroup' + Option: + description: Describes a selectable option + type: object + properties: + id: + type: string + descriptor: + $ref: '#/components/schemas/Descriptor' + Order: + description: Describes a legal purchase order. It contains the complete details of the legal contract created between the buyer and the seller. + type: object + properties: + id: + type: string + description: Human-readable ID of the order. This is generated at the BPP layer. The BPP can either generate order id within its system or forward the order ID created at the provider level. + ref_order_ids: + description: A list of order IDs to link this order to previous orders. + type: array + items: + type: string + description: ID of a previous order + status: + description: Status of the order. Allowed values can be defined by the network policy + type: string + enum: + - Initiated + - Acknowledged + - Packed + - Shipped + - Delivered + - Cancelled + type: + description: 'This is used to indicate the type of order being created to BPPs.' + type: string + default: DEFAULT + enum: + - DRAFT + - DEFAULT + provider: + description: Details of the provider whose catalog items have been selected. + allOf: + - $ref: '#/components/schemas/Provider' + items: + description: The items purchased / availed in this order + type: array + items: + $ref: '#/components/schemas/Item' + add_ons: + description: The add-ons purchased / availed in this order + type: array + items: + $ref: '#/components/schemas/AddOn' + offers: + description: The offers applied in this order + type: array + items: + $ref: '#/components/schemas/Offer' + billing: + description: The billing details of this order + allOf: + - $ref: '#/components/schemas/Billing' + fulfillments: + description: The fulfillments involved in completing this order + type: array + items: + $ref: '#/components/schemas/Fulfillment' + cancellation: + description: The cancellation details of this order + allOf: + - $ref: '#/components/schemas/Cancellation' + cancellation_terms: + description: Cancellation terms of this item + type: array + items: + $ref: '#/components/schemas/CancellationTerm' + refund_terms: + description: Refund terms of this item + type: array + items: + $ref: '#/components/schemas/Item/properties/refund_terms/items' + replacement_terms: + description: Replacement terms of this item + type: array + items: + $ref: '#/components/schemas/ReplacementTerm' + return_terms: + description: Return terms of this item + type: array + items: + $ref: '#/components/schemas/ReturnTerm' + quote: + description: The mutually agreed upon quotation for this order. + allOf: + - $ref: '#/components/schemas/Quotation' + payments: + description: The terms of settlement for this order + type: array + items: + $ref: '#/components/schemas/Payment' + created_at: + description: The date-time of creation of this order + type: string + format: date-time + updated_at: + description: The date-time of updated of this order + type: string + format: date-time + xinput: + description: Additional input required from the customer to confirm this order + allOf: + - $ref: '#/components/schemas/XInput' + tags: + type: array + items: + $ref: '#/components/schemas/TagGroup' + Organization: + description: An organization. Usually a recognized business entity. + type: object + properties: + descriptor: + $ref: '#/components/schemas/Descriptor' + address: + description: The postal address of the organization + allOf: + - $ref: '#/components/schemas/Address' + state: + description: The state where the organization's address is registered + allOf: + - $ref: '#/components/schemas/State' + city: + description: The city where the the organization's address is registered + allOf: + - $ref: '#/components/schemas/City' + contact: + $ref: '#/components/schemas/Contact' + Payment: + description: 'Describes the terms of settlement between the BAP and the BPP for a single transaction. When instantiated, this object contains
  1. the amount that has to be settled,
  2. The payment destination destination details
  3. When the settlement should happen, and
  4. A transaction reference ID
. During a transaction, the BPP reserves the right to decide the terms of payment. However, the BAP can send its terms to the BPP first. If the BPP does not agree to those terms, it must overwrite the terms and return them to the BAP. If overridden, the BAP must either agree to the terms sent by the BPP in order to preserve the provider''s autonomy, or abort the transaction. In case of such disagreements, the BAP and the BPP can perform offline negotiations on the payment terms. Once an agreement is reached, the BAP and BPP can resume transactions.' + type: object + properties: + id: + description: ID of the payment term that can be referred at an item or an order level in a catalog + type: string + collected_by: + description: 'This field indicates who is the collector of payment. The BAP can set this value to ''bap'' if it wants to collect the payment first and settle it to the BPP. If the BPP agrees to those terms, the BPP should not send the payment url. Alternatively, the BPP can set this field with the value ''bpp'' if it wants the payment to be made directly.' + type: string + enum: + - BAP + - BPP + url: + type: string + description: 'A payment url to be called by the BAP. If empty, then the payment is to be done offline. The details of payment should be present in the params object. If tl_method = http/get, then the payment details will be sent as url params. Two url param values, ```$transaction_id``` and ```$amount``` are mandatory.' + format: uri + params: + type: object + properties: + transaction_id: + type: string + description: The reference transaction ID associated with a payment activity + amount: + type: string + currency: + type: string + bank_code: + type: string + bank_account_number: + type: string + virtual_payment_address: + type: string + source_bank_code: + type: string + source_bank_account_number: + type: string + source_virtual_payment_address: + type: string + type: + type: string + enum: + - PRE-ORDER + - PRE-FULFILLMENT + - ON-FULFILLMENT + - POST-FULFILLMENT + status: + type: string + enum: + - PAID + - NOT-PAID + time: + $ref: '#/components/schemas/Time' + tags: + type: array + items: + $ref: '#/components/schemas/TagGroup' + Person: + description: Describes a person as any individual + type: object + properties: + id: + type: string + description: Describes the identity of the person + url: + description: Profile url of the person + type: string + format: uri + name: + description: the name of the person + type: string + image: + $ref: '#/components/schemas/Image' + age: + description: Age of the person + allOf: + - $ref: '#/components/schemas/Duration' + dob: + description: Date of birth of the person + type: string + format: date + gender: + type: string + description: 'Gender of something, typically a Person, but possibly also fictional characters, animals, etc. While Male and Female may be used, text strings are also acceptable for people who do not identify as a binary gender.Allowed values for this field can be published in the network policy' + creds: + type: array + items: + $ref: '#/components/schemas/Credential' + languages: + type: array + items: + description: Describes a language known to the person. + type: object + properties: + code: + type: string + name: + type: string + skills: + type: array + items: + description: Describes a skill of the person. + type: object + properties: + code: + type: string + name: + type: string + tags: + type: array + items: + $ref: '#/components/schemas/TagGroup' + Price: + description: Describes the price of a product or service + type: object + properties: + currency: + type: string + value: + $ref: '#/components/schemas/DecimalValue' + estimated_value: + $ref: '#/components/schemas/DecimalValue' + computed_value: + $ref: '#/components/schemas/DecimalValue' + listed_value: + $ref: '#/components/schemas/DecimalValue' + offered_value: + $ref: '#/components/schemas/DecimalValue' + minimum_value: + $ref: '#/components/schemas/DecimalValue' + maximum_value: + $ref: '#/components/schemas/DecimalValue' + Provider: + description: Describes the catalog of a business. + type: object + properties: + id: + type: string + description: Id of the provider + descriptor: + $ref: '#/components/schemas/Descriptor' + category_id: + type: string + description: Category Id of the provider at the BPP-level catalog + rating: + $ref: '#/components/schemas/Rating/properties/value' + time: + $ref: '#/components/schemas/Time' + categories: + type: array + items: + $ref: '#/components/schemas/Category' + fulfillments: + type: array + items: + $ref: '#/components/schemas/Fulfillment' + payments: + type: array + items: + $ref: '#/components/schemas/Payment' + locations: + type: array + items: + $ref: '#/components/schemas/Location' + offers: + type: array + items: + $ref: '#/components/schemas/Offer' + items: + type: array + items: + $ref: '#/components/schemas/Item' + exp: + type: string + description: Time after which catalog has to be refreshed + format: date-time + rateable: + description: Whether this provider can be rated or not + type: boolean + ttl: + description: 'The time-to-live in seconds, for this object. This can be overriden at deeper levels. A value of -1 indicates that this object is not cacheable.' + type: integer + minimum: -1 + tags: + type: array + items: + $ref: '#/components/schemas/TagGroup' + Quotation: + description: 'Describes a quote. It is the estimated price of products or services from the BPP.
This has properties like price, breakup, ttl' + type: object + properties: + id: + description: ID of the quote. + type: string + format: uuid + price: + description: The total quoted price + allOf: + - $ref: '#/components/schemas/Price' + breakup: + description: the breakup of the total quoted price + type: array + items: + type: object + properties: + type: + type: string + enum: + - Item + - Offer + - Add-on + - Fulfillment + item: + $ref: '#/components/schemas/Item' + title: + type: string + price: + $ref: '#/components/schemas/Price' + ttl: + $ref: '#/components/schemas/Duration' + Rating: + description: Describes the rating of an entity + type: object + properties: + rating_category: + description: Category of the entity being rated + type: string + enum: + - Item + - Order + - Fulfillment + - Provider + - Agent + - Support + id: + description: Id of the object being rated + type: string + value: + description: 'Rating value given to the object. This can be a single value or can also contain an inequality operator like gt, gte, lt, lte. This can also contain an inequality expression containing logical operators like && and ||.' + type: string + Region: + description: Describes an arbitrary region of space. The network policy should contain a published list of supported regions by the network. + type: object + properties: + dimensions: + description: 'The number of dimensions that are used to describe any point inside that region. The most common dimensionality of a region is 2, that represents an area on a map. There are regions on the map that can be approximated to one-dimensional regions like roads, railway lines, or shipping lines. 3 dimensional regions are rarer, but are gaining popularity as flying drones are being adopted for various fulfillment services.' + type: string + enum: + - '1' + - '2' + - '3' + type: + description: 'The type of region. This is used to specify the granularity of the region represented by this object. Various examples of two-dimensional region types are city, country, state, district, and so on. The network policy should contain a list of all possible region types supported by the network.' + type: string + name: + type: string + description: Name of the region as specified on the map where that region exists. + code: + type: string + description: A standard code representing the region. This should be interpreted in the same way by all network participants. + boundary: + type: string + description: 'A string representing the boundary of the region. One-dimensional regions are represented by polylines. Two-dimensional regions are represented by polygons, and three-dimensional regions can represented by polyhedra.' + map_url: + type: string + description: The url to the map of the region. This can be a globally recognized map or the one specified by the network policy. + ReplacementTerm: + description: The replacement policy of an item or an order + type: object + properties: + fulfillment_state: + description: The state of fulfillment during which this term is applicable. + allOf: + - $ref: '#/components/schemas/State' + replace_within: + description: 'Applicable only for buyer managed returns where the buyer has to replace the item before a certain date-time, failing which they will not be eligible for replacement' + allOf: + - $ref: '#/components/schemas/Time' + external_ref: + $ref: '#/components/schemas/MediaFile' + ReturnTerm: + description: Describes the return policy of an item or an order + type: object + properties: + fulfillment_state: + description: The state of fulfillment during which this term IETF''s applicable. + allOf: + - $ref: '#/components/schemas/State' + return_eligible: + description: Indicates whether the item is eligible for return + type: boolean + return_time: + description: 'Applicable only for buyer managed returns where the buyer has to return the item to the origin before a certain date-time, failing which they will not be eligible for refund.' + allOf: + - $ref: '#/components/schemas/Time' + return_location: + description: The location where the item or order must / will be returned to + allOf: + - $ref: '#/components/schemas/Location' + Scalar: + description: Describes a scalar + type: object + properties: + type: + type: string + enum: + - CONSTANT + - VARIABLE + value: + $ref: '#/components/schemas/DecimalValue' + estimated_value: + $ref: '#/components/schemas/DecimalValue' + computed_value: + $ref: '#/components/schemas/DecimalValue' + range: + type: object + properties: + min: + $ref: '#/components/schemas/DecimalValue' + max: + $ref: '#/components/schemas/DecimalValue' + unit: + type: string + Schedule: + description: 'Describes schedule as a repeating time period used to describe a regularly recurring event. At a minimum a schedule will specify frequency which describes the interval between occurrences of the event. Additional information can be provided to specify the schedule more precisely. This includes identifying the timestamps(s) of when the event will take place. Schedules may also have holidays to exclude a specific day from the schedule.
This has properties like frequency, holidays, times' + type: object + properties: + frequency: + $ref: '#/components/schemas/Duration' + holidays: + type: array + items: + type: string + format: date-time + times: + type: array + items: + type: string + format: date-time + State: + description: A bounded geopolitical region of governance inside a country. + type: object + properties: + name: + type: string + description: Name of the state + code: + type: string + description: State code as per country or international standards + Stop: + description: A logical point in space and time during the fulfillment of an order. + type: object + properties: + id: + type: string + parent_stop_id: + type: string + location: + description: Location of the stop + allOf: + - $ref: '#/components/schemas/Location' + type: + description: The type of stop. Allowed values of this property can be defined by the network policy. + type: string + time: + description: Timings applicable at the stop. + allOf: + - $ref: '#/components/schemas/Time' + instructions: + description: Instructions that need to be followed at the stop + allOf: + - $ref: '#/components/schemas/Descriptor' + contact: + description: Contact details of the stop + allOf: + - $ref: '#/components/schemas/Contact' + person: + description: The details of the person present at the stop + allOf: + - $ref: '#/components/schemas/Person' + authorization: + $ref: '#/components/schemas/Authorization' + Support: + description: Details of customer support + type: object + properties: + type: + type: string + enum: + - order + - billing + - fulfillment + - payment + ref_id: + type: string + callback_phone: + type: string + format: phone + phone: + type: string + format: phone + email: + type: string + format: email + url: + type: string + format: uri + Tag: + description: 'Describes a tag. This is used to contain extended metadata. This object can be added as a property to any schema to describe extended attributes. For BAPs, tags can be sent during search to optimize and filter search results. BPPs can use tags to index their catalog to allow better search functionality. Tags are sent by the BPP as part of the catalog response in the `on_search` callback. Tags are also meant for display purposes. Upon receiving a tag, BAPs are meant to render them as name-value pairs. This is particularly useful when rendering tabular information about a product or service.' + type: object + properties: + descriptor: + description: 'Description of the Tag, can be used to store detailed information.' + allOf: + - $ref: '#/components/schemas/Descriptor' + value: + description: The value of the tag. This set by the BPP and rendered as-is by the BAP. + type: string + display: + description: 'This value indicates if the tag is intended for display purposes. If set to `true`, then this tag must be displayed. If it is set to `false`, it should not be displayed. This value can override the group display value.' + type: boolean + TagGroup: + description: 'A collection of tag objects with group level attributes. For detailed documentation on the Tags and Tag Groups schema go to https://github.com/beckn/protocol-specifications/discussions/316' + type: object + properties: + display: + description: 'Indicates the display properties of the tag group. If display is set to false, then the group will not be displayed. If it is set to true, it should be displayed. However, group-level display properties can be overriden by individual tag-level display property. As this schema is purely for catalog display purposes, it is not recommended to send this value during search.' + type: boolean + default: true + descriptor: + description: 'Description of the TagGroup, can be used to store detailed information.' + allOf: + - $ref: '#/components/schemas/Descriptor' + list: + description: 'An array of Tag objects listed under this group. This property can be set by BAPs during search to narrow the `search` and achieve more relevant results. When received during `on_search`, BAPs must render this list under the heading described by the `name` property of this schema.' + type: array + items: + $ref: '#/components/schemas/Tag' + Time: + description: 'Describes time in its various forms. It can be a single point in time; duration; or a structured timetable of operations
This has properties like label, time stamp,duration,range, days, schedule' + type: object + properties: + label: + type: string + timestamp: + type: string + format: date-time + duration: + $ref: '#/components/schemas/Duration' + range: + type: object + properties: + start: + type: string + format: date-time + end: + type: string + format: date-time + days: + type: string + description: comma separated values representing days of the week + schedule: + $ref: '#/components/schemas/Schedule' + Tracking: + description: Contains tracking information that can be used by the BAP to track the fulfillment of an order in real-time. which is useful for knowing the location of time sensitive deliveries. + type: object + properties: + id: + description: A unique tracking reference number + type: string + url: + description: 'A URL to the tracking endpoint. This can be a link to a tracking webpage, a webhook URL created by the BAP where BPP can push the tracking data, or a GET url creaed by the BPP which the BAP can poll to get the tracking data. It can also be a websocket URL where the BPP can push real-time tracking data.' + type: string + format: uri + location: + description: 'In case there is no real-time tracking endpoint available, this field will contain the latest location of the entity being tracked. The BPP will update this value everytime the BAP calls the track API.' + allOf: + - $ref: '#/components/schemas/Location' + status: + description: 'This value indicates if the tracking is currently active or not. If this value is `active`, then the BAP can begin tracking the order. If this value is `inactive`, the tracking URL is considered to be expired and the BAP should stop tracking the order.' + type: string + enum: + - active + - inactive + Vehicle: + description: 'Describes a vehicle is a device that is designed or used to transport people or cargo over land, water, air, or through space.
This has properties like category, capacity, make, model, size,variant,color,energy_type,registration' + type: object + properties: + category: + type: string + capacity: + type: integer + make: + type: string + model: + type: string + size: + type: string + variant: + type: string + color: + type: string + energy_type: + type: string + registration: + type: string + wheels_count: + type: string + cargo_volumne: + type: string + wheelchair_access: + type: string + code: + type: string + emission_standard: + type: string + XInput: + description: 'Contains any additional or extended inputs required to confirm an order. This is typically a Form Input. Sometimes, selection of catalog elements is not enough for the BPP to confirm an order. For example, to confirm a flight ticket, the airline requires details of the passengers along with information on baggage, identity, in addition to the class of ticket. Similarly, a logistics company may require details on the nature of shipment in order to confirm the shipping. A recruiting firm may require additional details on the applicant in order to confirm a job application. For all such purposes, the BPP can choose to send this object attached to any object in the catalog that is required to be sent while placing the order. This object can typically be sent at an item level or at the order level. The item level XInput will override the Order level XInput as it indicates a special requirement of information for that particular item. Hence the BAP must render a separate form for the Item and another form at the Order level before confirmation.' + type: object + properties: + form: + $ref: '#/components/schemas/Form' + required: + description: Indicates whether the form data is mandatorily required by the BPP to confirm the order. + type: boolean \ No newline at end of file From 586ef3821a3e192111a3f858f8822075334b7850 Mon Sep 17 00:00:00 2001 From: Rajaneesh Date: Thu, 3 Apr 2025 16:13:08 +0530 Subject: [PATCH 25/26] fix: quantity object --- examples/cancel/on-cancel.json | 3 +-- examples/confirm/confirm.json | 4 ++-- examples/confirm/on-confirm.json | 4 ++-- examples/init/init.json | 4 ++-- examples/init/on-init.json | 4 ++-- examples/select/on-select.json | 4 ++-- examples/select/select.json | 4 ++-- examples/status/on-status.json | 4 ++-- examples/status/on-status_In-Transit.json | 4 ++-- examples/update/on-update.json | 4 ++-- 10 files changed, 19 insertions(+), 20 deletions(-) diff --git a/examples/cancel/on-cancel.json b/examples/cancel/on-cancel.json index bcb9281..b40fd3b 100644 --- a/examples/cancel/on-cancel.json +++ b/examples/cancel/on-cancel.json @@ -90,10 +90,9 @@ ], "quantity": { "selected": { - "count": "1", "measure": { "unit": "KG", - "value": "1" + "value": "5" } } } diff --git a/examples/confirm/confirm.json b/examples/confirm/confirm.json index 388738e..be6739c 100644 --- a/examples/confirm/confirm.json +++ b/examples/confirm/confirm.json @@ -30,9 +30,9 @@ "id": "I1", "quantity": { "selected": { - "count": "5", "measure": { - "unit": "KG" + "unit": "KG", + "value": "5" } } } diff --git a/examples/confirm/on-confirm.json b/examples/confirm/on-confirm.json index b8be2e5..684a66b 100644 --- a/examples/confirm/on-confirm.json +++ b/examples/confirm/on-confirm.json @@ -86,9 +86,9 @@ ], "quantity": { "selected": { - "count": "5", "measure": { - "unit": "KG" + "unit": "KG", + "value": "5" } } } diff --git a/examples/init/init.json b/examples/init/init.json index a2eae40..72f0701 100644 --- a/examples/init/init.json +++ b/examples/init/init.json @@ -30,9 +30,9 @@ "id": "I1", "quantity": { "selected": { - "count": "5", "measure": { - "unit": "KG" + "unit": "KG", + "value": "5" } } } diff --git a/examples/init/on-init.json b/examples/init/on-init.json index 76d5940..9b28ec5 100644 --- a/examples/init/on-init.json +++ b/examples/init/on-init.json @@ -85,9 +85,9 @@ ], "quantity": { "selected": { - "count": "5", "measure": { - "unit": "KG" + "unit": "KG", + "value": "5" } } } diff --git a/examples/select/on-select.json b/examples/select/on-select.json index 6d68acd..966f466 100644 --- a/examples/select/on-select.json +++ b/examples/select/on-select.json @@ -85,9 +85,9 @@ ], "quantity": { "selected": { - "count": "5", "measure": { - "unit": "KG" + "unit": "KG", + "value": "5" } } } diff --git a/examples/select/select.json b/examples/select/select.json index 10092d0..85a3d6e 100644 --- a/examples/select/select.json +++ b/examples/select/select.json @@ -30,9 +30,9 @@ "id": "I1", "quantity": { "selected": { - "count": "5", "measure": { - "unit": "KG" + "unit": "KG", + "value": "5" } } } diff --git a/examples/status/on-status.json b/examples/status/on-status.json index 8ae0f7d..24a8fbb 100644 --- a/examples/status/on-status.json +++ b/examples/status/on-status.json @@ -86,9 +86,9 @@ ], "quantity": { "selected": { - "count": "5", "measure": { - "unit": "KG" + "unit": "KG", + "value": "5" } } } diff --git a/examples/status/on-status_In-Transit.json b/examples/status/on-status_In-Transit.json index 4816f1a..0a44748 100644 --- a/examples/status/on-status_In-Transit.json +++ b/examples/status/on-status_In-Transit.json @@ -86,9 +86,9 @@ ], "quantity": { "selected": { - "count": "5", "measure": { - "unit": "KG" + "unit": "KG", + "value": "5" } } } diff --git a/examples/update/on-update.json b/examples/update/on-update.json index 4aa634c..7563293 100644 --- a/examples/update/on-update.json +++ b/examples/update/on-update.json @@ -86,9 +86,9 @@ ], "quantity": { "selected": { - "count": "5", "measure": { - "unit": "KG" + "unit": "KG", + "value": "5" } } } From 28a27047ce5bdb6867c54d655d61e2101979e6bd Mon Sep 17 00:00:00 2001 From: Rajaneesh Date: Thu, 3 Apr 2025 21:57:39 +0530 Subject: [PATCH 26/26] updating the example jsons with more details --- examples/cancel/on-cancel.json | 81 ++++++++++++++++++- examples/confirm/confirm.json | 96 ++++++++++++++++++++++- examples/confirm/on-confirm.json | 81 ++++++++++++++++++- examples/init/init.json | 96 ++++++++++++++++++++++- examples/init/on-init.json | 81 ++++++++++++++++++- examples/select/on-select.json | 66 +++++++++++++++- examples/select/select.json | 81 ++++++++++++++++++- examples/status/on-status.json | 81 ++++++++++++++++++- examples/status/on-status_In-Transit.json | 81 ++++++++++++++++++- examples/update/on-update.json | 81 ++++++++++++++++++- 10 files changed, 815 insertions(+), 10 deletions(-) diff --git a/examples/cancel/on-cancel.json b/examples/cancel/on-cancel.json index b40fd3b..a6ff198 100644 --- a/examples/cancel/on-cancel.json +++ b/examples/cancel/on-cancel.json @@ -81,11 +81,90 @@ "List": [ { "descriptor": { - "code": "Min-Chargable-Weight-in-KG" + "code": "Min-Chargeable-Weight-in-KG" }, "value": "10" } ] + }, + { + "descriptor": { + "code": "package-details", + "name": "package details" + }, + "list": [ + { + "descriptor": { + "code": "package-count", + "name": "package count" + }, + "value": "2" + }, + { + "descriptor": { + "code": "package-1-dimension", + "name": "package 1 dimension", + "short_desc": "L|W|H in cm" + }, + "value": "30|20|10" + }, + { + "descriptor": { + "code": "package-2-dimension", + "name": "package 2 dimension", + "short_desc": "L|W|H in cm" + }, + "value": "20|15|10" + } + ] + }, + { + "descriptor": { + "code": "handling", + "name": "handling" + }, + "list": [ + { + "descriptor": { + "code": "fragile" + }, + "value": "yes" + }, + { + "descriptor": { + "code": "hazardous" + }, + "value": "yes" + } + ] + }, + { + "descriptor": { + "code": "special-instructions" + }, + "list": [ + { + "descriptor": { + "code": "delivery-instruction" + }, + "value": "please deliver after 5PM" + } + ] + }, + { + "descriptor": { + "code": "COD", + "name": "Cash on delivery details" + }, + "list": [ + { + "descriptor": { + "code": "COD-amount", + "name": "cash to be collected on delivery" + }, + "value": "527.00" + } + ] } ], "quantity": { diff --git a/examples/confirm/confirm.json b/examples/confirm/confirm.json index be6739c..0940ce2 100644 --- a/examples/confirm/confirm.json +++ b/examples/confirm/confirm.json @@ -35,7 +35,101 @@ "value": "5" } } - } + }, + "tags": [ + { + "descriptor": { + "name": "charges" + }, + "List": [ + { + "descriptor": { + "code": "Min-Chargeable-Weight-in-KG" + }, + "value": "10" + } + ] + }, + { + "descriptor": { + "code": "package-details", + "name": "package details" + }, + "list": [ + { + "descriptor": { + "code": "package-count", + "name": "package count" + }, + "value": "2" + }, + { + "descriptor": { + "code": "package-1-dimension", + "name": "package 1 dimension", + "short_desc": "L|W|H in cm" + }, + "value": "30|20|10" + }, + { + "descriptor": { + "code": "package-2-dimension", + "name": "package 2 dimension", + "short_desc": "L|W|H in cm" + }, + "value": "20|15|10" + } + ] + }, + { + "descriptor": { + "code": "handling", + "name": "handling" + }, + "list": [ + { + "descriptor": { + "code": "fragile" + }, + "value": "yes" + }, + { + "descriptor": { + "code": "hazardous" + }, + "value": "yes" + } + ] + }, + { + "descriptor": { + "code": "special-instructions" + }, + "list": [ + { + "descriptor": { + "code": "delivery-instruction" + }, + "value": "please deliver after 5PM" + } + ] + }, + { + "descriptor": { + "code": "COD", + "name": "Cash on delivery details" + }, + "list": [ + { + "descriptor": { + "code": "COD-amount", + "name": "cash to be collected on delivery" + }, + "value": "527.00" + } + ] + } + ] } ], "fulfillments": [ diff --git a/examples/confirm/on-confirm.json b/examples/confirm/on-confirm.json index 684a66b..25c1f2f 100644 --- a/examples/confirm/on-confirm.json +++ b/examples/confirm/on-confirm.json @@ -77,11 +77,90 @@ "List": [ { "descriptor": { - "code": "Min-Chargable-Weight-in-KG" + "code": "Min-Chargeable-Weight-in-KG" }, "value": "10" } ] + }, + { + "descriptor": { + "code": "package-details", + "name": "package details" + }, + "list": [ + { + "descriptor": { + "code": "package-count", + "name": "package count" + }, + "value": "2" + }, + { + "descriptor": { + "code": "package-1-dimension", + "name": "package 1 dimension", + "short_desc": "L|W|H in cm" + }, + "value": "30|20|10" + }, + { + "descriptor": { + "code": "package-2-dimension", + "name": "package 2 dimension", + "short_desc": "L|W|H in cm" + }, + "value": "20|15|10" + } + ] + }, + { + "descriptor": { + "code": "handling", + "name": "handling" + }, + "list": [ + { + "descriptor": { + "code": "fragile" + }, + "value": "yes" + }, + { + "descriptor": { + "code": "hazardous" + }, + "value": "yes" + } + ] + }, + { + "descriptor": { + "code": "special-instructions" + }, + "list": [ + { + "descriptor": { + "code": "delivery-instruction" + }, + "value": "please deliver after 5PM" + } + ] + }, + { + "descriptor": { + "code": "COD", + "name": "Cash on delivery details" + }, + "list": [ + { + "descriptor": { + "code": "COD-amount", + "name": "cash to be collected on delivery" + }, + "value": "527.00" + } + ] } ], "quantity": { diff --git a/examples/init/init.json b/examples/init/init.json index 72f0701..1338675 100644 --- a/examples/init/init.json +++ b/examples/init/init.json @@ -35,7 +35,101 @@ "value": "5" } } - } + }, + "tags": [ + { + "descriptor": { + "name": "charges" + }, + "List": [ + { + "descriptor": { + "code": "Min-Chargeable-Weight-in-KG" + }, + "value": "10" + } + ] + }, + { + "descriptor": { + "code": "package-details", + "name": "package details" + }, + "list": [ + { + "descriptor": { + "code": "package-count", + "name": "package count" + }, + "value": "2" + }, + { + "descriptor": { + "code": "package-1-dimension", + "name": "package 1 dimension", + "short_desc": "L|W|H in cm" + }, + "value": "30|20|10" + }, + { + "descriptor": { + "code": "package-2-dimension", + "name": "package 2 dimension", + "short_desc": "L|W|H in cm" + }, + "value": "20|15|10" + } + ] + }, + { + "descriptor": { + "code": "handling", + "name": "handling" + }, + "list": [ + { + "descriptor": { + "code": "fragile" + }, + "value": "yes" + }, + { + "descriptor": { + "code": "hazardous" + }, + "value": "yes" + } + ] + }, + { + "descriptor": { + "code": "special-instructions" + }, + "list": [ + { + "descriptor": { + "code": "delivery-instruction" + }, + "value": "please deliver after 5PM" + } + ] + }, + { + "descriptor": { + "code": "COD", + "name": "Cash on delivery details" + }, + "list": [ + { + "descriptor": { + "code": "COD-amount", + "name": "cash to be collected on delivery" + }, + "value": "527.00" + } + ] + } + ] } ], "fulfillments": [ diff --git a/examples/init/on-init.json b/examples/init/on-init.json index 9b28ec5..65ff40e 100644 --- a/examples/init/on-init.json +++ b/examples/init/on-init.json @@ -76,11 +76,90 @@ "List": [ { "descriptor": { - "code": "Min-Chargable-Weight-in-KG" + "code": "Min-Chargeable-Weight-in-KG" }, "value": "10" } ] + }, + { + "descriptor": { + "code": "package-details", + "name": "package details" + }, + "list": [ + { + "descriptor": { + "code": "package-count", + "name": "package count" + }, + "value": "2" + }, + { + "descriptor": { + "code": "package-1-dimension", + "name": "package 1 dimension", + "short_desc": "L|W|H in cm" + }, + "value": "30|20|10" + }, + { + "descriptor": { + "code": "package-2-dimension", + "name": "package 2 dimension", + "short_desc": "L|W|H in cm" + }, + "value": "20|15|10" + } + ] + }, + { + "descriptor": { + "code": "handling", + "name": "handling" + }, + "list": [ + { + "descriptor": { + "code": "fragile" + }, + "value": "yes" + }, + { + "descriptor": { + "code": "hazardous" + }, + "value": "yes" + } + ] + }, + { + "descriptor": { + "code": "special-instructions" + }, + "list": [ + { + "descriptor": { + "code": "delivery-instruction" + }, + "value": "please deliver after 5PM" + } + ] + }, + { + "descriptor": { + "code": "COD", + "name": "Cash on delivery details" + }, + "list": [ + { + "descriptor": { + "code": "COD-amount", + "name": "cash to be collected on delivery" + }, + "value": "527.00" + } + ] } ], "quantity": { diff --git a/examples/select/on-select.json b/examples/select/on-select.json index 966f466..cef8608 100644 --- a/examples/select/on-select.json +++ b/examples/select/on-select.json @@ -76,11 +76,75 @@ "List": [ { "descriptor": { - "code": "Min-Chargable-Weight-in-KG" + "code": "Min-Chargeable-Weight-in-KG" }, "value": "10" } ] + }, + { + "descriptor": { + "code": "package-details", + "name": "package details" + }, + "list": [ + { + "descriptor": { + "code": "package-count", + "name": "package count" + }, + "value": "2" + }, + { + "descriptor": { + "code": "package-1-dimension", + "name": "package 1 dimension", + "short_desc": "L|W|H in cm" + }, + "value": "30|20|10" + }, + { + "descriptor": { + "code": "package-2-dimension", + "name": "package 2 dimension", + "short_desc": "L|W|H in cm" + }, + "value": "20|15|10" + } + ] + }, + { + "descriptor": { + "code": "handling", + "name": "handling" + }, + "list": [ + { + "descriptor": { + "code": "fragile" + }, + "value": "yes" + }, + { + "descriptor": { + "code": "hazardous" + }, + "value": "yes" + } + ] + }, + { + "descriptor": { + "code": "special-instructions" + }, + "list": [ + { + "descriptor": { + "code": "delivery-instruction" + }, + "value": "please deliver after 5PM" + } + ] } ], "quantity": { diff --git a/examples/select/select.json b/examples/select/select.json index 85a3d6e..8a5a30b 100644 --- a/examples/select/select.json +++ b/examples/select/select.json @@ -35,7 +35,86 @@ "value": "5" } } - } + }, + "tags": [ + { + "descriptor": { + "name": "charges" + }, + "List": [ + { + "descriptor": { + "code": "Min-Chargeable-Weight-in-KG" + }, + "value": "10" + } + ] + }, + { + "descriptor": { + "code": "package-details", + "name": "package details" + }, + "list": [ + { + "descriptor": { + "code": "package-count", + "name": "package count" + }, + "value": "2" + }, + { + "descriptor": { + "code": "package-1-dimension", + "name": "package 1 dimension", + "short_desc": "L|W|H in cm" + }, + "value": "30|20|10" + }, + { + "descriptor": { + "code": "package-2-dimension", + "name": "package 2 dimension", + "short_desc": "L|W|H in cm" + }, + "value": "20|15|10" + } + ] + }, + { + "descriptor": { + "code": "handling", + "name": "handling" + }, + "list": [ + { + "descriptor": { + "code": "fragile" + }, + "value": "yes" + }, + { + "descriptor": { + "code": "hazardous" + }, + "value": "yes" + } + ] + }, + { + "descriptor": { + "code": "special-instructions" + }, + "list": [ + { + "descriptor": { + "code": "delivery-instruction" + }, + "value": "please deliver after 5PM" + } + ] + } + ] } ], "fulfillments": [ diff --git a/examples/status/on-status.json b/examples/status/on-status.json index 24a8fbb..8d0c1d1 100644 --- a/examples/status/on-status.json +++ b/examples/status/on-status.json @@ -77,11 +77,90 @@ "List": [ { "descriptor": { - "code": "Min-Chargable-Weight-in-KG" + "code": "Min-Chargeable-Weight-in-KG" }, "value": "10" } ] + }, + { + "descriptor": { + "code": "package-details", + "name": "package details" + }, + "list": [ + { + "descriptor": { + "code": "package-count", + "name": "package count" + }, + "value": "2" + }, + { + "descriptor": { + "code": "package-1-dimension", + "name": "package 1 dimension", + "short_desc": "L|W|H in cm" + }, + "value": "30|20|10" + }, + { + "descriptor": { + "code": "package-2-dimension", + "name": "package 2 dimension", + "short_desc": "L|W|H in cm" + }, + "value": "20|15|10" + } + ] + }, + { + "descriptor": { + "code": "handling", + "name": "handling" + }, + "list": [ + { + "descriptor": { + "code": "fragile" + }, + "value": "yes" + }, + { + "descriptor": { + "code": "hazardous" + }, + "value": "yes" + } + ] + }, + { + "descriptor": { + "code": "special-instructions" + }, + "list": [ + { + "descriptor": { + "code": "delivery-instruction" + }, + "value": "please deliver after 5PM" + } + ] + }, + { + "descriptor": { + "code": "COD", + "name": "Cash on delivery details" + }, + "list": [ + { + "descriptor": { + "code": "COD-amount", + "name": "cash to be collected on delivery" + }, + "value": "527.00" + } + ] } ], "quantity": { diff --git a/examples/status/on-status_In-Transit.json b/examples/status/on-status_In-Transit.json index 0a44748..8e52625 100644 --- a/examples/status/on-status_In-Transit.json +++ b/examples/status/on-status_In-Transit.json @@ -77,11 +77,90 @@ "List": [ { "descriptor": { - "code": "Min-Chargable-Weight-in-KG" + "code": "Min-Chargeable-Weight-in-KG" }, "value": "10" } ] + }, + { + "descriptor": { + "code": "package-details", + "name": "package details" + }, + "list": [ + { + "descriptor": { + "code": "package-count", + "name": "package count" + }, + "value": "2" + }, + { + "descriptor": { + "code": "package-1-dimension", + "name": "package 1 dimension", + "short_desc": "L|W|H in cm" + }, + "value": "30|20|10" + }, + { + "descriptor": { + "code": "package-2-dimension", + "name": "package 2 dimension", + "short_desc": "L|W|H in cm" + }, + "value": "20|15|10" + } + ] + }, + { + "descriptor": { + "code": "handling", + "name": "handling" + }, + "list": [ + { + "descriptor": { + "code": "fragile" + }, + "value": "yes" + }, + { + "descriptor": { + "code": "hazardous" + }, + "value": "yes" + } + ] + }, + { + "descriptor": { + "code": "special-instructions" + }, + "list": [ + { + "descriptor": { + "code": "delivery-instruction" + }, + "value": "please deliver after 5PM" + } + ] + }, + { + "descriptor": { + "code": "COD", + "name": "Cash on delivery details" + }, + "list": [ + { + "descriptor": { + "code": "COD-amount", + "name": "cash to be collected on delivery" + }, + "value": "527.00" + } + ] } ], "quantity": { diff --git a/examples/update/on-update.json b/examples/update/on-update.json index 7563293..3c633f5 100644 --- a/examples/update/on-update.json +++ b/examples/update/on-update.json @@ -77,11 +77,90 @@ "List": [ { "descriptor": { - "code": "Min-Chargable-Weight-in-KG" + "code": "Min-Chargeable-Weight-in-KG" }, "value": "10" } ] + }, + { + "descriptor": { + "code": "package-details", + "name": "package details" + }, + "list": [ + { + "descriptor": { + "code": "package-count", + "name": "package count" + }, + "value": "2" + }, + { + "descriptor": { + "code": "package-1-dimension", + "name": "package 1 dimension", + "short_desc": "L|W|H in cm" + }, + "value": "30|20|10" + }, + { + "descriptor": { + "code": "package-2-dimension", + "name": "package 2 dimension", + "short_desc": "L|W|H in cm" + }, + "value": "20|15|10" + } + ] + }, + { + "descriptor": { + "code": "handling", + "name": "handling" + }, + "list": [ + { + "descriptor": { + "code": "fragile" + }, + "value": "yes" + }, + { + "descriptor": { + "code": "hazardous" + }, + "value": "yes" + } + ] + }, + { + "descriptor": { + "code": "special-instructions" + }, + "list": [ + { + "descriptor": { + "code": "delivery-instruction" + }, + "value": "please deliver after 5PM" + } + ] + }, + { + "descriptor": { + "code": "COD", + "name": "Cash on delivery details" + }, + "list": [ + { + "descriptor": { + "code": "COD-amount", + "name": "cash to be collected on delivery" + }, + "value": "527.00" + } + ] } ], "quantity": {