The **PG Load **API allows you to create a credit transaction entry directly into the wallet without going through a payment gateway. This is useful for scenarios like cashback, rewards, or direct fund transfers.
Environment
Environment | URL |
---|---|
Test | https://apitest.payu.in/loyalty-points/v1/wallet/load-account |
Production | https://api.payu.in/loyalty-points/v1/wallet/load-account |
HTTP Method: PATCH
Request Headers
This API uses HMAC-SHA512 authentication on the header.
Parameter | Description |
---|---|
walletIdentifier mandatory |
String Program Type (e.g., CLW)
|
date mandatory |
String GMT formatted date (e.g., Thu, 17 Feb 2022 08:17:59 GMT)
|
Authorization mandatory |
String HMAC-SHA512-based authentication token
|
Content-Type mandatory |
String application/json
|
hmac authentication logic
hmac username="smsplus", algorithm="sha512", headers="date", signature="7ff938849aa79265a3de63fe241dfecb1c680f58c6d11e9f9ca08512afea374705eb9f8995ef6c4584e16eca2e1dc688262bb0937a36cc0f75ec22a9eea33523"
Where, the fields in this example are:
- username: The merchant key of the merchant.
- algorithm: This must have the value as hmac-sha512 that is used for this API.
- headers: This must have the value as date digest.
- signature: This must contain the hmacsha512 of (signing_string, merchant_secret), where:
- signing_string: It must be in the "date: {dateValue}"format. Here, the dateValue is the same values in the fields listed in this table For example, "date: Thu, 17 Feb 2022 08:17:59 GMT"
- merchant_secret: The merchant Salt of the merchant. For more information on getting the merchant Salt, refer to Generate Merchant Key and Salt.
Request Parameters
Body Parameters
The request body contains both encrypted and decrypted parameters.
Encrypted
Parameter | Description |
---|---|
tokenmandatory | String AES-192-CBC encrypted request body containing all the decrypted parameters |
Decrypted
Parameter | Description | Example |
---|---|---|
messageCodemandatory | Numeric(4) Load card request type code | 1080 |
clientTxnIdmandatory | Alphanumeric(14) Unique transaction ID for this request | Reload_V3_1234 |
requestDateTimemandatory | Numeric(14) Timestamp of the transaction (YYYYMMDDHHMMSS format) | 20230822183015 |
customerMobileconditional | Numeric(13) Customer's mobile number with country code | 919988776655 |
urnconditional | Numeric(11) Unique wallet reference number generated during wallet creation | 70000000008 |
transactionAmountmandatory | Numeric(12) Amount to load (expressed in implied decimals) | 1500 |
sourceTypemandatory | Numeric(2) Source of funding (0 = Wallet, 1 = Account) | 1 |
sendermandatory | String(100) Name identifying the funding source | Amazon |
fundFlowTypemandatory | String(20) Type of fund flow (I = Inward, O = Outward) | I |
implIdmandatory | String(100) Implementing identifier matching a mapped configuration | I|70190 |
implTypemandatory | String(100) Implementation type | PG_W2A_I |
Note: Either
customerMobile
orurn
must be provided.
Response Parameters
Parameter | Description | Example |
---|---|---|
responseCode | Response status code | 00 |
messageCode | Code indicating the load transaction's result | 1081 |
clientTxnId | Echoes the request's clientTxnId | Reload_V3_1234 |
urn | Wallet reference number | 1000019 |
accosaTransactionId | Internal transaction ID for this load | 1234567890 |
accosaRefNo | System-generated reference sequence | 20230822001 |
availableBalance | Updated wallet balance after the transaction | 1500 |
responseMessage | Response message | SUCCESS |
Sample Request
Encrypted Packet
curl --location --request PATCH 'https://apitest.payu.in/loyalty-points/v1/wallet/load-account' \
--header 'walletIdentifier: CLW' \
--header 'date: Wed, 12 Jun 2024 08:53:43 GMT' \
--header 'authorization: hmac username="smsplus", algorithm="sha512", headers="date", signature="hmac_generated_signature"' \
--header 'Content-Type: application/json' \
--data-raw '{
"token": "h/0YSUd9jKOQ8+2Dc3Phr4s7vxyz123..."
}'
Decrypted Packet
{
"messageCode": "1080",
"clientTxnId": "Reload_V3_1234",
"requestDateTime": "20230822183015",
"urn": 70000000008,
"transactionAmount": 1500,
"sourceType": 1,
"sender": "Amazon",
"fundFlowType": "I",
"implId": "I|70190",
"implType": "PG_W2A_I"
}
Sample Response
Encrypted Response
{
"result": "h/0YSUd9jKOQ8+2Dc3Phr4s7vxyz789..."
}
Decrypted Response
{
"responseCode": "00",
"messageCode": 1081,
"clientTxnId": "Reload_V3_1234",
"urn": 1000019,
"accosaTransactionId": 1234567890,
"accosaRefNo": 20230822001,
"availableBalance": 1500,
"responseMessage": "SUCCESS"
}
HTTP Status Codes
Status Code | Description |
---|---|
200 | OK - Request processed successfully |
400 | Bad Request - Invalid request parameters |
401 | Unauthorized - Authentication failed |
404 | Not Found - Wallet not found |
500 | Internal Server Error |
Error Codes
Error Code | Description |
---|---|
1081 | Load transaction successful |
1010 | Invalid message code |
1020 | Missing required parameters |
1040 | Wallet not found |
1050 | Transaction limit exceeded |