{"_id":"5829d42c6a1d1f0f00b94504","__v":0,"initVersion":{"_id":"54dec8b6c2b4b70d009c3f0f","version":"1"},"project":"54c83b5aab706219009e067b","user":{"_id":"5582f3efb806360d002448ea","username":"","name":"Shashank Mehta"},"hidden":false,"createdAt":"2016-11-14T15:11:40.763Z","fullscreen":false,"htmlmode":false,"html":"","body":"# What is eCOD?\neCOD is a new product from Razorpay that allows your delivery executives to accept digital payments instead of cash.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Looking for Link Based Payments?\",\n  \"body\": \"Razorpay also provides a link based payments feature. The details for this are available here: [https://docs.razorpay.com/v1/page/link-based-payments](https://docs.razorpay.com/v1/page/link-based-payments)\"\n}\n[/block]\n# How can you integrate eCOD?\nThe prerequisites for integrating eCOD are:\n1. Merchant should have an app for delivery executives\n2. Delivery executives should have Internet access on their device\n\neCOD is available as an Android SDK that can be embedded in the delivery app of the merchant. The SDK handles the entire user interface for collecting payments through the various payment modes.\n\nThe integration process is covered in detail in a section below.\n\n# Supported Payment Methods\neCOD allows all payment modes: card, netbanking, wallets and UPI. These modes can be divided into two categories:\n\n- On Delivery App Methods\n  - The customer does not need to open any link\n- Link Based Methods\n  - The customer can use these payments modes on their own device only, through a special link\n\n## On Delivery App Methods\nThese include:\n1. Wallets\n2. UPI\n\n### Wallet Payments\nFor wallet payments, if a customer has enough balance in the wallet, the payment can be made through just an OTP.\n\nThe flow is explained below:\n1. Delivery executive shows the wallet list to the customer on their own phone\n2. Customer selects a wallet and enters their phone number\n3. Customer receives an SMS from the wallet provider\n4. Customer inputs the OTP on the delivery executive’s phone\n5. Payment is complete\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"This payment method does not require Internet on the customer’s side.\",\n  \"title\": \"No Internet Needed\"\n}\n[/block]\n### UPI Payments\nUPI payments work through Collect request. Here’s the flow for it:\n1. Delivery executive selects UPI on their phone\n2. Customer provides their VPA (Virtual payment address)\n3. Customer receives a collect request on their own phone that has been configured for UPI\n4. Customer approves the collect request using MPIN\n5. Payment is complete\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"This payment method requires the customer to have VPA configured and working Internet too, since UPI doesn’t work without Internet\",\n  \"title\": \"UPI Needs Internet\"\n}\n[/block]\n## Link Based Methods\nThese include:\n1. Debit/Credit Cards\n2. Netbanking\n3. Wallets\n4. UPI\n\nWhile Wallets and UPI based payments can also be made through the delivery executive’s device, card and netbanking methods are only available via a special link.\n\nThe flow for link based payment is as follows:\n1. Customer notifies the delivery executive that they want to make a payment on their own device\n2. Delivery executive selects “Link Payments” on their device\n3. Customer receives an SMS with a link. This link is a short link and is also visible on the Delivery executive’s device in text as well as QR format\n4. Customer opens the link on a computer or mobile\n5. The standard Razorpay Checkout form opens up through which customer can pay using Card, Netbanking etc.\n6. Once the payment is complete, the delivery executive’s phone automatically indicates this.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"In all of the above payment methods, link based as well as delivery device, the delivery executive is interacting with a UI developed by Razorpay. This will drastically reduce the integration time.\",\n  \"title\": \"Razorpay SDK Includes the UI\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Invoice Paid Webhook\",\n  \"body\": \"We have a webhook for invoice paid. You can use this to find out when an invoice gets paid by the customer. This can be enabled on your dashboard under the webhooks section.\\nYou can find the documentation [here](https://docs.razorpay.com/v1/page/webhooks)\"\n}\n[/block]\n# Integration Process\neCOD runs on top of Razorpay’s Invoices system. An eCOD payment is basically made against an invoice. However, this does not complicate things and requires just two steps of integration:\n1. Create an Invoice on your server\n2. Pass the invoice_id to Razorpay’s Android SDK\n\nThat’s it! Razorpay’s Android SDK handles everything else. The overall flow is explained below:\n\n1. Delivery executive selects an order in the merchant’s app\n2. Delivery executive clicks on “Initiate Payment”\n3. The merchant app makes a request to merchant server\n4. Merchant server calls the create invoice request on Razorpay’s API\n5. Razorpay’s API returns an `invoice_id`. This is passed on to merchant app by the merchant server\n6. Merchant app invokes Razorpay’s Android SDK and passes the `invoice_id`\n7. Razorpay’s SDK displays a UI for selecting payment mode\n8. Customer selects a payment mode\n9. Once the payment is completed, Razorpay’s Android SDK passes back the control to merchant app with the result, success or fail\n\n## Creating an Invoice [Server Side]\nStep 4 described above involves creating an Invoice through Razorpay’s API. All you need for creating an invoice is the amount and the contact number of the customer.\n\nThe API details are covered in depth in the document on invoices available here: [https://docs.razorpay.com/v1/page/invoices](https://docs.razorpay.com/v1/page/invoices).\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Mandatory Fields for eCOD\",\n  \"body\": \"For eCOD, you need to pass the following fields mandatorily in the create invoice API:\\n- type: ecod\\n- view_less: 1\\n\\nWithout these fields, there's no guarantee of the functionality working as described.\"\n}\n[/block]\nOnce this step is completed, you will have an `invoice_id`. This needs to be passed to merchant's mobile application.\n\n## Invoking Razorpay's Android SDK\nStep 6 involves invoking Razorpay's Android SDK. The standard documentation for integration the android SDK apply here too and is available here: [https://github.com/razorpay/razorpay-android-sample-app/releases](https://github.com/razorpay/razorpay-android-sample-app/releases). You can use the latest SDK.\n\nIn the `JSONObject options` that you will pass to the SDK, you need to necessarily pass the following fields:\n\n- `invoice_id: <pass the invoice_id>`\n- `ecod: true`\n\nWithout these parameters, the eCOD checkout form will not be shown.\n\n## Completing the Payment\nThe delivery executive and the customer need to interact with the special eCOD checkout form displayed by the SDK. The customer has various options for completing the payment. In all cases once the payment is completed, the android SDK will call merchant's `onPaymentSuccess` method and pass over the `payment_id`.\n\n### Handling of Link Based Payment\nIf the customer chooses link based payment, an SMS is automatically sent to the customer's phone. The customer can open this link on their phone or computer. Once the payment is completed on their device, the SDK will automatically detect that the payment has been completed and call merchant's `onPaymentSuccess` method.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Support\",\n  \"body\": \"If you face any issue while integrating eCOD, please write to us at integrations@razorpay.com.\"\n}\n[/block]","slug":"ecod","title":"eCOD"}

eCOD


# What is eCOD? eCOD is a new product from Razorpay that allows your delivery executives to accept digital payments instead of cash. [block:callout] { "type": "info", "title": "Looking for Link Based Payments?", "body": "Razorpay also provides a link based payments feature. The details for this are available here: [https://docs.razorpay.com/v1/page/link-based-payments](https://docs.razorpay.com/v1/page/link-based-payments)" } [/block] # How can you integrate eCOD? The prerequisites for integrating eCOD are: 1. Merchant should have an app for delivery executives 2. Delivery executives should have Internet access on their device eCOD is available as an Android SDK that can be embedded in the delivery app of the merchant. The SDK handles the entire user interface for collecting payments through the various payment modes. The integration process is covered in detail in a section below. # Supported Payment Methods eCOD allows all payment modes: card, netbanking, wallets and UPI. These modes can be divided into two categories: - On Delivery App Methods - The customer does not need to open any link - Link Based Methods - The customer can use these payments modes on their own device only, through a special link ## On Delivery App Methods These include: 1. Wallets 2. UPI ### Wallet Payments For wallet payments, if a customer has enough balance in the wallet, the payment can be made through just an OTP. The flow is explained below: 1. Delivery executive shows the wallet list to the customer on their own phone 2. Customer selects a wallet and enters their phone number 3. Customer receives an SMS from the wallet provider 4. Customer inputs the OTP on the delivery executive’s phone 5. Payment is complete [block:callout] { "type": "info", "body": "This payment method does not require Internet on the customer’s side.", "title": "No Internet Needed" } [/block] ### UPI Payments UPI payments work through Collect request. Here’s the flow for it: 1. Delivery executive selects UPI on their phone 2. Customer provides their VPA (Virtual payment address) 3. Customer receives a collect request on their own phone that has been configured for UPI 4. Customer approves the collect request using MPIN 5. Payment is complete [block:callout] { "type": "info", "body": "This payment method requires the customer to have VPA configured and working Internet too, since UPI doesn’t work without Internet", "title": "UPI Needs Internet" } [/block] ## Link Based Methods These include: 1. Debit/Credit Cards 2. Netbanking 3. Wallets 4. UPI While Wallets and UPI based payments can also be made through the delivery executive’s device, card and netbanking methods are only available via a special link. The flow for link based payment is as follows: 1. Customer notifies the delivery executive that they want to make a payment on their own device 2. Delivery executive selects “Link Payments” on their device 3. Customer receives an SMS with a link. This link is a short link and is also visible on the Delivery executive’s device in text as well as QR format 4. Customer opens the link on a computer or mobile 5. The standard Razorpay Checkout form opens up through which customer can pay using Card, Netbanking etc. 6. Once the payment is complete, the delivery executive’s phone automatically indicates this. [block:callout] { "type": "info", "body": "In all of the above payment methods, link based as well as delivery device, the delivery executive is interacting with a UI developed by Razorpay. This will drastically reduce the integration time.", "title": "Razorpay SDK Includes the UI" } [/block] [block:callout] { "type": "info", "title": "Invoice Paid Webhook", "body": "We have a webhook for invoice paid. You can use this to find out when an invoice gets paid by the customer. This can be enabled on your dashboard under the webhooks section.\nYou can find the documentation [here](https://docs.razorpay.com/v1/page/webhooks)" } [/block] # Integration Process eCOD runs on top of Razorpay’s Invoices system. An eCOD payment is basically made against an invoice. However, this does not complicate things and requires just two steps of integration: 1. Create an Invoice on your server 2. Pass the invoice_id to Razorpay’s Android SDK That’s it! Razorpay’s Android SDK handles everything else. The overall flow is explained below: 1. Delivery executive selects an order in the merchant’s app 2. Delivery executive clicks on “Initiate Payment” 3. The merchant app makes a request to merchant server 4. Merchant server calls the create invoice request on Razorpay’s API 5. Razorpay’s API returns an `invoice_id`. This is passed on to merchant app by the merchant server 6. Merchant app invokes Razorpay’s Android SDK and passes the `invoice_id` 7. Razorpay’s SDK displays a UI for selecting payment mode 8. Customer selects a payment mode 9. Once the payment is completed, Razorpay’s Android SDK passes back the control to merchant app with the result, success or fail ## Creating an Invoice [Server Side] Step 4 described above involves creating an Invoice through Razorpay’s API. All you need for creating an invoice is the amount and the contact number of the customer. The API details are covered in depth in the document on invoices available here: [https://docs.razorpay.com/v1/page/invoices](https://docs.razorpay.com/v1/page/invoices). [block:callout] { "type": "warning", "title": "Mandatory Fields for eCOD", "body": "For eCOD, you need to pass the following fields mandatorily in the create invoice API:\n- type: ecod\n- view_less: 1\n\nWithout these fields, there's no guarantee of the functionality working as described." } [/block] Once this step is completed, you will have an `invoice_id`. This needs to be passed to merchant's mobile application. ## Invoking Razorpay's Android SDK Step 6 involves invoking Razorpay's Android SDK. The standard documentation for integration the android SDK apply here too and is available here: [https://github.com/razorpay/razorpay-android-sample-app/releases](https://github.com/razorpay/razorpay-android-sample-app/releases). You can use the latest SDK. In the `JSONObject options` that you will pass to the SDK, you need to necessarily pass the following fields: - `invoice_id: <pass the invoice_id>` - `ecod: true` Without these parameters, the eCOD checkout form will not be shown. ## Completing the Payment The delivery executive and the customer need to interact with the special eCOD checkout form displayed by the SDK. The customer has various options for completing the payment. In all cases once the payment is completed, the android SDK will call merchant's `onPaymentSuccess` method and pass over the `payment_id`. ### Handling of Link Based Payment If the customer chooses link based payment, an SMS is automatically sent to the customer's phone. The customer can open this link on their phone or computer. Once the payment is completed on their device, the SDK will automatically detect that the payment has been completed and call merchant's `onPaymentSuccess` method. [block:callout] { "type": "info", "title": "Support", "body": "If you face any issue while integrating eCOD, please write to us at integrations@razorpay.com." } [/block]