### Example API Request and Response Source: https://wiki.wayforpay.com/en/view/852223 A comprehensive example demonstrating a typical API request and its expected response. ```APIDOC ## Example API Request and Response ### Description This example illustrates a complete API request payload and its corresponding success response. ### Request Example ```json { "auth": { "login": "test", "passwordHash": "098f6bcd4621d373cade4e832627b4f6", "verify": false }, "order": { "aviaData": { "departureDate": 1414504000, "locationCodeN": [ "KBP" ], "locationNumber": 1, "firstName": "Ivan", "lastName": "Ivanov", "reservationCode": "FG78393GZ" }, "product": [ { "quantity": 1, "product": "Велосипед" }, { "quantity": 2, "product": "Зеркала к велосипеду" } ], "extraInfo": "Дополнительная информаци о заказе", "reference": "48521478", "timestamp": 1414504233, "currency": "980", "amount": 125.05 }, "client": { "address": "ул. Гагарина, д. 11", "city": "Киев", "zipCode": "32014", "state": "киевская", "country": "804", "firstName": "Иван", "lastName": "Иванов", "email": "ivanov@gmail.com", "ip": "77.120.98.36", "phone": "38050123457", "pan": "440588-2222", "cardholderFirstName": "IVAN", "cardholderLastName": "IVANOV", "timezone": 0, "machineId": "" }, "receiverClient": { "card": "4123451234", "firstName": "Петр", "lastName": "Петров", "country": "804", "address": "ул. Заводская, д.78/54", "zipCode": "49102" }, "deliveryClient": { "address": "ул. Космонавтов, д. 11, кв. 44", "firstName": "Геннадий", "lastName": "Чебурашкин", "phone": "380671324567", "email": "g.cheb@mail.ru", "country": "804", "city": "Харьков", "zipCode": "37201", "state": "харьковская" }, "bankData": { "status": "COMPLETE", "timestamp": 1414504000, "approvalCode": "451973", "payMethod": "visa", "ecommInd": "3ds", "responseCode": "10", "responseDesc": "Оплата принята" } } ``` ### Response Example (Success) ```json { "transactionId": 65214742, "reference": "48521478", "result": 10, "status": "OK", "timestamp": 1414505799 } ``` ``` -------------------------------- ### WayForPay Service URL Request Example Source: https://wiki.wayforpay.com/en/view/852194 An example of a request object sent to the WayForPay service URL. This includes transaction details and payment information. ```json { "merchantAccount":"test_merch_n1", "orderReference":"DH783023", "merchantSignature":"", "amount":1547.36, "currency":"UAH", "authCode":"541963", "createdDate":12345678, "processingDate":12345678, "cardPan":"41****8217", "cardType":"visa", "issuerBankCountry":"980", "issuerBankName":"Privatbank", "recToken":"121213321-3213213-3213213-321-3", "transactionStatus":"Approved", "reason":"ok", "reasonCode":"1100", "fee":0, "paymentSystem":"card" } ``` -------------------------------- ### WayForPay Request Example Source: https://wiki.wayforpay.com/en/view/852194 An example of a request object sent to the WayForPay service. It includes transaction details, merchant information, and cardholder data. ```json { "transactionType":"CHARGE", "merchantAccount":"test_merch_n1", "merchantAuthType":"SimpleSignature", "merchantDomainName":"www.super.org", "merchantTransactionType":"AUTH", "merchantTransactionSecureType": "NON3DS", "merchantSignature":"60c5d743b71f79abe48c7183ada4b451", "apiVersion":1, "orderReference":"myOrder1", "orderDate":1421412898, "amount":0.13, "currency":"UAH", "card":"4111111111111111", "expMonth":"11", "expYear":"2020", "cardCvv":"111", "cardHolder":"TARAS BULBA", "productName":["Samsung WB1100F","Samsung Galaxy Tab 4 7.0 8GB 3G Black"], "productPrice":[21.1,30.99], "productCount":[1,2], "clientFirstName":"Bulba", "clientLastName":"Taras", "clientCountry":"UKR", "clientEmail":"rob@mail.com", "clientPhone":"380556667788", "clientIpAdress":" " } ``` -------------------------------- ### WayForPay Merchant Response Example Source: https://wiki.wayforpay.com/en/view/852194 An example of a correct response that the WayForPay system expects to receive from the merchant's server. It includes order reference, status, and time. ```json { "orderReference":"DH783023", "status":"accept", "time":1415379863, "signature":"" } ``` -------------------------------- ### Create Invoice Response Example (JSON) Source: https://wiki.wayforpay.com/en/view/608996852 An example of a JSON response from the WayForPay API after attempting to create an invoice. It includes reason codes and the invoice URL. ```json { "reason":"1100", "reasonCode":"Ok", "invoiceUrl":"https://secure.wayforpay.com/pay/invoice?acc=netpeaknet&id=5534eb845b744d27b3ca57eb38a74599&sign=a4a923edd74f9b23bdd8922b4a2d8630", "qrCode": "https://wayforpay.com/qr/img/i343c70e046af?size=200" } ``` -------------------------------- ### Create Invoice Request Example (JSON) Source: https://wiki.wayforpay.com/en/view/608996852 An example of a JSON request to create an invoice via the WayForPay API. This includes merchant details, order information, and client data. ```json { "transactionType":"CREATE_INVOICE", "merchantAccount":"test_merch_n1", "merchantAuthType":"SimpleSignature", "merchantDomainName":"www.super.org", "merchantSignature":"60c5d743b71f79abe48c7183ada4b451", "apiVersion":1, "language":”ru”, "serviceUrl”:”http://serviceurl.com”, "orderReference":"myOrder1", "orderDate":1421412898, "amount":1547.36, "currency":"UAH", "orderTimeout": 86400, "productName":["Samsung WB1100F","Samsung Galaxy Tab 4 7.0 8GB 3G Black"], "productPrice":[21.1,30.99], "productCount":[1,2], "paymentSystems": "card;privat24", "clientFirstName":"Bulba", "clientLastName":"Taras", "clientEmail":"rob@mail.com", "clientPhone":"380556667788" } ``` -------------------------------- ### Example API Request (JSON) Source: https://wiki.wayforpay.com/en/view/852223 A comprehensive example of an API request to WayForPay, encompassing authentication, order details, client information, receiver details, delivery information, and bank data. This demonstrates a typical transaction flow. ```json { "auth": { "login": "test", "passwordHash": "098f6bcd4621d373cade4e832627b4f6", "verify": false }, "order": { "aviaData": { "departureDate": 1414504000, "locationCodeN": [ "KBP" ], "locationNumber": 1, "firstName": "Ivan", "lastName": "Ivanov", "reservationCode": "FG78393GZ" }, "product": [ { "quantity": 1, "product": "Велосипед" }, { "quantity": 2, "product": "Зеркала к велосипеду" } ], "extraInfo": "Дополнительная информаци о заказе", "reference": "48521478", "timestamp": 1414504233, "currency": "980", "amount": 125.05 }, "client": { "address": "ул. Гагарина, д. 11", "city": "Киев", "zipCode": "32014", "state": "киевская", "country": "804", "firstName": "Иван", "lastName": "Иванов", "email": "ivanov@gmail.com", "ip": "77.120.98.36", "phone": "38050123457", "pan": "440588-2222", "cardholderFirstName": "IVAN", "cardholderLastName": "IVANOV", "timezone": 0, "machineId": "" }, "receiverClient": { "card": "4123451234", "firstName": "Петр", "lastName": "Петров", "country": "804", "address": "ул. Заводская, д.78/54", "zipCode": "49102" }, "deliveryClient": { "address": "ул. Космонавтов, д. 11, кв. 44", "firstName": "Геннадий", "lastName": "Чебурашкин", "phone": "380671324567", "email": "g.cheb@mail.ru", "country": "804", "city": "Харьков", "zipCode": "37201", "state": "харьковская" }, "bankData": { "status": "COMPLETE", "timestamp": 1414504000, "approvalCode": "451973", "payMethod": "visa", "ecommInd": "3ds", "responseCode": "10", "responseDesc": "Оплата принята" } } ``` -------------------------------- ### Account2Account API Request Example (JSON) Source: https://wiki.wayforpay.com/en/view/853306 Example of a request payload for the Account2Account API, demonstrating the required parameters for initiating a credit transfer. This includes merchant and order details, currency, IBAN, and a description for the payment. ```json { "transactionType":"P2P_ACCOUNT", "merchantAccount":"p2p_account", "merchantAuthType":"simpleSignature", "merchantSignature":"60c5d743b71f79abe48c7183ada4b451", "apiVersion":1, "orderReference":"myOrder1", "amount":10.13, "currency":"UAH", "iban":"UA261234560000026000000000000", "okpo":"123456789", "accountName":"ФОП Iванов Iван Iванович", "description":"Спалата рахунку №2" } ``` -------------------------------- ### Simulating Service URL Request with cURL (PHP) Source: https://wiki.wayforpay.com/en/view/852102 An example of how to simulate a request to a service URL using cURL in PHP. This is useful for testing or understanding the interaction with the WayForPay service. ```php $ curl http://you.service.url -d '{"a":"a", "bInt":1}' ``` -------------------------------- ### Payment Notification Request Example (JSON) Source: https://wiki.wayforpay.com/en/view/608996852 An example of the JSON request sent by WayForPay to the merchant's serviceUrl to notify about the status of an invoice payment. Includes order and transaction details. ```json { "merchantAccount":"test_merch_n1", "orderReference":"myOrder1", "merchantSignature":"", "amount":"1547.36", "currency":"UAH", "authCode":"541963", "email":"client@mail.ua", "phone":"380501234567", "createdDate":"", "processingDate":"", "cardPan":"4102****8217", "cardType":"visa", "issuerBankCountry":"980", "issuerBankName":"Privatbank", "recToken":"", "transactionStatus":"Approved", "reason":"1100", "reasonCode":"", "fee":"", "paymentSystem":"card" } ``` -------------------------------- ### Example API Response (JSON) Source: https://wiki.wayforpay.com/en/view/852223 An example of a successful API response from WayForPay, indicating the transaction ID, reference number, result code, status, and timestamp. This response format is returned upon successful processing of a request. ```json { "transactionId": 65214742, "reference": "48521478", "result": 10, "status": "OK", "timestamp": 1414505799 } ``` -------------------------------- ### Add Merchant API Response Example (JSON) Source: https://wiki.wayforpay.com/en/view/853322 This is an example of the JSON response received after successfully adding a merchant via the WayForPay API. It confirms the operation's success and provides the new merchant's account details. ```json { "reason":"Ok", "reasonCode":"1100", "merchantAccount":"site.com", "secretKey":"0f4ab40a5а56710а0e8e8b41bb05fb48e85bb047" } ``` -------------------------------- ### Add Partner Request and Response Example Source: https://wiki.wayforpay.com/en/view/853331 This snippet demonstrates the structure of a request to add a partner to the WayForPay system and the corresponding response. The request includes merchant account details, partner information, and optional compensation card details. The response confirms the operation's success or failure with a reason code. ```json { "merchantAccount": "test_merch_n1", "merchantSignature": "4a76353de3a7ce3c9d9c8a362d37f28b", "partnerCode": "superPartner1", "phone": "380901234567", "email": "ff1f@com", "compensationCardNumber": "4111111111111111", "compensationCardHolder": "super holder", "compensationCardExpYear": "2029", "compensationCardExpMonth": "05", "compensationCardCvv": "111", "description": "description of shop" } ``` ```json { "reason": "Ok", "reasonCode": "1100", "partnerCode": "site.com" } ``` -------------------------------- ### Add Merchant API Request Example (JSON) Source: https://wiki.wayforpay.com/en/view/853322 This is an example of the JSON request payload required to register a new merchant using the WayForPay API. It includes essential merchant details and compensation information. ```json { "merchantAccount":"test_merch_n1", "merchantSignature":"4a76353de3a7ce3c9d9c8a362d37f28b", "site":"http://site.com", "phone":"380901234567", "email":"ff1f@com", "compensationCardNumber":"4111111111111111", "compensationCardHolder":"super holder", "compensationCardExpYear":"2029", "compensationCardExpMonth":"05", "compensationCardCvv":"111", "description":"opisanie of shop" } ``` -------------------------------- ### Account2Account API Response Example (JSON) Source: https://wiki.wayforpay.com/en/view/853306 Example of a response payload from the Account2Account API, indicating the outcome of a credit transfer. It includes merchant details, order reference, transaction status, and processing information. ```json { "merchantAccount": "p2p_account", "orderReference": "myOrder1", "merchantSignature":"b95932786cbe243a76b014846b63fe92", "amount": 10.13, "currency": "UAH", "createdDate": 1415379863, "processingDate": 1415379863, "transactionStatus": "Approved", "reason": "Ok", "reasonCode": 1100 } ``` -------------------------------- ### Partner Edit Response Example (JSON) Source: https://wiki.wayforpay.com/en/view/853335 This is an example of a Partner Edit response in JSON format. It confirms the update operation and returns the partnerCode, the updated secretKey, and reason codes indicating the result of the request. ```json { "partnerCode":"partner_merch_n1", "secretKey":"0f4ab40a5а56710а0e8e8b41bb05fb48e85bb047", "reason":"update", "reasonCode":"1100" } ``` -------------------------------- ### Merchant Info API Request and Response Example Source: https://wiki.wayforpay.com/en/view/853324 This snippet demonstrates the structure of a Merchant Info API request and its corresponding response. The request requires merchant account and signature, while the response provides detailed information about the merchant's shop, including account details, website, contact information, status, and creation date. ```javascript { "merchantAccount":"test_merch_n1", "merchantSignature":"sdfds3eda323edsds235ds4s44sbmuu6" } ``` ```javascript { "reason":"Ok", "reasonCode":1100, "merchantAccount":"test_merch_n2", "site":"site.com", "description":"description of shop", "phone":"380901234567", "email":"ff1f@com", "compensation":"card", "status":"active", "createDate":"12.01.2016" } ``` -------------------------------- ### Partner Info API Request and Response Example Source: https://wiki.wayforpay.com/en/view/853333 This snippet demonstrates the JSON structure for both the request to obtain partner information and the expected response from the WayForPay API. The request requires merchant account, partner code, and a signature. The response includes details such as partner name, website, contact information, and status. ```json { "merchantAccount": "test_merch_n1", "partnerCode": "test_partner", "merchantSignature": "860ee1b8f4595660ecae76c431cea88b" } ``` ```json { "reason": "Ok", "reasonCode": "1100", "merchantAccount": "test_merch_n2", "partnerCode": "test_partner", "site": "site.com", "description": "description of shop", "phone": "380901234567", "email": "ff1f@com", "compensation": "card", "partnerStatus": "active", "createDate": "12.01.2016" } ``` -------------------------------- ### Partner Edit Request Example (JSON) Source: https://wiki.wayforpay.com/en/view/853335 This is an example of a Partner Edit request in JSON format. It includes mandatory fields like merchantAccount, merchantSignature, and partnerCode, along with optional fields for updating partner details such as site, phone, email, and compensation information. ```json { "merchantAccount":"test_merch_n1", "merchantSignature":"0f4ab40a5а56710а0e8e8b41bb05fb48e85bb047", "partnerCode":"partner_merch_n1", "site":"http://site.com", "phone":"380901234567", "email":"ff1f@com", "compensationCardNumber":"4111111111111111", "compensationCardHolder":"super holder", "compensationCardExpYear":"2029", "compensationCardExpMonth":"05", "compensationCardCvv":"111", "description":"opisanie of shop" } ``` -------------------------------- ### Refund Payment API Request and Response Example Source: https://wiki.wayforpay.com/en/view/852115 This snippet demonstrates a typical JSON request to the WayForPay API for initiating a refund and the corresponding JSON response indicating the transaction status. It is crucial for merchants to correctly format these requests with all mandatory parameters and generate a valid merchantSignature. ```json { "transactionType": "REFUND", "merchantAccount": "test_merchant", "orderReference": "DH783023", "amount": 100, "currency": "UAH", "comment": "Нет в наличии товара", "merchantSignature": "b95932786cbe243a76b014846b63fe92", "apiVersion": 1 } ``` ```json { "orderReference": "DH783023", "transactionStatus": "refunded", "reasonCode": 1100, "reason": "ok", "merchantAccount": "test_merchant" } ``` -------------------------------- ### Payment System Parameters Source: https://wiki.wayforpay.com/en/view/852102 Configuration options for available payment systems and default selection. ```APIDOC ### Payment System Parameters #### Request Body - **paymentSystems** (string) - A semicolon-separated list of payment systems available for the client. If not specified, all systems enabled for the merchant are available. Available systems include: 'card', 'googlePay', 'applePay', 'privat24', 'lpTerminal', 'delay', 'bankCash', 'qrCode', 'masterPass', 'visaCheckout', 'bot', 'payParts', 'payPartsMono', 'payPartsPrivat', 'payPartsAbank', 'instantAbank', 'globusPlus', 'OnusInstallment', 'payPartsOtp'. For installment payments, specify the number of parts like `payPartsAbank:2,3,7,10`. - **defaultPaymentSystem** (string) - The payment system to be displayed first on the payment page. Defaults to 'card'. ``` -------------------------------- ### POST /charge Source: https://wiki.wayforpay.com/en/view/852194 Accept payment host2host (Charge) - Used for quick payment making in one action. The result of this request is the withdrawal of monetary assets from the client's card. ```APIDOC ## POST /charge ### Description Accept payment host2host (Charge) - Used for quick payment making in one action. It is performed within the limits of single-staged pattern. The result of request processing is the withdrawal of monetary assets from client’s card. ### Method POST ### Endpoint /charge ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **merchantAccount** (string) - Required - Merchant identifier - **orderReference** (string) - Required - Unique order identifier - **orderDate** (string) - Required - Order creation date (YYYY-MM-DD) - **amount** (number) - Required - The amount to be charged - **currency** (string) - Required - Currency code (e.g., UAH, USD) - **card_number** (string) - Required - Card number - **card_cvv2** (string) - Required - CVV2 code - **card_expiry_date** (string) - Required - Card expiry date (MM/YY) - **client_first_name** (string) - Optional - Client's first name - **client_last_name** (string) - Optional - Client's last name - **client_email** (string) - Optional - Client's email - **client_phone** (string) - Optional - Client's phone number - **product_name** (array) - Optional - Array of product names - **redirect_url** (string) - Optional - URL to redirect after payment - **server_url** (string) - Optional - URL for server-to-server notification ### Request Example ```json { "merchantAccount": "your_merchant_account", "orderReference": "ORDER123", "orderDate": "2023-10-27", "amount": 100.50, "currency": "UAH", "card_number": "4111111111111111", "card_cvv2": "123", "card_expiry_date": "12/25", "client_email": "test@example.com", "product_name": ["Product A", "Product B"], "redirect_url": "https://your_site.com/redirect", "server_url": "https://your_site.com/notify" } ``` ### Response #### Success Response (200) - **status** (string) - Payment status (e.g., 'success', 'pending') - **orderReference** (string) - Order identifier - **transactionStatus** (string) - Detailed transaction status - **paymentSystem** (string) - The payment system used - **amount** (number) - The charged amount - **currency** (string) - The currency of the transaction - **maskedCardNumber** (string) - Masked card number - **rrn** (string) - Retrieval Reference Number - ** ApprovalCode** (string) - Approval code #### Response Example ```json { "status": "success", "orderReference": "ORDER123", "transactionStatus": "approved", "paymentSystem": "VISA", "amount": 100.50, "currency": "UAH", "maskedCardNumber": "**** **** **** 1111", "rrn": "1234567890", "ApprovalCode": "987654" } ``` ``` -------------------------------- ### POST /create_invoice Source: https://wiki.wayforpay.com/en/view/608996852 This endpoint is used to create an invoice for a customer. It requires detailed information about the transaction, products, and customer. The response includes a URL to the payment page and a QR code. ```APIDOC ## POST /create_invoice ### Description Creates an invoice for a customer, providing a payment URL and QR code. ### Method POST ### Endpoint /create_invoice ### Parameters #### Request Body - **transactionType** (string) - Required - Type of transaction (e.g., "CREATE_INVOICE") - **merchantAccount** (string) - Required - Merchant's account identifier - **merchantAuthType** (string) - Required - Merchant authentication type - **merchantDomainName** (string) - Required - Merchant's domain name - **merchantSignature** (string) - Required - Signature for authentication - **apiVersion** (integer) - Required - API version number - **language** (string) - Optional - Language for the payment page - **serviceUrl** (string) - Optional - URL for service notifications - **orderReference** (string) - Required - Unique order reference number - **orderDate** (integer) - Required - Timestamp of order creation - **amount** (float) - Required - Total amount of the order - **currency** (string) - Required - Currency of the order (e.g., "UAH") - **orderTimeout** (integer) - Optional - Order expiration timeout in seconds - **productName** (array of strings) - Required - List of product names - **productPrice** (array of floats) - Required - List of product prices - **productCount** (array of integers) - Required - List of product counts - **paymentSystems** (string) - Optional - Preferred payment systems (e.g., "card;privat24") - **clientFirstName** (string) - Optional - Customer's first name - **clientLastName** (string) - Optional - Customer's last name - **clientEmail** (string) - Optional - Customer's email address - **clientPhone** (string) - Optional - Customer's phone number ### Request Example ```json { "transactionType":"CREATE_INVOICE", "merchantAccount":"test_merch_n1", "merchantAuthType":"SimpleSignature", "merchantDomainName":"www.super.org", "merchantSignature":"60c5d743b71f79abe48c7183ada4b451", "apiVersion":1, "language":”ru”, "serviceUrl”:”http://serviceurl.com”, "orderReference":"myOrder1", "orderDate":1421412898, "amount":1547.36, "currency":"UAH", "orderTimeout": 86400, "productName":["Samsung WB1100F","Samsung Galaxy Tab 4 7.0 8GB 3G Black"], "productPrice":[21.1,30.99], "productCount":[1,2], "paymentSystems": "card;privat24", "clientFirstName":"Bulba", "clientLastName":"Taras", "clientEmail":"rob@mail.com", "clientPhone":"380556667788" } ``` ### Response #### Success Response (200) - **reason** (string) - Reason for the transaction status. - **reasonCode** (string) - Code indicating the status (e.g., "Ok"). - **invoiceUrl** (string) - URL for the customer to complete the payment. - **qrCode** (string) - URL to a QR code for payment. #### Response Example ```json { "reason":"1100", "reasonCode":"Ok", "invoiceUrl":"https://secure.wayforpay.com/pay/invoice?acc=netpeaknet&id=5534eb845b744d27b3ca57eb38a74599&sign=a4a923edd74f9b23bdd8922b4a2d8630", "qrCode": "https://wayforpay.com/qr/img/i343c70e046af?size=200" } ``` ``` -------------------------------- ### Response: API Transaction List Source: https://wiki.wayforpay.com/en/view/1736786 This is a JSON example of a response from the WayForPay API when requesting a transaction list. It includes a 'reason' and 'reasonCode' for the request status, and a 'transactionList' array containing details of each transaction, such as order reference, amount, currency, and status. ```json { "reason": "Ok", "reasonCode": 1100, "transactionList": [ { "transactionType": "PURCHASE", "orderReference": "RF3656-1454331982", "createdDate": "1454332003", "amount": "0.17", "currency": "UAH", "transactionStatus": "Declined", "processingDate": "1454332238", "reasonCode": "1101", "reason": "Declined To Card Issuer", "email": "dev@wayforpay.com", "phone": "380660000001", "paymentSystem": "card", "cardPan": "41****1111", "cardType": "Visa", "issuerBankCountry": "", "issuerBankName": "", "fee": "0" }, { "transactionType": "PURCHASE", "orderReference": "RF3656-1454338652", "createdDate": "1454338658", "amount": "0.17", "currency": "UAH", "transactionStatus": "InProcessing", "processingDate": "1454338666", "reasonCode": "1131", "reason": "Transaction in processing", "email": "dev@wayforpay.com", "phone": "380660000001", "paymentSystem": "privat24", "cardPan": "", "cardType": "", "issuerBankCountry": "", "issuerBankName": "", "fee": "0" } ] } ``` -------------------------------- ### WayForPay P2P CREDIT Transaction Request (JSON) Source: https://wiki.wayforpay.com/en/view/852064 This JSON object represents a sample request to initiate a P2P CREDIT transaction via the WayForPay API. It includes essential details for the transaction and merchant authentication. Ensure all required fields are accurately provided. ```json { "transactionType":"P2P_CREDIT", "merchantAccount":"p2p_credit", "merchantAuthType":"SimpleSignature", "merchantSignature":"60c5d743b71f79abe48c7183ada4b451", "apiVersion":1, "orderReference":"myOrder1", "amount":10.13, "currency":"UAH", "cardBeneficiary":"4111111111111111" } ``` -------------------------------- ### Merchant Edit Response Example (JSON) Source: https://wiki.wayforpay.com/en/view/853327 This JSON object represents a successful response after editing merchant details. It includes the merchant account, the shop's secret key, the reason for the operation, and a reason code indicating successful processing. ```json { "merchantAccount":"test_merch_n2", "secretKey":"0f4ab40a5а56710а0e8e8b41bb05fb48e85bb047", "reason":"update", "reasonCode":"1100" } ``` -------------------------------- ### Request: API Transaction List Source: https://wiki.wayforpay.com/en/view/1736786 This is a JSON example of a request to the WayForPay API to fetch a list of transactions. It includes essential parameters like merchant account, signature, and the date range for the transaction list. The 'apiVersion' parameter controls the inclusion of advanced data. ```json { "apiVersion": 1, "transactionType": "TRANSACTION_LIST", "merchantAccount": "test_merch_n1", "merchantSignature": "b9277c081b29841e5eccea03d223e23a", "dateBegin": 1454277600, "dateEnd": 1454364000 } ``` -------------------------------- ### Merchant Edit Request Example (JSON) Source: https://wiki.wayforpay.com/en/view/853327 This JSON object demonstrates a sample request to update merchant details. It includes the merchant account, signature, the account to edit, website, phone, email, and compensation card information. The merchantSignature is generated using HMAC_MD5. ```json { "merchantAccount":"test_merch_n1", "merchantSignature":"0f4ab40a5а56710а0e8e8b41bb05fb48e85bb047", "merchantAccountEdit":"test_merch_n2", "site":"http://site.com", "phone":"380901234567", "email":"ff1f@com", "compensationCardNumber":"4111111111111111", "compensationCardHolder":"super holder", "compensationCardExpYear":"2029", "compensationCardExpMonth":"05", "compensationCardCvv":"111", "description":"opisanie of shop" } ``` -------------------------------- ### POST /pay - Initiate Payment Source: https://wiki.wayforpay.com/en/view/852102 This endpoint initiates a payment transaction. It requires various details about the merchant, order, products, and customer. A merchant signature is mandatory for verification. ```APIDOC ## POST /pay ### Description Initiates a payment transaction through the WayForPay gateway. Requires detailed order and merchant information, secured with a merchant signature. ### Method POST ### Endpoint https://secure.wayforpay.com/pay ### Parameters #### Request Body - **merchantAccount** (string) - Required - The merchant's account identifier. - **merchantDomainName** (string) - Required - The domain name of the merchant. - **orderReference** (string) - Required - A unique identifier for the order. - **orderDate** (string) - Required - The date and time the order was placed (Unix timestamp). - **amount** (string) - Required - The total amount of the order. - **currency** (string) - Required - The currency of the transaction (e.g., UAH). - **productName** (array of strings) - Required - An array of product names. - **productCount** (array of integers) - Required - An array of product quantities. - **productPrice** (array of strings) - Required - An array of product prices. - **merchantSignature** (string) - Required - The HMAC-MD5 hash for transaction verification. - **clientFirstName** (string) - Optional - The first name of the client. - **clientLastName** (string) - Optional - The last name of the client. - **clientAddress** (string) - Optional - The client's address. - **clientCity** (string) - Optional - The client's city. - **clientEmail** (string) - Optional - The client's email address. - **defaultPaymentSystem** (string) - Optional - The default payment system to use (e.g., 'card'). - **orderTimeout** (string) - Optional - Timeout for the order in seconds. - **merchantAuthType** (string) - Optional - Merchant authentication type (e.g., 'SimpleSignature'). ### Request Example ```html
``` ### Response #### Success Response (200) Upon successful initiation, WayForPay returns a redirect URL to the payment page. ```json { "url": "https://secure.wayforpay.com/page?Vkh=..." } ``` ``` -------------------------------- ### Account/Partner/User - Add Merchant Source: https://wiki.wayforpay.com/en/view/852091 Registers a new merchant account. ```APIDOC ## POST /api/merchants/add ### Description Adds a new merchant to the system. ### Method POST ### Endpoint /api/merchants/add ### Parameters #### Request Body - **merchant_name** (string) - Required - The name of the merchant. - **contact_email** (string) - Required - The primary contact email for the merchant. - **phone_number** (string) - Optional - The contact phone number. ### Request Example ```json { "merchant_name": "Awesome Online Store", "contact_email": "support@awesomestore.com", "phone_number": "+1234567890" } ``` ### Response #### Success Response (200) - **merchant_id** (string) - The unique identifier for the newly added merchant. #### Response Example ```json { "merchant_id": "mch_abcdef12345" } ``` ```