Retrieving Shop Data
Getting shopId
To retrieve specific information about a shop using PayU's API, you will require the shopId
parameter, which can be found in the management panel. To access this information, navigate to the shop tile and select the name of the corresponding shop.
Once you've selected the name of the desired shop in the management panel, you will be directed to the shop details tab. Here, you can locate and copy the Shop ID value.
With the acquired shopId
, you can now proceed to retrieve the necessary data required for the payout process.
Authenticating the Request
To ensure successful retrieval of shop data through the API, you must first generate an OAuth token using the client_credentials
type for authentication purposes. This token should be generated utilizing the configuration keys specific to the Point of Sale (POS) linked to the particular shop you wish to access data from.
Retrieving Shop Data
To obtain specific data for a particular shop, you can initiate an HTTP GET request to the following endpoint: /api/v2_1/shops/{shopId}
. Make sure to replace {shopId}
with the actual Shop ID you obtained from the shop details tab in the management panel.
curl -X GET https://secure.snd.payu.com/api/v2_1/shops/QFw0KGSX \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer 3e5cac39-7e38-4139-8fd6-30adc06a61bd'
{
"shopId": "QFw0KGSX",
"name": "Shop Checkout",
"currencyCode": "PLN",
"balance": {
"currencyCode": "PLN",
"total": "220839",
"available": "220839"
}
}
Upon successfully retrieving the shop data through the API, you will be provided with essential information, including the shop identifier, shop name, and the balance object, which encompasses parameters required for specific payout requests:
total
- denotes the current balance of the shop.available
- signifies the available funds on the shop's balance after deducting the payout block/reserve.
These two parameters, along with the shopId
, play a crucial role in initiating a payout request and facilitating the withdrawal of funds from the shop's account.
Now that you have the capability to retrieve the shop data, you may proceed with creating a payout request.