Joe Public would like to pay his electricity bill. He logs in to an online system of his electricity provider. He selects PayU payment provider to make the payment by card or pay-by-link. PayU transfers the payment to a Joe Public’s individual account created in the electricity provider’s system. Then the electricity provider’s billing system records the funds to the Joe Public’s individual account.
Mass Collect is based on regular PayU integration involving REST API described in:
Creating a new order. The targetAccount
field
serves as the extension. It is added to the OrderCreateRequest message that provides
PayU with the user’s individual account to transfer the funds.
Sample order with basic buyer details, external identifier (extOrderId
) and target
account (targetAccount
):
curl -v -X POST https://secure.payu.com/api/v2_1/orders \ -H "Content-Type: application/json" \ -H "Authorization: Bearer 0089270b-5027-42f1-8f51-8a47fe99d9cd" \ -d '{ "notifyUrl":"https://your.eshop.com/notify", "customerIp":"127.0.0.1", "merchantPosId":"199022", "description":"Invoice payment ", "additionalDescription":"1111/01/02/2017", "currencyCode":"PLN", "totalAmount":"15000", "extOrderId":"[generateExtOrderId]", "targetAccount":"PL23080049181648726886601824", "products":[ { "name":"Invoice payment", "unitPrice":"15000", "quantity":"1" } ], "buyer": { "email": "john.doe@example.com", "phone": "654111654", "firstName": "John", "lastName": "Doe" } }'
Authentication methods are described in: Signing API calls parameters.
Mass Collect is based on regular PayU integration involving REST API described in:
Creating a new order.. The
targetAccounts
list serves as the extension. It is added to the
OrderCreateRequest message that provides PayU with the user’s individual
accounts to transfer the funds (maximum number of individual accounts in
targetAccounts
list is 5).
Sample order with basic buyer details, external identifier (extOrderId
) and three
target accounts (targetAccounts
):
curl -v -X POST https://secure.payu.com/api/v2_1/orders \ -H "Content-Type: application/json" \ -H "Authorization: Bearer 0089270b-5027-42f1-8f51-8a47fe99d9cd" \ -d '{ "notifyUrl":"https://your.eshop.com/notify", "customerIp":"127.0.0.1", "merchantPosId":"199022", "description":"Payment for ", "additionalDescription":"gas, electricity", "currencyCode":"PLN", "totalAmount":"15000", "extOrderId":"[generateExtOrderId]", "targetAccounts":[ { "account":"PL23080049181648726886601824", "amount":"5000", "description":"Internal payment distribution AAA" }, { "account":"PL83520640964843486631050632", "amount":"8000", "description":"Internal payment distribution BBB" }, { "account":"PL42718382961584083942417177", "amount":"2000", "description":"Internal payment distribution CCC" } ], "products":[ { "name":"Invoice payment XXX", "unitPrice":"10000", "quantity":"1" }, { "name":"Invoice payment YYY", "unitPrice":"5000", "quantity":"1" } ], "buyer": { "email": "john.doe@example.com", "phone": "654111654", "firstName": "John", "lastName": "Doe" } }'
totalAmount
) is equal to sum of indicated
amounts for target accounts,targetAccounts
list,products
don’t
have to be equal; such option enables possibility to agregate payments from
individual products or split user's payment into internal subaccounts, as
well as external accountstargetAccounts.description
will be added to the defining
payment title template. Thanks to this attribute every title can be named
individually. Incoming operation titles (payments to the bank accounts given in the
Order) for above specified Order, for template:
description(40characters),targetAccounts.description(40characters),buyer's details(40characters)are presented as follows:
It should be noted that three bank accounts are used in this example, because of this there will be three different bank statements.
Authentication methods can be found at: User's API authentication.
StatusCode | Code | CodeLiteral | Opis |
---|---|---|---|
ERROR_VALUE_INVALID | TARGET_ACCOUNT_NOT_ON_WHITELIST | 8308 | Target account is not on the whitelist. |
ERROR_VALUE_INVALID | TOO_MANY_ITEMS_IN_TARGET_ACCOUNTS | 8312 | "Too many items in "targetAccounts" list. |
PayU may set payout title basing on data received in Order or/and data received from bank.
It must be clearly stated, that actual data depends on bank used in payment process. Special characters can be substituted by PayU bank and target bank.
Order.description
(trimmed to 50 characters) +
Order.additionalDescription
(trimmed to 50 characters),
then it is trimmed to 60 characters targetAccounts.description
field).Specific payout title needs configuration at PayU side.