### Filter Installment Options by Program Source: https://developers.payu.com/europe/docs/payment-solutions/cards/card-installments Add the `cardInstallmentsOptions` to the settings object to filter available installment options for specific card programs. The displayed options will be an intersection of BIN-based installments and your configured filters. ```json { "settings": { "cardInstallmentsOptions": { "ALPHABANK_INSTALLMENTS": [1, 3, 5, 7, 9, 11, 13], "RAIFFEISEN": [1, 6, 12], "STAR_BT": [6, 20, 21] } } } ``` -------------------------------- ### Request Example for Retrieving Order Data Source: https://developers.payu.com/europe/docs/payment-flows/auth-and-order Use this cURL command to send a GET request to retrieve specific order details. Ensure the Authorization header includes a valid token. ```bash curl -X GET https://secure.payu.com/api/v2_1/orders/{orderId} \ -H "Content-Type: application/json" \ -H "Authorization: Bearer 3e5cac39-7e38-4139-8fd6-30adc06a61bd" \ ``` -------------------------------- ### Response Example for Retrieving Shop Data Source: https://developers.payu.com/europe/docs/payouts/payouts-api/shop-retrieve This is an example of a successful response when retrieving shop data. It includes the shop's ID, name, and balance information. ```json { "shopId": "QFw0KGSX", "name": "Shop Checkout", "currencyCode": "PLN", "balance": { "currencyCode": "PLN", "total": "220839", "available": "220839" } } ``` -------------------------------- ### Response Example with Multi-use Token Source: https://developers.payu.com/europe/docs/payment-solutions/cards/tokenization/create-token This is an example response from the API after a successful order creation that includes tokenization. The `payMethods.payMethod.value` field will contain the multi-use token (TOKC_) if tokenization was successful. ```json { "status": { "statusCode": "WARNING_CONTINUE_3DS", "severity": "WARNING" }, "redirectUri": "{redirectUri}", "iframeAllowed": true, "threeDsProtocolVersion": "3DS2", "orderId": "ORDER_ID", "payMethods": { "payMethod": { "card": { "number": "424242******4242", "expirationMonth": "12", "expirationYear": "2017" }, "type": "CARD_TOKEN", "value": "TOKC_KPNZVSLJUNR4DHF5NPVKDPJGMX7" } } } ``` -------------------------------- ### Create Order Request with 3DS 2 Data (Sandbox) Source: https://developers.payu.com/europe/docs/card-payments/threeds/api-enhancements This example demonstrates creating an order with 3DS 2 fields for the sandbox environment. Note the different endpoint and authorization token compared to the production example. ```curl curl -X POST https://secure.snd.payu.com/api/v2_1/orders \ -H "Content-Type: application/json" \ -H "Authorization: Bearer d9a4536e-62ba-4f60-8017-6053211d3f47" \ -d '{ "continueUrl": "http://www.payu.pl", "customerIp": "216.72.35.5", "merchantPosId": "300746", "description": "Order with 3DS 2 required fields", "currencyCode": "PLN", "totalAmount": 300, "products": [ { "name": "a product", "unitPrice": 300, "quantity": 1 } ], "buyer": { "firstName": "John", "lastName": "Doe", "phone": "+48 555555555", "email": "john@doe.pl", "delivery": { "street": "Delivery St. 1", "postalCode": "55033", "city": "Delivery Town", "state": "30", "countryCode": "PL" } }, "threeDsAuthentication": { "cardholder": { "name": "Joe Doe", "billingAddress": { "street": "Billing St. 1", "postalCode": "33055", "city": "Billington", "state": "30", "countryCode": "PL" } }, "browser": { "acceptHeaders": "*/*", "screenWidth": "1536", "javaEnabled": false, "timezoneOffset": "-120", "screenHeight": "864", "requestIP": "216.72.35.5", "language": "en", "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0", "colorDepth": "24" } } }' ``` -------------------------------- ### Create Multi-use Token Request Example Source: https://developers.payu.com/europe/docs/payment-solutions/cards/tokenization/create-token This example demonstrates how to make a POST request to the /orders endpoint to create a multi-use token without an immediate purchase. Key parameters include `totalAmount` set to '0', `currencyCode`, `cardOnFile` set to 'FIRST', and the `payMethods` object containing a single-use token (TOK_). ```APIDOC ## POST /api/v2_1/orders ### Description Initiates an order request to create a multi-use token (TOKC_) without charging the customer. This is useful for storing card details for future transactions. ### Method POST ### Endpoint https://secure.payu.com/api/v2_1/orders ### Parameters #### Request Body - **notifyUrl** (string) - Required - The URL where PayU will send payment status notifications. - **customerIp** (string) - Required - The IP address of the customer. - **merchantPosId** (string) - Required - The ID of the PayU Point of Sale. - **description** (string) - Required - A description of the order. - **currencyCode** (string) - Required - The currency code for the transaction (e.g., PLN). - **totalAmount** (string) - Required - Set to "0" to indicate no charge during token creation. - **cardOnFile** (string) - Required - Set to "FIRST" for multi-use token creation. - **extOrderId** (string) - Required - An external order ID for reference. - **buyer** (object) - Required - Information about the buyer. - **extCustomerId** (string) - Required - External customer ID. - **email** (string) - Required - Customer's email address. - **firstName** (string) - Required - Customer's first name. - **lastName** (string) - Required - Customer's last name. - **language** (string) - Required - Customer's preferred language. - **payMethods** (object) - Required - Payment method details. - **payMethod** (object) - Required - Specific payment method. - **value** (string) - Required - The single-use token (TOK_) used to initiate multi-use token creation. - **type** (string) - Required - Must be "CARD_TOKEN". - **deviceFingerprint** (string) - Optional - The device fingerprint for fraud detection. ### Request Example ```json { "notifyUrl":"https://your.eshop.com/notify", "customerIp":"127.0.0.1", "merchantPosId":"145227", "description":"Laptop", "currencyCode":"PLN", "totalAmount":"0", "cardOnFile": "FIRST", "extOrderId":"4ifibqsc9nwkvanq6rcfm9", "buyer": { "extCustomerId": "id_12345", "email": "john.doe@example.com", "firstName": "John", "lastName": "Doe", "language": "en" }, "payMethods": { "payMethod": { "value": "TOK_1IHRPT6HKSSS3H62K0GS8pElP862", "type": "CARD_TOKEN" } }, "deviceFingerprint": "3707dda5515f445886e3b6fff404039b" } ``` ### Response #### Success Response (200) - **status** (object) - The status of the order processing. - **statusCode** (string) - The status code (e.g., "WARNING_CONTINUE_3DS"). - **severity** (string) - The severity of the status (e.g., "WARNING"). - **redirectUri** (string) - The URI for redirection if further action is needed (e.g., 3DS authentication). - **iframeAllowed** (boolean) - Indicates if the response can be displayed in an iframe. - **threeDsProtocolVersion** (string) - The version of the 3DS protocol used. - **orderId** (string) - The unique ID of the created order. - **payMethods** (object) - Details of the payment method, including the newly created multi-use token. - **payMethod** (object) - **card** (object) - Card details (masked). - **number** (string) - Masked card number. - **expirationMonth** (string) - Card expiration month. - **expirationYear** (string) - Card expiration year. - **type** (string) - The type of payment method (e.g., "CARD_TOKEN"). - **value** (string) - The newly created multi-use token (TOKC_). #### Response Example ```json { "status": { "statusCode": "WARNING_CONTINUE_3DS", "severity": "WARNING" }, "redirectUri": "{redirectUri}", "iframeAllowed": true, "threeDsProtocolVersion": "3DS2", "orderId": "ORDER_ID", "payMethods": { "payMethod": { "card": { "number": "424242******4242", "expirationMonth": "12", "expirationYear": "2017" }, "type": "CARD_TOKEN", "value": "TOKC_KPNZVSLJUNR4DHF5NPVKDPJGMX7" } } } ``` ``` -------------------------------- ### Marketplace Order Request Example Source: https://developers.payu.com/europe/docs/services/marketplace/integration Use this example to create a marketplace order where a customer buys multiple products from different sub-merchants in a single transaction. Ensure all required fields are populated correctly. ```curl curl -v -X POST https://secure.payu.com/api/v2_1/orders \ -H "Content-Type: application/json" \ -H "Authorization: Bearer " \ -d '{ "merchantPosId":"341009", "customerIp": "127.0.0.1", "continueUrl": "http://your.eshop.com/continue", "notifyUrl": "https://your.eshop.com/notify", "currencyCode": "PLN", "totalAmount": 5000, "extOrderId": "marketplace-order-xyz-123", "description": "order XYZ-123", "additionalDescription": "additional description", "buyer": { "email": "john.doe@email.com", "phone": "(012)1234567", "firstName": "John", "lastName": "Doe", "language": "pl", "extCustomerId": "john-doe-12345" }, "shoppingCarts": [ { "extCustomerId": "marketplace-submerchant-1", "amount": 200, "fee": 20, "products": [ { "name": "product A", "quantity": 2, "unitPrice": 100, "virtual": false } ] }, { "extCustomerId": "marketplace-submerchant-2", "amount": 1300, "products": [ { "name": "product B", "quantity": 2, "unitPrice": 200, "virtual": false }, { "name": "product C", "quantity": 3, "unitPrice": 300, "virtual": false } ] }, { "extCustomerId": "marketplace-submerchant-3", "amount": 3500, "fee":350, "products": [ { "name": "product D", "quantity": 1, "unitPrice": 3500, "virtual": false } ] } ] }' ``` -------------------------------- ### Full Example: CSS Styling Source: https://developers.payu.com/europe/docs/services/marketplace/sdk/uploading-files CSS styles for the file upload component and its container. These styles are specific to the example's layout and appearance. ```css .container * { font-family: Arial, Helvetica, sans-serif; } .container { text-align: center; width: 420px; margin: 20px auto 10px; display: block; border-radius: 5px; box-sizing: border-box; } .form-container { width: 100%; margin: 0 auto; border-radius: 6px; padding: 10px; background: rgb(2, 0, 60); text-align: left; box-sizing: border-box; } .form-container aside, .form-container #responseUpload { padding-bottom: 6px; font-size: 14px; color: #ffffff; } .payu-document-upload-button { background: #438F29; cursor: pointer; width: 100%; height: 40px; border: 1px solid white; border-radius: 5px; color: rgb(2, 0, 60); font-size: 22px; } #uploadButton { border: none; background: #438F29; padding: 8px 15px; margin: 10px auto; cursor: pointer; } ``` -------------------------------- ### Fx-Payout Response Example Source: https://developers.payu.com/europe/docs/payouts/payouts-api/fx-payout Example of a successful response when retrieving the fx-payout rate table. It includes the table ID, validity period, and currency pairs with their exchange rates. ```json { "id": "3050", "validTo": "2024-05-12T20:20:00Z", "currencyPairs": [ { "baseCurrency": "EUR", "exchangeRate": 4.2556, "termCurrency": "PLN" } ... ] } ``` -------------------------------- ### Retrieve Payment Methods Response Example Source: https://developers.payu.com/europe/docs/payment-solutions/cards/tokenization/retrieve-and-delete-token This JSON object shows an example response when retrieving payment methods. It includes arrays for 'cardTokens' and 'payByLinks', detailing available payment options. ```json { "cardTokens": [ { "cardExpirationYear": "2017", "cardExpirationMonth": "12", "cardNumberMasked": "411111******1111", "cardBrand": "VISA", "value": "TOKC_XATB7DF8ACXYTVQIPLWTVPFRKQE", "brandImageUrl": "http://static.payu.com/images/mobile/visa.png", "preferred": true, "status": "ACTIVE" }, { "cardExpirationYear": "2014", "cardExpirationMonth": "12", "cardNumberMasked": "424242******4242", "cardBrand": "VISA", "value": "TOKC_XATB7DF8ACXYTVQIPLWTVPFRKQE", "brandImageUrl": "http://static.payu.com/images/mobile/visa.png", "preferred": false, "status": "EXPIRED" } ], "payByLinks": [ { "value": "c", "name": "Płatność online kartą płatniczą", "brandImageUrl": "http://static.payu.com/images/mobile/logos/pbl_c.png", "status": "ENABLED", "minAmount": 50, "maxAmount": 100000 }, { "value": "o", "name": "Pekao24Przelew", "brandImageUrl": "http://static.payu.com/images/mobile/logos/pbl_o.png", "status": "DISABLED", "minAmount": 50, "maxAmount": 100000 }, { "value": "ab", "name": "Płacę z Alior Bankiem", "brandImageUrl": "http://static.payu.com/images/mobile/logos/pbl_ab.png", "status": "TEMPORARY_DISABLED", "minAmount": 50, "maxAmount": 100000 } ] } ``` -------------------------------- ### White Label Marketplace Order Request Example Source: https://developers.payu.com/europe/docs/services/marketplace/integration This example demonstrates a white-label marketplace order request, including the `payMethods` section to specify the chosen payment method. This is useful when you want to control the payment experience more directly. ```curl curl -v -X POST https://secure.payu.com/api/v2_1/orders \ -H "Content-Type: application/json" \ -H "Authorization: Bearer " \ -d '{ "merchantPosId":"341009", "customerIp": "127.0.0.1", "continueUrl": "http://your.eshop.com/continue", "notifyUrl": "https://your.eshop.com/notify", "currencyCode": "PLN", "totalAmount": 5000, "extOrderId": "marketplace-order-xyz-123", "description": "order XYZ-123", "additionalDescription": "additional description", "buyer": { "email": "john.doe@email.com", "phone": "(012)1234567", "firstName": "John", "lastName": "Doe", "language": "pl", "extCustomerId": "john-doe-12345" }, "shoppingCarts": [ { "extCustomerId": "marketplace-submerchant-1", "amount": 200, "fee": 20, "products": [ { "name": "product A", "quantity": 2, "unitPrice": 100, "virtual": false } ] }, { "extCustomerId": "marketplace-submerchant-2", "amount": 1300, "products": [ { "name": "product B", "quantity": 2, "unitPrice": 200, "virtual": false }, { "name": "product C", "quantity": 3, "unitPrice": 300, "virtual": false } ] }, { ``` -------------------------------- ### Payout Creation Response Example Source: https://developers.payu.com/europe/docs/payouts/payouts-api/standard-payout This is an example of a successful response when creating a payout. It includes details such as the payout ID, external payout ID, and the status of the operation. ```json { "payout": { "payoutId": "133bfe5f400e4b2c8da44abfdf753d79", "extPayoutId": "123123", "status": "PENDING" }, "status": { "statusCode": "SUCCESS" } } ``` -------------------------------- ### Modal Window Example for Iframe Source: https://developers.payu.com/europe/docs/card-payments/threeds/auth-page Example of embedding the PayU authentication page within an iframe in a modal window on your website. ```html ``` -------------------------------- ### CSV File Row Example (Full Data) Source: https://developers.payu.com/europe/docs/services/cards-import An example of a CSV file row containing all possible data fields for payment card import, including optional fields like Initial Transaction ID and Authentication Level. ```csv John,Doe,4111111111111111,12,2031,john.doe@example.com,cust123,485161313910626,FULL_AUTHENTICATION,MIT ``` -------------------------------- ### 3DS Authentication Success URL Example Source: https://developers.payu.com/europe/docs/payment-solutions/cards/tokenization/charge-token This URL is an example of the redirection back to your shop after successful 3DS authentication. It includes status and reference ID parameters. ```url https://your.shop.com/payment?statusCode=SUCCESS&refReqId=5c867936fbb3cc2c373820b4550b4645 ``` -------------------------------- ### API Response for Installment Options Source: https://developers.payu.com/europe/docs/payment-solutions/cards/card-installments This is an example response from the card installments API, detailing the available installment numbers, the provider, and optional settings such as `minAmount` for a plan. ```json { "numbers": [1, 6, 12, 20, 21, 22, 23, 24], "provider": "BRD_INSTALLMENTS", "settings": { "minAmount": 60000 } } ``` -------------------------------- ### Create Order with Multi-use Token Source: https://developers.payu.com/europe/docs/payment-solutions/cards/tokenization/create-token This example demonstrates how to create an order and generate a multi-use token by setting `cardOnFile` to `FIRST`. The generated token (e.g., TOKC_) can be used for subsequent merchant-initiated transactions. ```APIDOC ## POST /api/v2_1/orders ### Description Creates a new order and generates a multi-use token for future payments. ### Method POST ### Endpoint https://secure.payu.com/api/v2_1/orders ### Parameters #### Request Body - **notifyUrl** (string) - Required - The URL to which PayU sends payment status notifications. - **customerIp** (string) - Required - The IP address of the customer. - **merchantPosId** (string) - Required - The ID of the PayU Merchant Point of Sale. - **description** (string) - Required - A description of the order. - **currencyCode** (string) - Required - The currency code for the order (e.g., PLN). - **totalAmount** (string) - Required - The total amount of the order. - **cardOnFile** (string) - Required - Set to "FIRST" to create a multi-use token. - **extOrderId** (string) - Required - An external order ID. - **products** (array) - Required - A list of products in the order. - **name** (string) - Required - The name of the product. - **unitPrice** (string) - Required - The unit price of the product. - **quantity** (string) - Required - The quantity of the product. - **buyer** (object) - Required - Information about the buyer. - **extCustomerId** (string) - Required - An external customer ID. - **email** (string) - Required - The buyer's email address. - **firstName** (string) - Required - The buyer's first name. - **lastName** (string) - Required - The buyer's last name. - **language** (string) - Required - The buyer's language. - **payMethods** (object) - Required - Payment method details. - **payMethod** (object) - Required - Specific payment method details. - **value** (string) - Required - The payment method value (e.g., authorization code for Google Pay/Apple Pay). - **type** (string) - Required - The payment method type (e.g., "PBL" for Pay By Link). - **authorizationCode** (string) - Required - Authorization code for payment methods like Google Pay or Apple Pay. - **deviceFingerprint** (string) - Optional - The device fingerprint. ### Request Example ```json { "notifyUrl":"https://your.eshop.com/notify", "customerIp":"127.0.0.1", "merchantPosId":"145227", "description":"Laptop", "currencyCode":"PLN", "totalAmount":"15000", "cardOnFile": "FIRST", "extOrderId":"g1d5q9lpxz5rg556qiue0q", "products":[ { "name": "Laptop", "unitPrice":"15000", "quantity": "1" } ], "buyer": { "extCustomerId": "id_12345", "email": "john.doe@example.com", "firstName": "John", "lastName": "Doe", "language": "en" }, "payMethods": { "payMethod": { "value": "ap", "type": "PBL", "authorizationCode": "eyJzaWduYXR1cmUiOiJNRVVDSVFEWTN3QlF5SEI0c1pja3RSb0pYS3htK09MY2pIekN2ZERlR24yM29YMGtrd0lnS3puUkZaWkwrc0RNdjFiNWN1RCtZdXJYTVpyYVlCc3I5aGJyYXZWWTVSb1x1MDAzZCIsInByb3RvY29sVmVyc2lvbiI6IkVDdjEiLCJzaWduZWRNZXNzYWdlIjoie1wiZW5jcnlwdGVkTWVzc2FnZVwiOlwiY0k4N3RMcXpxVEd5Q0ZuTU1DVldjVEh3M3hoWUlLK0NFbnVRNzRLK25sTHBDZ09sZnBTY2liOWpkczRzeER0TjZDdW5DcUNTTWZkLzN5SGVlUnk2YUN4MXl5cWNUNGV5Nk51ZWVCem5wckpwa21WVmdJMUpIV0xRdDRoekFYTVVBY1lBU1lMT2FiS1A5ZlVadkhrT0JEeXRENTMxanB6TlhhK1NwYy96cnBHekZLeDJDNFZVOXNDOTVxOWkrZXkra3I3Wk1OVkNPRkpQV1h1N2xLWjEwNUlPT3Fveko2LzcwTUtteFAzak04OWVlcSsvMTlRbnlIalFMWGZuUVB2UWppVUpLR0NjUktETGxyYjNYb1k1WlVVekdmTjVlWkNMekNWZzBoV0Vid1UrNko3S1dZSnlXK1dyMXI4YmFnTjl6V3NyTUtoRHBzUWJIZnl6Yit5QnpGVW94ZVVnTDRhN0ZlVnZFbGxJY0h0cXN2VENmNkZFTlYyMGFGNVZMRHY1cXpVa1YrUHpUQUliRkV1YWJBMEdvZDlVYlZDVlZ2N25NOFFGenZSUGh6WVlGVkZUbjRKSHZMMnFaNHBBUjlsRSt3XFx1MDAzZFxcdTAwM2RcIixcImVwaGVtZXJhbFB1YmxpY0tleVwiOlwiQlBITEM0c0JIcGVuWTFNMGl4bWlETXVXSlRhVEpPcWdnUlV3dGdCSk1jQnAyOFZzeEhEN3pQSTc5ODV4NEY1RWpNUDV5OGovY3VVemJlL2NHUGpPS0drXFx1MDAzZFwiLFwidGFnXCI6XCJSYVhyUE9VdWM1aXczb3hEYTBDMk1PamFLeGd4SVJRdndPc3BtdEZWMHpVXFx1MDAzZFwifSJ9 } }, "deviceFingerprint": "1436437b3265e8311c0495a233dcd0a7" } } ``` ### Response #### Success Response (200) - **status** (object) - The status of the order processing. - **statusCode** (string) - The status code (e.g., "WARNING_CONTINUE_3DS"). - **severity** (string) - The severity of the status (e.g., "WARNING"). - **redirectUri** (string) - The URI to redirect the user for payment. - **iframeAllowed** (boolean) - Indicates if the payment can be processed within an iframe. - **threeDsProtocolVersion** (string) - The version of the 3D Secure protocol used. - **orderId** (string) - The unique ID of the order. - **payMethods** (object) - Details about the payment methods used. - **payMethod** (object) - Specific payment method details. - **card** (object) - Card details (masked). - **number** (string) - Masked card number. - **expirationMonth** (string) - Card expiration month. - **expirationYear** (string) - Card expiration year. - **type** (string) - The type of payment method (e.g., "CARD_TOKEN"). - **value** (string) - The generated multi-use token (e.g., "TOKC_KPNZVSLJUNR4DHF5NPVKDPJGMX7"). #### Response Example ```json { "status": { "statusCode": "WARNING_CONTINUE_3DS", "severity": "WARNING" }, "redirectUri": "{redirectUri}", "iframeAllowed": true, "threeDsProtocolVersion": "3DS2", "orderId": "ORDER_ID", "payMethods": { "payMethod": { "card": { "number": "424242******4242", "expirationMonth": "12", "expirationYear": "2017" }, "type": "CARD_TOKEN", "value": "TOKC_KPNZVSLJUNR4DHF5NPVKDPJGMX7" } } } ``` ``` -------------------------------- ### Full Example: JavaScript Logic Source: https://developers.payu.com/europe/docs/services/marketplace/sdk/uploading-files JavaScript code to initialize the PayuDocumentForm, handle events, and render the upload component. Ensure the SDK script is loaded before this code. ```javascript window.addEventListener('DOMContentLoaded', function () { const df = PayuDocumentForm({verificationId: 'marketplace-verification-id'}, {dev: true}); df .on('ready', () => { console.log('Ready'); }); df .on('select', (response) => { if (response.status === 'SUCCESS') { document.getElementById('responseUpload').innerText = 'File: ' + response.body.name + ', size: ' + response.body.size + ', type: ' + response.body.type; } else { alert('Error. ' + JSON.stringify(response.error)); } }); df .on('upload', (response) => { if (response.status === 'SUCCESS') { alert('File loaded. fileId=[' + response.body.fileId + '], verificationId=[' + response.body.verificationId + ']'); } else { alert('Error. ' + JSON.stringify(response.error)); } }); const documentFormOptions = { title: 'Add or drop file here' }; df.render('#payuDocumentUpload', documentFormOptions); }); ``` -------------------------------- ### Installments Change Event Payload Source: https://developers.payu.com/europe/docs/payment-solutions/cards/card-installments This is an example payload for the `installmentsChange` event, which is triggered after the buyer enters the first 10 digits of their card BIN. It contains available installment plans and settings like `minAmount`. ```json { "numbers": [1, 2, 4, 6, 8, 12], "provider": "BRD_INSTALLMENTS", "settings": { "minAmount": 60000 } } ``` -------------------------------- ### BLIK PAYID Token Structure Source: https://developers.payu.com/europe/docs/payment-solutions/blik/support-services Example structure of a returned BLIK PAYID token, used for BLIK Recurring payments. This includes details for recurring payment setup. ```json "blikTokens": [ { "value": "", "type": "PAYID", "brandImageUrl": "", "bankApplicationReferences": [ { "key": "", "label": "" }, { "key": "", "label": "" } ], "recurring": { "aliasLabel": "", "type": "O", "initializationDate": "", "expirationDate": "" } } ] ``` -------------------------------- ### Shop Creation Response Source: https://developers.payu.com/europe/docs/collaboration/referral-program Example JSON response after creating a shop, containing the `shopId` needed for POS creation. ```json { "shopId": "ycmGyfCv" } ``` -------------------------------- ### Full Example: HTML Structure Source: https://developers.payu.com/europe/docs/services/marketplace/sdk/uploading-files HTML structure for the file upload interface, including script inclusion and element placeholders. ```html
``` -------------------------------- ### Create Order with Card Installments Source: https://developers.payu.com/europe/docs/payment-solutions/cards/card-installments Include the `cardInstallments` object within the `payMethod` section of the request body to create an order with installment payments. This requires a card token and specifies the installment provider and number. ```json { "payMethods": { "payMethod": { "amount": 245, "currencyCode": "RON", "type": "CARD_TOKEN", "value": "TOKC_TB4P9IBWFOCOUS1REDFK75S1XCK", "cardInstallments": { "provider": "STAR_BT", "number": 12 } } } } ``` -------------------------------- ### Retrieve Order Data Source: https://developers.payu.com/europe/docs/payment-flows/auth-and-order You can retrieve order data by sending a GET request to the `api/v2_1/orders/{orderId}` endpoint. In response, you will get an object with data for the specified `orderId`. Note that GET requests should not include a request body. ```APIDOC ## GET /api/v2_1/orders/{orderId} ### Description Retrieves detailed information about a specific order using its unique identifier. ### Method GET ### Endpoint `/api/v2_1/orders/{orderId}` ### Parameters #### Path Parameters - **orderId** (string) - Required - The unique identifier of the order to retrieve. ### Request Example ```curl curl -X GET https://secure.payu.com/api/v2_1/orders/{orderId} \ -H "Content-Type: application/json" \ -H "Authorization: Bearer 3e5cac39-7e38-4139-8fd6-30adc06a61bd" ``` ### Response #### Success Response (200) - **orders** (array) - An array containing the order object(s). - **orderId** (string) - The unique identifier of the order. - **extOrderId** (string) - The external order identifier. - **orderCreateDate** (string) - The date and time the order was created. - **notifyUrl** (string) - The URL for order notifications. - **customerIp** (string) - The IP address of the customer. - **merchantPosId** (string) - The merchant's Point of Sale ID. - **description** (string) - A description of the order. - **currencyCode** (string) - The currency code for the order amount. - **totalAmount** (string) - The total amount of the order. - **status** (string) - The current status of the order. - **products** (array) - An array of products included in the order. - **name** (string) - The name of the product. - **unitPrice** (string) - The unit price of the product. - **quantity** (string) - The quantity of the product. - **status** (object) - An object containing the status of the request. - **statusCode** (string) - The status code of the request (e.g., "SUCCESS"). - **statusDesc** (string) - A description of the request status. - **properties** (array) - An array of properties associated with the order. - **name** (string) - The name of the property. - **value** (string) - The value of the property. #### Response Example ```json { "orders": [ { "orderId": "{orderId}", "extOrderId": "358766", "orderCreateDate": "2014-10-27T14:58:17.443+01:00", "notifyUrl": "http://localhost/OrderNotify/", "customerIp": "127.0.0.1", "merchantPosId": "145227", "description": "New order", "currencyCode": "PLN", "totalAmount": "3200", "status": "NEW", "products": [ { "name": "Product1", "unitPrice": "1000", "quantity": "1" }, { "name": "Product2", "unitPrice": "2200", "quantity": "1" } ] } ], "status": { "statusCode": "SUCCESS", "statusDesc": "Request processing successful" }, "properties": [ { "name": "PAYMENT_ID", "value": "1234567890" } ] } ``` ``` -------------------------------- ### BLIK Positive Response Example Source: https://developers.payu.com/europe/docs/payment-solutions/blik/integration Example of a successful response when an order is created via BLIK. ```APIDOC ## BLIK Positive Response ### Description This is a successful response indicating that an order has been created. ### Response Example ```json { "status": { "statusCode": "SUCCESS" }, "orderId": "" } ``` ``` -------------------------------- ### Create Order Request with 3DS 2 Data (Production) Source: https://developers.payu.com/europe/docs/card-payments/threeds/api-enhancements Use this example to create an order with minimum required data and 3DS 2 standard fields for the production environment. Ensure all fields, especially those within 'threeDsAuthentication', are correctly populated. ```curl curl -X POST https://secure.payu.com/api/v2_1/orders \ -H "Content-Type: application/json" \ -H "Authorization: Bearer 3e5cac39-7e38-4139-8fd6-30adc06a61bd" \ -d '{ "continueUrl": "http://www.payu.pl", "customerIp": "216.72.35.5", "merchantPosId": "145227", "description": "Order with 3DS 2 required fields", "currencyCode": "PLN", "totalAmount": 300, "products": [ { "name": "a product", "unitPrice": 300, "quantity": 1 } ], "buyer": { "firstName": "John", "lastName": "Doe", "phone": "+48 555555555", "email": "john@doe.pl", "delivery": { "street": "Delivery St. 1", "postalCode": "55-033", "city": "Delivery Town", "state": "30", "countryCode": "PL" } }, "threeDsAuthentication": { "cardholder": { "name": "Joe Doe", "billingAddress": { "street": "Billing St. 1", "postalCode": "33-055", "city": "Billington", "state": "30", "countryCode": "PL" } }, "browser": { "acceptHeaders": "*/*", "screenWidth": "1536", "javaEnabled": false, "timezoneOffset": "-120", "screenHeight": "864", "requestIP": "216.72.35.5", "language": "en", "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0", "colorDepth": "24" } } }' ``` -------------------------------- ### BLIK Negative Response Example Source: https://developers.payu.com/europe/docs/payment-solutions/blik/integration Example of a negative response when an error occurs during BLIK order creation. ```APIDOC ## BLIK Negative Response ### Description This response indicates an error occurred during the BLIK order creation process. ### Response Example ```json { "status": { "statusCode": "", "codeLiteral": "", "statusDesc": "" }, "orderId": "", "blikData": { "//": "specific data dependent on the particular error" } } ``` ``` -------------------------------- ### Create Order Request with Installments Source: https://developers.payu.com/europe/docs/payment-solutions/credit/installments Use this request to create an order and specify installments as a payment method. Ensure the `payMethod.value` is set to 'ai' for installments. The `buyer` object contains customer details, and `payMethods` specifies the payment type. ```curl curl -v -X POST https://secure.payu.com/api/v2_1/orders \ -H "Content-Type: application/json" \ -H "Authorization: Bearer 3e5cac39-7e38-4139-8fd6-30adc06a61bd" \ -d '{ "notifyUrl": "https://your.eshop.com/notify", "customerIp": "127.0.0.1", "merchantPosId": "145227", "description": "RTV market", "currencyCode": "PLN", "totalAmount": "99900", "extOrderId":"yrjut2mp63wdzcozq7w0br", "buyer": { "email": "jan.kowalski@example.com", "phone": "654111654", "firstName": "Jan", "lastName": "Kowalski" }, "payMethods":{ "payMethod":{ "type":"PBL", "value":"ai" } }, "products": [ { "name": "Laptop", "unitPrice": "99900", "quantity": "1" } ] }' ```