### Example Transaction Created Response Source: https://docs-api.tpay.com/en/tokenization This is an example response after successfully creating a card transaction for tokenization. Key parameters include `result`, `status`, and `transactionPaymentUrl` for payer redirection. The response also contains details about the transaction and payer. ```json { "result": "success", "requestId": "858fa92dc62db44e2c1f", "transactionId": "01K5BK4HEPB0WBCGT51FMTYSYJ", "title": "TR-CWM-CNYHA6X", "posId": "ps_e4dkPVDEm4Jg7267", "status": "pending", "date": { "creation": "2024-06-06 21:31:35", "realization": null }, "amount": 0.1, "currency": "PLN", "description": "Test card payment", "hiddenDescription": "", "payer": { "payerId": "py_a9rjlZWxRLdG1bqY", "email": "john.doe@example.com", "name": "John Doe", "phone": "", "address": "", "city": "", "country": "PL", "postalCode": "" }, "payments": { "status": "pending", "method": "pay_by_link", "amountPaid": 0, "date": { "realization": null } }, "transactionPaymentUrl": "https://secure.tpay.com/?title=TR-CWM-CNYHA6X&uid=01HZQGHZP5P3P7YV8A4BRVDX17" } ``` -------------------------------- ### Example Tokenization Notification Payload Source: https://docs-api.tpay.com/en/webhooks This is an example of the JSON payload received after a successful tokenization. It includes details about the token, card brand, and expiry date. ```json { "type": "tokenization", "data": { "tokenizationId": "TO-XXX-XXXXX", "token": "fdc235...", "cardBrand": "Mastercard", "cardTail": "1111", "tokenExpiryDate": "0625" } } ``` -------------------------------- ### Example TransactionCreated Response Source: https://docs-api.tpay.com/en/payment-methods/blik This is an example of the JSON response received after a transaction is successfully created. It includes details about the transaction status, amounts, and payer information. ```json { "result": "success", "requestId": "b6325d51e8c4b9130476", "transactionId": "01K5BK4HEPB0WBCGT51FMTYSYJ", "title": "TR-BRA-CCP1S9X", "posId": "ps_NyRBLzV5kelrpjaM", "status": "pending", "date": { "creation": "2024-05-08 21:01:15", "realization": null }, "amount": 21.08, "currency": "PLN", "description": "Recurring Payment initiation", "hiddenDescription": "", "payer": { "payerId": "py_a9rjlZ3qyPPG1bqY", "email": "", "name": "Jan Nowak", "phone": "", "address": "", "city": "", "country": "PL", "postalCode": "", "ip": "127.0.0.1", "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36" }, "payments": { "status": "pending", "method": "pay_by_link", "amountPaid": 0, "date": { "realization": null } }, "transactionPaymentUrl": "https://secure.tpay.com/?title=TR-BRA-CCP1S9X&uid=01HXCS9KVQBDZDDWDHP1TZKJ1K" } ``` -------------------------------- ### BLIK Level 0 Transaction Creation Response Source: https://docs-api.tpay.com/en/payment-methods/blik This is an example of a successful response when creating a BLIK Level 0 transaction. It includes transaction details and a payment URL. ```json { "result": "success", "requestId": "b6325d51e8c4b9130476", "transactionId": "01K5BK4HEPB0WBCGT51FMTYSYJ", "title": "TR-BRA-CCP1S9X", "posId": "ps_NyRBLzV5kelrpjaM", "status": "pending", "date": { "creation": "2024-05-08 21:01:15", "realization": null }, "amount": 0.1, "currency": "PLN", "description": "test transaction via BLIK", "hiddenDescription": "", "payer": { "payerId": "py_a9rjlZ3qyPPG1bqY", "email": "", "name": "Jan Nowak", "phone": "", "address": "", "city": "", "country": "PL", "postalCode": "", "ip": "127.0.0.1", "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36" }, "payments": { "status": "pending", "method": "pay_by_link", "amountPaid": 0, "date": { "realization": null } }, "transactionPaymentUrl": "" } ``` -------------------------------- ### Transaction Creation Response Source: https://docs-api.tpay.com/en/first-steps/first-transaction This is an example of a successful response when creating a transaction. Key fields include transactionId and transactionPaymentUrl for payer redirection. ```json { "result": "success", "requestId": "d3a9826d92c48cb8c185", "transactionId": "01K5BK4HEPB0WBCGT51FMTYSYJ", "title": "TR-CWM-CS7LW1X", "posId": "ps_e4dkPVDEm4Jg726q", "status": "pending", "date": { "creation": "2024-06-12 21:29:35", "realization": null }, "amount": 0.1, "currency": "PLN", "description": "Test transaction", "hiddenDescription": "", "payer": { "payerId": "py_a9rjlZWxRLdG1bqY", "email": "jan.nowak@example.com", "name": "Jan Nowak", "phone": "", "address": "", "city": "", "country": "PL", "postalCode": "" }, "payments": { "status": "pending", "method": null, "amountPaid": 0, "date": { "realization": null } }, "transactionPaymentUrl": "https://secure.tpay.com/" } ``` -------------------------------- ### GET /transactions/channels - List of Payment Methods Source: https://docs-api.tpay.com/en/first-steps/list-of-payment-methods Retrieve the list of available payment methods to display them in your system using the payment channels endpoint. ```APIDOC ## GET /transactions/channels ### Description Retrieve the list of available payment methods to display them in your system. ### Method GET ### Endpoint https://api.tpay.com/transactions/channels ### Response #### Success Response (200) - **channels** (array) - List of payment methods. - **channels[].id** (string) - Unique identifier of the payment channel. - **channels[].name** (string) - Name of the payment channel. - **channels[].fullName** (string) - Full name of the payment channel. - **channels[].image.url** (string) - URL of the payment channel image/logo. - **channels[].available** (boolean) - Indicates if the payment channel is currently available. - **channels[].instantRedirection** (boolean) - Indicates if the payment channel supports instant redirections. - **channels[].groups[]** (array) - List of groups to which the channel belongs. - **channels[].groups[].id** (string) - Group identifier. - **channels[].groups[].name** (string) - Group name. - **channels[].groups[].image.url** (string) - URL of the group's logo. ### Response Example { "channels": [ { "id": "1", "name": "BNP Paribas Bank Polska S.A.", "fullName": "BNP Paribas Bank Polska S.A.", "image": { "url": "https://secure.tpay.com/img/channels/1.png" }, "available": true, "instantRedirection": false, "groups": [ { "id": "133", "name": "Bank transfer", "image": { "url": "https://secure.tpay.com/img/groups/133.png" } } ] } ] } ``` -------------------------------- ### Example URL Encoded Notification Source: https://docs-api.tpay.com/en/payment-methods/blik This is an example of a notification payload received in URL-encoded format. It contains details about a registered recurring payment alias. ```url-encoded id=1010&event=ALIAS_REGISTER&md5sum=d303c5af701cdfcaed02f66603239eef&msg_value%5Bvalue%5D=user_unique_alias_123&msg_value%5Btype%5D=PAYID&msg_value%5BexpirationDate%5D=2024-11-02+14%3A15%3A01 ``` -------------------------------- ### BNPL Transaction Creation Response Schema Source: https://docs-api.tpay.com/en/payment-methods/bnpl Example response received after successfully creating a BNPL transaction. Key fields include result, status, and transactionPaymentUrl for payer redirection. ```json { "result": "success", "requestId": "786dee7ec39502226238", "transactionId": "01K5BK4HEPB0WBCGT51FMTYSYJ", "title": "TR-CWM-D14339X", "posId": "ps_e4dkPVDEm4Jg726q", "status": "pending", "date": { "creation": "2024-07-04 21:15:23", "realization": null }, "amount": 0.1, "currency": "PLN", "description": "Testowa transakcja BNPL", "hiddenDescription": "", "payer": { "payerId": "py_a9rjlZWxRLdG1bqY", "email": "jan.nowak@example.com", "name": "Jan Nowak", "phone": "", "address": "", "city": "", "country": "PL", "postalCode": "" }, "payments": { "status": "pending", "method": "pay_by_link", "amountPaid": 0, "date": { "realization": null } }, "transactionPaymentUrl": "https://secure.tpay.com/?title=TR-CWM-D14339X&uid=01J1ZJREPKDXXJ5E4JRWYVXMN2" } ``` -------------------------------- ### Example Response for Non-Unique Aliases Source: https://docs-api.tpay.com/en/payment-methods/blik This JSON response indicates a payment failure due to too many active recurring payments for a given alias. It includes a list of alternative subscriptions that the user can choose from. ```json { "payments": { "status": "pending", "method": "pay_by_link", "amountPaid": 0, "date": { "realization": null }, "errors": [ { "errorCode": "payment_failed", "errorMessage": "aliases: Too many aliases found for aliasValue: user_unique_alias_123" } ], "alternatives": [ { "applicationName": "Subscription 1", "applicationCode": "1ec8f352-463c-6334-be44-9fede70e64b8" }, { "applicationName": "Subscription 2", "applicationCode": "1ec8fe63-ea6e-6b48-ac6f-f7f170888d37" } ] } } ``` -------------------------------- ### Retrieve Token Status with Card Image Source: https://docs-api.tpay.com/en/tokenization Send a GET request to this endpoint to fetch the current status of a token and its associated card image. Replace `{tokenValue}` with the actual token. ```HTTP GET https://api.tpay.com/tokens/bfbde8ba10da6215fe92fb28b8787d154afc5cdacaee72fbb91042ccf544f871 ``` -------------------------------- ### Example Response for Non-Unique Aliases Source: https://docs-api.tpay.com/en/payment-methods/blik This JSON response indicates a payment failure due to too many aliases found for a given alias value. It includes a list of alternative banking applications that the user can choose from. ```json { "payments": { "status": "pending", "method": "pay_by_link", "amountPaid": 0, "date": { "realization": null }, "errors": [ { "errorCode": "payment_failed", "errorMessage": "aliases: Too many aliases found for aliasValue: user_unique_alias_123" } ], "alternatives": [ { "applicationName": "My qwerty bank", "applicationCode": "1ec8f352-463c-6334-be44-9fede70e64b8" }, { "applicationName": "My azerty bank", "applicationCode": "1ec8fe63-ea6e-6b48-ac6f-f7f170888d37" } ] } } ``` -------------------------------- ### BLIK Transaction Creation Response Source: https://docs-api.tpay.com/en/payment-methods/blik This is an example of a successful response when creating a BLIK transaction. Key fields include 'result', 'transactionId', 'status', and 'transactionPaymentUrl' for payer redirection. ```json { "result": "success", "requestId": "b6325d51e8c4b9130476", "transactionId": "01K5BK4HEPB0WBCGT51FMTYSYJ", "title": "TR-BRA-CCP1S9X", "posId": "ps_NyRBLzV5kelrpjaM", "status": "pending", "date": { "creation": "2024-05-08 21:01:15", "realization": null }, "amount": 0.1, "currency": "PLN", "description": "test transaction via BLIK", "hiddenDescription": "", "payer": { "payerId": "py_a9rjlZ3qyPPG1bqY", "email": "jan.nowak@example.com", "name": "Jan Nowak", "phone": "", "address": "", "city": "", "country": "PL", "postalCode": "" }, "payments": { "status": "pending", "method": "pay_by_link", "amountPaid": 0, "date": { "realization": null } }, "transactionPaymentUrl": "https://secure.tpay.com/?title=TR-BRA-CCP1S9X&uid=01HXCS9KVQBDZDDWDHP1TZKJ1K" } ``` -------------------------------- ### Send BNPL Transaction Creation Request using cURL Source: https://docs-api.tpay.com/en/payment-methods/bnpl Example of sending a POST request to create a BNPL transaction using cURL. Replace with your actual API token. ```bash curl --location 'https://api.tpay.com/transactions' \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data-raw '{ "amount": 0.1, "description": "Testowa transakcja BNPL", "payer": { "email": "jan.nowak@example.com", "name": "Jan Nowak" }, "pay": { "channelId": 71 } }' ``` -------------------------------- ### Retrieve Single Refund Information Source: https://docs-api.tpay.com/en/refunds Send a GET request to this endpoint to retrieve details for a specific refund. Replace `{refundId}` with the actual refund ID. Ensure your request includes an Authorization header with a valid access token. ```bash curl --location 'https://api.tpay.com/refunds/123' \ --header 'Authorization: Bearer \' ``` -------------------------------- ### OAuth Access Token Response Source: https://docs-api.tpay.com/en/first-steps/authorization This is an example of a successful response when requesting an OAuth access token. The response includes details like the token type, expiration time, and the access token itself. ```json { "issued_at": 1718215429, "scope": "read", "token_type": "Bearer", "expires_in": 7200, "client_id": "01HH1N1V033B5FMB6TXPWZVATY-01J06SX1HPPFG0D8907TWBG871", "access_token": "3a06d08eb804f8bb4a8b2c82bf14c15cbae79ef6" } ``` -------------------------------- ### Handle Recurring Payment Creation Notification Source: https://docs-api.tpay.com/en/payment-methods/blik This example shows the URL-encoded format of a webhook notification received from Tpay for a Recurring Payment registration event. Verify the md5sum and save the msg_value.value for future use. ```text id=1010&event=ALIAS_REGISTER&md5sum=d303c5af701cdfcaed02f66603239eef&msg_value%5Bvalue%5D=172838953_he7vqanrfazzaeyb3q&msg_value%5Btype%5D=PAYID&msg_value%5BexpirationDate%5D=2024-11-02+14%3A15%3A01 ``` -------------------------------- ### BLIK Recurring Payment Transaction Created Response Source: https://docs-api.tpay.com/en/payment-methods/blik This is an example of the response received after a BLIK Recurring Payment transaction is successfully initiated. Key parameters include the result status and payment status. ```json { "result": "success", "posId": "ps_NyRBLzV5kelrpjaM", "status": "pending", "date": { "creation": "2024-05-08 21:01:15" }, "description": "Recurring Payment initiation" } ``` -------------------------------- ### Retrieve Transaction Status using cURL Source: https://docs-api.tpay.com/en/first-steps/first-transaction Use this cURL command to send a GET request to retrieve the status of a specific transaction. Replace `` with your actual token. This endpoint is recommended as a fallback only. ```bash curl --location 'https://api.tpay.com/transactions/01K5BK4HEPB0WBCGT51FMTYSYJ' \ --header 'Authorization: Bearer ' ``` -------------------------------- ### Handle Recurring Payment Notification (URL Encoded) Source: https://docs-api.tpay.com/en/payment-methods/blik This example shows the URL-encoded format for notifications regarding BLIK alias events such as unregistration, update, or expiration. It includes essential parameters like 'id', 'event', and alias details. ```urlquery id=1010&event=ALIAS_UNREGISTER&md5sum=d303c5af701cdfcaed02f66603239eef&msg_value%5Bvalue%5D=172838953_he7vqanrfazzaeyb3q&msg_value%5Btype%5D=PAYID ``` -------------------------------- ### Retrieve Trusted Bank Accounts List cURL Source: https://docs-api.tpay.com/en/collect Example cURL command to retrieve the list of trusted bank accounts using the GET /collect/bank-accounts endpoint. Supports pagination with 'page' and 'limit' query parameters. ```bash curl --location 'https://api.tpay.com/collect/bank-accounts?page=1&limit=35' \ --header 'Authorization: Bearer ' ``` -------------------------------- ### Initiate BLIK Recurring Payment - Model A Source: https://docs-api.tpay.com/en/payment-methods/blik Use this request body to initiate a BLIK Recurring Payment with model A, which requires detailed autopayment configurations like frequency, limits, and dates. ```json { "description": "Recurring Payment initiation", "pay": { "blikPaymentData": { "blikToken": "777777", "aliases": { "value": "172838953_he7vqanrfazzaeyb3q", "label": "MyShop, your shop", "type": "PAYID", "autopayment": { "model": "A", "frequency": "1M", "singleLimitAmount": 10.0, "totalLimitAmount": 100.0, "currency": "PLN", "initDate": "2024-10-30 00:00:00", "expirationDate": "2025-01-01 00:00:00" } } } } } ``` -------------------------------- ### Create Transaction using cURL Source: https://docs-api.tpay.com/en/first-steps/first-transaction This cURL command demonstrates how to send a POST request to create a transaction, including the necessary headers and the JSON payload. ```bash curl --location 'https://api.tpay.com/transactions' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ' --data-raw '{ "amount": 0.1, "description": "Test transaction", "payer": { "email": "jan.nowak@example.com", "name": "Jan Nowak" }, "callbacks": { "notification": { "url": "https://example.shop/payment_notification" }, "payerUrls": { "success": "https://example.shop/success", "error": "https://example.shop/error" } } }' ``` -------------------------------- ### GET /collect/bank-accounts Source: https://docs-api.tpay.com/en/collect Retrieves the list of trusted bank accounts associated with the merchant. ```APIDOC ## GET /collect/bank-accounts ### Description Retrieves the list of trusted bank accounts associated with the merchant. ### Method GET ### Endpoint /collect/bank-accounts ### Parameters #### Query Parameters - **page** (integer) - Optional - The page number for pagination. - **limit** (integer) - Optional - The number of results to return per page. ### Request Example ```bash curl --location 'https://api.tpay.com/collect/bank-accounts?page=1&limit=35' \ --header 'Authorization: Bearer ' ``` ### Response #### Success Response (200) - **accounts** (array) - A list of trusted bank accounts. - **accountNumber** (string) - The IBAN account number. - **ownerName** (string) - The account holder's name. - **additionalInformation** (string) - Additional information about the account holder. #### Response Example ```json { "accounts": [ { "accountNumber": "PL49612314784098788023189726", "ownerName": "Jan Kowalski", "additionalInformation": "ul. Słoneczna 4/5c, 60-001 Poznań" } ] } ``` ``` -------------------------------- ### GET /refunds/{refundId} Source: https://docs-api.tpay.com/en/refunds Retrieves information about a single refund using its unique ID. ```APIDOC ## GET /refunds/{refundId} ### Description Retrieves information about a single refund. ### Method GET ### Endpoint `https://api.tpay.com/refunds/{refundId}` ### Parameters #### Path Parameters - **refundId** (string) - Required - The ID of the refund to retrieve. ### Request Example ```bash curl --location 'https://api.tpay.com/refunds/123' \ --header 'Authorization: Bearer ' ``` ### Response #### Success Response (200) - **schema** (object) - The schema containing refund details. ``` -------------------------------- ### Send Tokenization Request using cURL Source: https://docs-api.tpay.com/en/tokenization This cURL command demonstrates how to send a POST request to the /tokens endpoint for tokenization without charging. Include your access token in the Authorization header. ```bash curl --location 'https://api.tpay.com/tokens' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ' \ --data-raw '{ "payer": { "name": "John Doe", "email": "john.doe@example.com" }, "callbackUrl": "https://your-page.com/webhook/tokens" }' ``` -------------------------------- ### E-transfer Transaction Created Response Source: https://docs-api.tpay.com/en/payment-methods/e-transfer This is an example of a successful response after creating an E-transfer transaction. Store the 'transactionId' for future reference. ```json { "result": "success", "requestId": "cf47fa58ad6679fb6a86", "transactionId": "01K5BK4HEPB0WBCGT51FMTYSYJ", "title": "TR-CWM-D02D7HX", "posId": "ps_e4dkPVDEm4Jg726q", "status": "pending", "date": { "creation": "2024-07-01 21:38:13", "realization": null }, "amount": 0.1, "currency": "PLN", "description": "Testowa transakcja", "hiddenDescription": "", "payer": { "payerId": "py_a9rjlZWxRLdG1bqY", "email": "jan.nowak@example.com", "name": "Jan Nowak", "phone": "", "address": "", "city": "", "country": "PL", "postalCode": "" }, "payments": { "status": "pending", "method": null, "amountPaid": 0, "date": { "realization": null } }, "transactionPaymentUrl": "https://secure.tpay.com/?gtitle=TR-CWM-D02D7HX&uid=01J1QWW3AN9RYYSA978ECND8Z3" } ``` -------------------------------- ### POST /blik/alias - Initiate BLIK Recurring Payment Source: https://docs-api.tpay.com/en/payment-methods/blik Send a POST request to initiate a BLIK Recurring Payment. This endpoint allows you to set up recurring payments by providing necessary BLIK payment data and alias details. ```APIDOC ## POST /blik/alias ### Description Send an invitation to enable BLIK Recurring Payments without charging a fee by adding the appropriate fields related to Recurring Payment. ### Method POST ### Endpoint https://api.tpay.com/blik/alias ### Parameters #### Query Parameters - **lang** (string) - Required - The language in which the communication with the payer will be conducted (pl or en). #### Request Body - **description** (string) - Required - Description of the transaction visible to the payer. - **pay.blikPaymentData.blikToken** (string) - Required - 6-digit BLIK code entered by the payer in the form. - **pay.blikPaymentData.refuseNoPayId** (boolean) - Optional - The payment will be automatically rejected if the provided BLIK code was generated in the bank's application, which currently does not support BLIK Recurring Payments. - **pay.blikPaymentData.aliases.value** (string) - Required - Unique identifier for the Recurring Payment. - **pay.blikPaymentData.aliases.label** (string) - Optional - Unique name for the Recurring Payment, which could include an email or username and the plan name (e.g. "example@email.pl Gold+"), allowing for easy identification of the payment on the bank's payment list. It should account for Multiple recurring payments for a single customer and Plan changes in models M and O. - **pay.blikPaymentData.aliases.type** (string) - Required - Must be "PAYID". - **pay.blikPaymentData.aliases.autopayment.model** (string) - Required - The model in which the alias is registered (A, M, or O). - **pay.blikPaymentData.aliases.autopayment.frequency** (string) - Optional (Required for Model A) - Frequency of the collected payment, e.g., 1M - once per month. The values should consist of a number containing 1 to 3 digits, leading zeros omitted, followed by a single letter to denote the period: D, W, M, or Y. - **pay.blikPaymentData.aliases.autopayment.singleLimitAmount** (number) - Optional (Required for Model A) - Maximum amount for a one-time payment (applied in model A). - **pay.blikPaymentData.aliases.autopayment.totalLimitAmount** (number) - Optional (Required for Model A) - Total amount due (applied in model A). - **pay.blikPaymentData.aliases.autopayment.currency** (string) - Optional (Required for Model A) - Currency for the Recurring Payment – currently only PLN. - **pay.blikPaymentData.aliases.autopayment.initDate** (string) - Optional (Required for Model A) - Date of the first Recurring Transaction (required in Model A, optional for Model O, not sent for Model M). Format: YYYY-MM-DD HH:MM:SS. - **pay.blikPaymentData.aliases.autopayment.expirationDate** (string) - Optional (Required for Model A) - Expiration date for the Recurring Payment (required in Model A). If the parameter is not sent in models M or O, a non-expiring Recurring Payment will be generated. Format: YYYY-MM-DD HH:MM:SS. ### Request Example #### Model A ```json { "description": "Recurring Payment initiation", "pay": { "blikPaymentData": { "blikToken": "777777", "aliases": { "value": "172838953_he7vqanrfazzaeyb3q", "label": "MyShop, your shop", "type": "PAYID", "autopayment": { "model": "A", "frequency": "1M", "singleLimitAmount": 10.0, "totalLimitAmount": 100.0, "currency": "PLN", "initDate": "2024-10-30 00:00:00", "expirationDate": "2025-01-01 00:00:00" } } } } } ``` #### Model M ```json { "description": "Recurring Payment initiation", "pay": { "blikPaymentData": { "blikToken": "777777", "aliases": { "value": "172838953_he7vqanrfazzaeyb3q", "label": "MyShop, your shop", "type": "PAYID", "autopayment": { "model": "M" } } } } } ``` #### Model O ```json { "description": "Recurring Payment initiation", "pay": { "blikPaymentData": { "blikToken": "777777", "aliases": { "value": "172838953_he7vqanrfazzaeyb3q", "label": "MyShop, your shop", "type": "PAYID", "autopayment": { "model": "O" } } } } } ``` ### Response #### Success Response (200) - **result** (string) - success - The request was successfully processed. - **payments.status** (string) - correct - The Recurring Payment was successfully initiated. #### Response Example ```json { "result": "success", "posId": "ps_NyRBLzV5kelrpjaM", "status": "pending", "date": { "creation": "2024-05-08 21:01:15" }, "description": "Recurring Payment initiation" } ``` ``` -------------------------------- ### Sample Token Status Response Source: https://docs-api.tpay.com/en/tokenization This is a sample JSON response when retrieving token status. It includes expiration date, token status, card tail, and a URL for the card image. ```JSON { "expirationDate": "0427", "tokenStatus": "ACTIVE", "cardTail": "9588", "cardImage": "https://cards-img.tpay.com/01ABCDEFGH23456IJKLM7890NO_01ABCDEFGH23456IJKLMN7890V" } ``` -------------------------------- ### Generate OAuth Access Token Source: https://docs-api.tpay.com/en/first-steps/authorization Use this cURL command to send a POST request to the OAuth authorization endpoint to obtain an access token. Ensure you replace 'testclient' and 'testpass' with your actual client ID and secret. ```bash curl -X POST https://api.tpay.com/oauth/auth -d 'client_id=testclient&client_secret=testpass' ``` -------------------------------- ### Create E-transfer Transaction Source: https://docs-api.tpay.com/en/payment-methods/e-transfer Use this endpoint to initiate an E-transfer payment. You need to provide the transaction amount, description, payer details, and the channel ID for the selected bank. ```APIDOC ## POST /transactions ### Description Creates an E-transfer transaction. ### Method POST ### Endpoint `https://api.tpay.com/transactions` ### Parameters #### Request Body - **amount** (number) - Required - Transaction amount. - **description** (string) - Required - Description of the transaction visible to the payer. - **payer.email** (string) - Optional - Payer's email address. - **payer.name** (string) - Optional - Payer's full name. - **pay.channelId** (integer) - Required - Payment channel identifier for the selected bank. ### Request Example ```json { "amount": 0.1, "description": "Testowa transakcja E-przelew", "payer": { "email": "jan.nowak@example.com", "name": "Jan Nowak" }, "pay": { "channelId": 48 } } ``` ### Response #### Success Response (200) - **result** (string) - Indicates if the transaction was successfully created ('success'). - **status** (string) - The current status of the transaction ('pending'). - **transactionId** (string) - Unique identifier for the transaction. - **transactionPaymentUrl** (string) - URL to redirect the payer to complete the payment. #### Response Example ```json { "result": "success", "requestId": "cf47fa58ad6679fb6a86", "transactionId": "01K5BK4HEPB0WBCGT51FMTYSYJ", "title": "TR-CWM-D02D7HX", "posId": "ps_e4dkPVDEm4Jg726q", "status": "pending", "date": { "creation": "2024-07-01 21:38:13", "realization": null }, "amount": 0.1, "currency": "PLN", "description": "Testowa transakcja", "hiddenDescription": "", "payer": { "payerId": "py_a9rjlZWxRLdG1bqY", "email": "jan.nowak@example.com", "name": "Jan Nowak", "phone": "", "address": "", "city": "", "country": "PL", "postalCode": "" }, "payments": { "status": "pending", "method": null, "amountPaid": 0, "date": { "realization": null } }, "transactionPaymentUrl": "https://secure.tpay.com/?gtitle=TR-CWM-D02D7HX&uid=01J1QWW3AN9RYYSA978ECND8Z3" } ``` ``` -------------------------------- ### Add Bank Account to Trusted List cURL Source: https://docs-api.tpay.com/en/collect Example cURL command to add a bank account to the trusted list using the /collect/bank-accounts endpoint. Requires an authorization token and JSON payload. ```bash curl --location --request POST 'http://api.tpay.com/collect/bank-accounts' \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data '{ \ "accountNumber" : "PL49612314784098788023189726", \ "ownerName" : "Jan Kowalski", \ "additionalInformation" : "ul. Słoneczna 4/5c, 60-001 Poznań" \ }' ``` -------------------------------- ### Create BLIK Level 0 Transaction Request Source: https://docs-api.tpay.com/en/payment-methods/blik Send a POST request to create a BLIK Level 0 transaction. Include transaction details, payer information, and BLIK-specific data like blikToken and alias. ```json { "amount": 0.1, "description": "test transaction via BLIK", "payer": { "email": "", "name": "Jan Nowak", "ip": "127.0.0.1", "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36" }, "pay": { "groupId": 150, "blikPaymentData": { "blikToken": "908118", "aliases": { "value": "user_unique_alias_123", "type": "UID", "label": "Shop label" } } } } ``` -------------------------------- ### Initiate BLIK Recurring Payment - Model M Source: https://docs-api.tpay.com/en/payment-methods/blik This request body is used for initiating a BLIK Recurring Payment with model M. It requires fewer autopayment details compared to model A, focusing on the model type. ```json { "description": "Recurring Payment initiation", "pay": { "blikPaymentData": { "blikToken": "777777", "aliases": { "value": "172838953_he7vqanrfazzaeyb3q", "label": "MyShop, your shop", "type": "PAYID", "autopayment": { "model": "M" } } } } } ``` -------------------------------- ### Retrieve Refunds for a Transaction Source: https://docs-api.tpay.com/en/refunds Send a GET request to the transactions/{transactionId}/refunds endpoint to retrieve a list of refunds for a specific transaction. Query parameters can be used to filter results by date and pagination. ```bash curl --location 'https://api.tpay.com/transactions/01K5BK4HEPB0WBCGT51FMTYSYJ/refunds?from=2023-03-01%2013%3A44%3A55&to=2023-03-01%2014%3A44%3A55&page=1&limit=35' \ --header 'Authorization: Bearer ' ``` -------------------------------- ### Create Pay-By-Link Transaction using cURL Source: https://docs-api.tpay.com/en/payment-methods/pbl Send a POST request to the transactions endpoint with the specified headers and JSON data to create a Pay-By-Link transaction. Replace with your actual token. ```bash curl --location 'https://api.tpay.com/transactions' \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data-raw '{ "amount": 0.1, "description": "Testowa transakcja PBL", "payer": { "email": "jan.nowak@example.com", "name": "Jan Nowak" }, "pay" : { "channelId": 1 } }' ``` -------------------------------- ### Retrieve List of Recent Refunds Source: https://docs-api.tpay.com/en/refunds Send a GET request to the /refunds endpoint to retrieve a list of recent refunds. You can filter the results using query parameters such as payerEmail, transactionTitle, context, date range, and pagination. ```bash curl --location 'https://api.tpay.com/refunds?payerEmail=Jan%20Nowak&transactionTitle=TR-123&context=transactional&from=2024-03-01%2013%3A44%3A55&to=2024-06-01%2014%3A44%3A55&page=1&limit=35' \ --header 'Authorization: Bearer ' ``` -------------------------------- ### Create BLIK Recurring Payment (Model M) Source: https://docs-api.tpay.com/en/payment-methods/blik This JSON payload is for initiating a BLIK Level 0 transaction with authorization for BLIK Recurring Payments using Model M. Note that frequency, singleLimitAmount, totalLimitAmount, currency, initDate, and expirationDate are not required for this model. ```json { "amount": 21.08, "description": "Recurring Payment initiation", "hiddenDescription": "MyShop:user:172838953:2024-06", "payer": { "email": "test.example@test.example", "ip": "127.0.0.1", "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36" }, "pay": { "groupId": 150, "blikPaymentData": { "blikToken": "777777", "aliases": { "value": "172838953_he7vqanrfazzaeyb3q", "label": "MyShop, your shop", "type": "PAYID", "autopayment": { "model": "M" } } } } } ``` -------------------------------- ### BLIK Alias Notification - URL Encoded Query Parameters Source: https://docs-api.tpay.com/en/payment-methods/blik This example shows the format of a POST notification received from Tpay regarding BLIK alias events like unregistration, update, or expiration. It is sent in URL-encoded format. ```urlencode id=1010&event=ALIAS_UNREGISTER&md5sum=d303c5af701cdfcaed02a66603239eef&msg_value%5Bvalue%5D=user_unique_alias_123&msg_value%5Btype%5D=UID ``` -------------------------------- ### Configure Callback URL for Tokenization Source: https://docs-api.tpay.com/en/webhooks Set the `callbackUrl` parameter during tokenization creation to specify the endpoint where Tpay will send POST notifications for successful tokenization. ```json { "payer": { "name": "John Doe", "email": "john.doe@example.com" }, "callbackUrl": "https://your-page.com/webhook/tokens" } ``` -------------------------------- ### Create BLIK Recurring Payment (Model A) Source: https://docs-api.tpay.com/en/payment-methods/blik Use this JSON payload to initiate a BLIK Level 0 transaction with authorization for BLIK Recurring Payments using Model A. Ensure all required fields, including autopayment details, are correctly populated. ```json { "amount": 20.08, "description": "Recurring Payment initiation", "hiddenDescription": "MyShop:user:172838953:2024-06", "payer": { "email": "test.example@test.example", "ip": "127.0.0.1", "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36" }, "pay": { "groupId": 150, "blikPaymentData": { "blikToken": "777777", "aliases": { "value": "172838953_he7vqanrfazzaeyb3q", "label": "MyShop, your shop", "type": "PAYID", "autopayment": { "model": "A", "frequency": "1M", "singleLimitAmount": 10.0, "totalLimitAmount": 100.0, "currency": "PLN", "initDate": "2024-10-30 00:00:00", "expirationDate": "2025-01-01 00:00:00" } } } } } ```