Skip to main content

Cash on Delivery

Cash on Delivery (COD) is a popular payment method for buyers who prefer not to pay online or are unable to do so. Instead, they pay the courier upon delivery of the goods, either in cash or by card.

You can process such purchases through PayU to streamline completion and reconciliation with online payments and to avoid the complexities of handling transfers from the courier company. To do so, you’ll need to establish a partnership with a courier company responsible for collecting payments upon delivery and transferring the funds to PayU. The legal and operational aspects of this partnership should be handled on a case-by-case basis and are not covered here.

In addition to a few extra requirements for creating orders and handling refunds, you must provide analytical reports to PayU, listing all the orders paid to the courier. These reports will then be matched against the transfers made by the courier company directly to PayU. Once PayU receives both the funds and the corresponding report, all orders are automatically captured, reported, and ready for payout, just like any other payment method.

Below is a simplified diagram outlining the steps required to capture a cash on delivery transaction. Note that there are three key participants: you (the merchant), the courier company, and PayU.

Notes

The interactions between merchant and courier company (steps 3 and 4) depend on bilateral agreement and integration between these two parties.


Report and funds transfer are sent for a batch and not for a single order.

After an order is completed, it can either be paid out or refunded. A detailed description of how to initiate a COD order, prepare and submit the report, and process a refund is provided below.

Creating Cash on Delivery order

Cash on Delivery is a distinct payType and must be explicitly specified when creating an order. This means the payment method, along with all required details, must be selected on your checkout page.

Availability on Payment Page

Cash on delivery payment method is not available on the payment page provided by the PayU.

Additional details required for Cash on Delivery orders include the delivery address and the shipping methods object. Both the delivery name and the shipping method name are string values (not enumerated), but they should be pre-agreed with PayU. Below are examples showing only the additional fields (for both standard and marketplace integrations).

Required Sections Example
{
//other fields required for order creation are skipped for brevity
"payMethods": {
"payMethod": {
"type": "PBL",
"value": "cod"
}
},
"deviceFingerprint": "hash",
"buyer": {
// other fields are skipped
"delivery": {
"street": "123 Main Street",
"postalCode": "00000",
"city": "Anytown",
"name": "Courier company name",
"countryCode": "RO", //valid ISO 3166-1 code
"recipientName": "Name Surname",
"recipientEmail": "some@email.com",
"recipientPhone": "+123 123123123"
}
},
"products": [
{
"name": "Mouse",
"unitPrice": 5500,
"quantity": 1,
"categoryName": "computer->peripherals",
"listingDate": "2025-04-01T12:00:00.000Z"
}
],
"shippingMethods": [
{
"country": "RO",
"name": "Courier company name",
"price": 0 //could be 0
}
]
}

Capturing Cash on Delivery Order

After creation, a Cash on Delivery order remains in PENDING status until PayU receives the funds from the courier company along with a corresponding analytical report. The report must be sent as a PGP-encrypted, zipped CSV file via email to the address provided by PayU. Below are the details for naming the email subject and the report file.

Email Subject Pattern

The email subject should follow format: COD_[currency code]_[identifier], where the identifier is the transfer title. For example, if the orders are in Romanian leu (RON) and the courier company uses a UUID as the transfer title, the subject could be: COD_RON_4712e91a-c18f-49d1-be81-162d5de7ab48.

File Name Pattern

The report file should be named using the following format: COD_[currency code]_[identifier].[file extension], where the identifier is the transfer title. For instance, if the orders are in Romanian leu (RON) and the courier company uses a UUID as the transfer title, the file name could be: COD_RON_4712e91a-c18f-49d1-be81-162d5de7ab48.gpg.

File Content Format

The following table outlines the format of the report file, including field names, example values, and descriptions.

Report Fields Description
Field NameExample ValueDescription
type
"TRANSACTION"
Currently always TRANSACTION.
payment_method
"CASH"
CASH or CARD, may be empty.
external_identifier
"<your id>"
Your id, for information purposes only, may be empty.
order_id
"<payu_order_id>"
Id of an order created in PayU system.
amount
"10000"
Amount in minor currency units (as in totalAmount provided for the order).
currency
"RON"
ISO 4217 code, e.g. EUR, RON.
reference_id
"4712e91a-c18f-49d1-be81-162d5de7ab48"
Title of transfer from courier company.

Transfer Name Format

The transfer should be titled using the following format: COD_[courier company name or abbreviation]_[UUID v4 identifier]. Assuming the courier company is called Speedy Gonzalez Services and abbreviated SGS, the file name could be: COD_SGS_4712e91a-c18f-49d1-be81-162d5de7ab48.

Report Encryption

PayU will provide a public key to be used for encrypting the CSV file. The CSV should first be zipped and then encrypted. If encryption is performed programmatically, it must be equivalent to using the gpg --encrypt command-line operation.

Creating a Refund for Cash on Delivery Order

A COD order cannot be refunded directly to the payment instrument, as is possible with online payments. Instead, refunds must be issued via bank transfer to an account provided by the buyer. Therefore, you are responsible for collecting the buyer's bank account number and billing address, and including them in the refund creation request.

For Your Information!

For security reasons, only domestic transfers are allowed.

For example, an order paid in RON can only be refunded to a bank account in Romania. For orders in EUR, any country using EUR as official currency is allowed.

Refund Request Body Example
{
"refund": {
//same as for standard refund
},
"bankAccount": {
"number": "PL82361283786702674167609144" //IBAN format, required
},
"customerAddress": {
//required
"name": "John Doe",
"street": "123 Main Street",
"postalCode": "00000",
"city": "Anytown",
"countryCode": "PL"
}
}

Testing Cash on Delivery

You can test the requests related to order and refund creation on the sandbox. All created orders are automatically reconciled and captured (sandbox simulates report and transfer submission every hour for all cash on delivery orders).

To test analytical report please contact the PayU technical .