### Google Pay Transaction Creation Response Example Source: https://docs-api.tpay.com/pl/payment-methods/google-pay An example of a successful JSON response from the tpay API after creating a Google Pay transaction, detailing the transaction status, ID, and payer information. ```JSON { "result": "success", "requestId": "8d67feda5067b7df97f0", "transactionId": "ta_zBQdVyQA1dZKVoL3", "title": "TR-BRA-CN7CN3X", "posId": "ps_NyRBLzV5kelrpjaM", "status": "pending", "date": { "creation": "2024-06-04 21:39:46", "realization": null }, "amount": 0.1, "currency": "PLN", "description": "Testowa płatność Google Pay", "hiddenDescription": "", "payer": { "payerId": "py_a9rjlZWxRLdG1bqY", "email": "jan.nowak@example.com", "name": "Jan Nowak", "ip": "127.0.0.1", "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-CN7CN3X&uid=01HZJC7HJXA31Z67XNWRV9R0A3" } ``` -------------------------------- ### Partial Refund Request Body Examples Source: https://docs-api.tpay.com/pl/marketplace Examples of JSON request bodies for performing a partial refund, demonstrating the structure when using merchant IDs or child transaction IDs. ```JSON { "childTransactions": [ { "merchantId": "01G6QRHEBPFAECEWRWVEEPM9WY", "products": [ { "externalId": "111.222.33.44", "quantity": 1.0, "unitPrice": 1250 }, { "externalId": "111.222.33.44", "quantity": 0.2, "unitPrice": 500 } ] }, { "merchantId": "01G6WAPZFNNX4CXBPKQH5MYD4R", "products": [ { "externalId": "Your.identifier.s1Nk", "quantity": 1, "unitPrice": 4000 } ] } ] } ``` ```JSON { "childTransactions": [ { "id": "01JENG92HA094GVX7QT60EP0K9", "products": [ { "externalId": "111.222.33.44", "quantity": 1.0, "unitPrice": 1250 }, { "externalId": "111.222.33.44", "quantity": 0.2, "unitPrice": 500 } ] }, { "id": "01JENG98VYHM1YF0SBDCM66AH9", "products": [ { "externalId": "Your.identifier.s1Nk", "quantity": 1, "unitPrice": 4000 } ] } ] } ``` -------------------------------- ### Google Pay Transaction Request Body Example Source: https://docs-api.tpay.com/pl/payment-methods/google-pay A sample JSON payload demonstrating the structure required to create a Google Pay transaction, including essential payer and transaction details. ```JSON { "amount": 0.1, "description": "Testowa płatność Google Pay", "payer": { "email": "jan.nowak@example.com", "name": "Jan Nowak", "ip": "127.0.0.1" }, "pay": { "groupId": 166 } } ``` -------------------------------- ### Create Google Pay Transaction cURL Example Source: https://docs-api.tpay.com/pl/payment-methods/google-pay An example using cURL to send a POST request to the tpay API for creating a Google Pay transaction, including authorization and content type headers. ```bash curl --location 'https://api.tpay.com/transactions' \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data-raw '{ "amount": 0.1, "description": "Testowa płatność Google Pay", "payer": { "email": "jan.nowak@example.com", "name": "Jan Nowak", "ip": "127.0.0.1" }, "pay": { "groupId": 166 } }' ``` -------------------------------- ### GET /marketplace/v1/bank-groups - List Payment Methods Source: https://docs-api.tpay.com/pl/marketplace Retrieves a list of payment methods available for a marketplace, considering the common payment methods enabled for all specified merchants. This is useful for displaying available payment options during checkout. ```APIDOC GET /marketplace/v1/bank-groups Description: Retrieves a list of payment methods available for a marketplace, considering the common payment methods enabled for all specified merchants. This is useful for displaying available payment options during checkout. Endpoint: https://api.tpay.com/marketplace/v1/bank-groups Parameters: - merchantId[] (array of strings, required): Identifier(s) of the merchant(s). Use the parameter repeatedly for multiple merchants. Example Usage: https://api.tpay.com/marketplace/v1/bank-groups?merchantId[]=01G6WAPZFNNX4CXBPKQH5MYD4R&merchantId[]=01G6QRHEBPFAECEWRWVEEPM9WY Note: This method requires providing identifiers for all merchants participating in the checkout. The returned set of methods is limited to those common to all specified merchants. If even one merchant does not have a specific payment method enabled (e.g., installment payments), that method will not be included in the response, even if other merchants have it enabled. ``` -------------------------------- ### GET /accounts/{accountId} - Get Specific Merchant Account Source: https://docs-api.tpay.com/pl/merchant-accounts Retrieves detailed information for a specific merchant account using its ID. This endpoint requires a GET request to the /accounts/{accountId} URL, where {accountId} is the unique identifier of the merchant account. The response adheres to the Account schema. ```APIDOC GET /accounts/{accountId} - Retrieves detailed information for a specific merchant account. - Endpoint: https://api.tpay.com/accounts/{accountId} - Parameter: - accountId: The unique identifier of the merchant account. - Response Schema: Account - Example Response: { "result": "success", "requestId": "376f310aba18a2ed6389", "id": "01GM5QNY2SANHEXFK6FEV2DWYD", "offerCode": "PFA7M", "email": "merchant@example.com", "taxId": "7773061579", "regon": "", "krs": "", "legalForm": 20, "categoryId": 66, "verificationStatus": 0, "activationLink": "https://panel.tpay.com/Auth/Account/Activate/123xyz", "website": [ { "posId": "01GM5QNY2N7Z4BKTAH8JJAXX25", "accountId": "01GM5QNY2SANHEXFK6FEV2DWYD", "name": "Przykladowe Zakupy Online", "friendlyName": "", "description": "Zakupy online - rtv i agd", "url": "https://przykladowezakupy.pl", "date": { "create": "2022-12-13 13:34:46", "modification": "2023-02-13 14:23:34" }, "settings": { "confirmationCode": "txf&#YE37gxq8f5q+*gC7q>%hq*6o", "isTestMode": false }, "verificationScope": 0, "verificationDate": "0000-00-00 00:00:00" } ], "person": [ { "personId": "pr_X9x61ZG9KJrqPOAN", "name": "John", "surname": "Doe", "nationality": "", "sharesPct": 0, "pesel": "", "isBeneficiary": false, "isRepresentative": false, "isContactPerson": true, "isAuthorizedPerson": false, "pepStatement": 0, "dateOfBirth": null, "countryOfBirth": "", "typeOfDocument": 0, "serialNumber": "", "expiryDate": null, "issuingAuthority": "", "contact": [ { "contact": "987654321", "type": 2 }, { "contact": "test@test.com", "type": 1 } ] } ], "address": [ { "addressId": "ar_e1Z3xlEEDBElXngY", "friendlyName": "Adres Korespondencyjny", "name": "Example Sp. z o.o.", "street": "Ul. Jelenia", "houseNumber": "123", "roomNumber": "", "postalCode": "54-134", "postOffice": "", "city": "Warszawa", "country": "PL", "phone": "", "isMain": true, "isCorrespondence": true, "isInvoice": true } ], "transactionApiCredentials": { "merchantId": 12345, "apiKey": "string" }, "apiCredentials": [] } ``` -------------------------------- ### GET /accounts - List Merchant Accounts Source: https://docs-api.tpay.com/pl/merchant-accounts Retrieves a list of all registered merchant accounts. This endpoint requires a GET request to the /accounts URL. The response includes a list of accounts with their details, following the AccountListResultResponse schema. ```APIDOC GET /accounts - Retrieves a list of all registered merchant accounts. - Endpoint: https://api.tpay.com/accounts - Response Schema: AccountListResultResponse - Example Response: { "list": [ { "result": "success", "requestId": "376f310aba18a2ed6389", "id": "01GM5QNY2SANHEXFK6FEV2DWYD", "offerCode": "PFA7M", "email": "merchant@example.com", "taxId": "7773061579", "regon": "", "krs": "", "legalForm": 20, "categoryId": 66, "verificationStatus": 0, "activationLink": "https://panel.tpay.com/Auth/Account/Activate/123xyz", "website": [ { "posId": "01GM5QNY2N7Z4BKTAH8JJAXX25", "accountId": "01GM5QNY2SANHEXFK6FEV2DWYD", "name": "Przykladowe Zakupy Online", "friendlyName": "", "description": "Zakupy online - rtv i agd", "url": "https://przykladowezakupy.pl", "date": { "create": "2022-12-13 13:34:46", "modification": "2023-02-13 14:23:34" }, "settings": { "confirmationCode": "txf&#YE37gxq8f5q+*gC7q>%hq*6o", "isTestMode": false }, "verificationScope": 0, "verificationDate": "0000-00-00 00:00:00", "verificationStatus": 0 } ], "person": [ { "personId": "pr_X9x61ZG9KJrqPOAN", "name": "John", "surname": "Doe", "nationality": "", "sharesPct": 0, "pesel": "", "isBeneficiary": false, "isRepresentative": false, "isContactPerson": true, "isAuthorizedPerson": false, "pepStatement": 0, "dateOfBirth": null, "countryOfBirth": "", "typeOfDocument": 0, "serialNumber": "", "expiryDate": null, "issuingAuthority": "", "contact": [ { "contact": "987654321", "type": 2 }, { "contact": "test@test.com", "type": 1 } ] } ], "address": [ { "addressId": "ar_e1Z3xlEEDBElXngY", "friendlyName": "Adres Korespondencyjny", "name": "Example Sp. z o.o.", "street": "Ul. Jelenia", "houseNumber": "123", "roomNumber": "", "postalCode": "54-134", "postOffice": "", "city": "Warszawa", "country": "PL", "phone": "", "isMain": true, "isCorrespondence": true, "isInvoice": true } ], "transactionApiCredentials": { "merchantId": 12345, "apiKey": "string" }, "apiCredentials": [] } ], "result": "success", "requestId": "376f310aba18a2ed6389", "page": 1, "limit": 35, "total": 1 } ``` -------------------------------- ### API: Rejestracja konta sprzedawcy Source: https://docs-api.tpay.com/pl/merchant-accounts Metoda POST do rejestracji nowego konta sprzedawcy w systemie Tpay. Pozwala na przekazanie szczegółowych danych firmy, adresowych, kontaktowych oraz zgód. Endpoint: https://api.tpay.com/v1/accounts/merchant. ```APIDOC POST /v1/accounts/merchant Opis: Rejestruje nowe konto sprzedawcy w systemie Tpay. Parametry żądania (Body): - offerCode (string, wymagany): Kod oferty, pod który zostanie przypisane konto. - email (string, wymagany): Adres email sprzedawcy. - taxId (string, opcjonalny): Numer identyfikacji podatkowej (NIP dla polskich podmiotów). - regon (string, opcjonalny): Numer Regon. - krs (string, opcjonalny): Numer KRS. - legalForm (integer, opcjonalny): Forma działalności gospodarczej (patrz lista form działalności). - categoryId (integer, opcjonalny): Kategoria prowadzonej sprzedaży (patrz lista kategorii sprzedaży). - address (array of objects, opcjonalny): - name (string): Nazwa firmy. - street (string): Ulica. - houseNumber (string): Numer domu. - flatNumber (string, opcjonalny): Numer mieszkania. - postalCode (string): Kod pocztowy. - city (string): Miasto. - country (string): Kraj (np. "PL"). - phone (string, opcjonalny): Telefon. - isMain (boolean): Podany adres jest adresem głównym. - isCorrespondence (boolean, opcjonalny): Podany adres służy do korespondencji. - isInvoice (boolean, opcjonalny): Podany adres służy do faktur. - website (array of objects, opcjonalny): - url (string): Adres URL punktu sprzedaży. - name (string): Nazwa punktu sprzedaży. - contactPerson (array of objects, opcjonalny): - name (string): Imię osoby kontaktowej. - surname (string): Nazwisko osoby kontaktowej. - phone (string, opcjonalny): Telefon osoby kontaktowej. - email (string): Adres email osoby kontaktowej. - merchantApiConsent (boolean, opcjonalny): Zgoda na pozyskanie danych dostępowych do API. Odpowiedź (MerchantCreated): - result (string): Status operacji (np. "success"). - id (string): Unikalny identyfikator utworzonego sprzedawcy. - offerCode (string): Kod oferty przypisany do sprzedawcy. - email (string): Email sprzedawcy. - taxId (string | null): Numer NIP. - regon (string | null): Numer Regon. - krs (string | null): Numer KRS. - legalForm (integer | null): Forma działalności. - categoryId (integer | null): Kategoria sprzedaży. - verified (boolean): Czy konto zostało zweryfikowane. - activationLink (string): Link aktywacyjny dla sprzedawcy. - website (array of objects): Lista powiązanych punktów sprzedaży. - address (array of objects): Lista powiązanych adresów. - person (array of objects): Lista powiązanych osób kontaktowych. Błędy: - W przypadku błędów walidacji lub braku wymaganych parametrów, API zwróci odpowiedni kod błędu HTTP i komunikat. ``` -------------------------------- ### Handling Multiple BLIK Aliases Source: https://docs-api.tpay.com/pl/payment-methods/blik Describes how to handle scenarios where a user has multiple active BLIK aliases. It includes the API response structure for such cases and how to re-initiate a payment with a selected alias. ```APIDOC API Response for Multiple Aliases: Description: When a payment attempt fails due to multiple active aliases for a given value, the API returns a list of available application alternatives. Example Response: { "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" } ] } } Action: Display the list of alternatives to the payer. Allow the payer to select an alias and then resubmit the transaction using the chosen `applicationCode` in the `key` field. ``` ```APIDOC Resubmitting Payment with Selected Alias: Description: To complete a payment when multiple aliases exist, resubmit the transaction providing the `applicationCode` of the selected alias in the `key` field. Example Request Body for Resubmission: { "groupId": 150, "blikPaymentData": { "aliases": { "value": "user_unique_alias_123", "type": "UID", "key": "1ec8f352-463c-6334-be44-9fede70e64b8" } } } ``` -------------------------------- ### Authorization - Generate Access Token Source: https://docs-api.tpay.com/pl/first-steps/authorization Describes the process of obtaining an access token using OAuth 2.0 for secure API requests. It details the POST request endpoint, required content type, and parameters needed to authenticate with the tpay API. ```APIDOC POST /oauth/auth Endpoint: https://api.tpay.com/oauth/auth Content-Type: application/x-www-form-urlencoded Description: Requests an access token for API authentication using OAuth 2.0. Parameters: - client_id: (string) Your unique client identifier obtained from the Merchant Panel. - client_secret: (string) Your client secret password, also obtained from the Merchant Panel. This is only visible upon initial generation. Example Usage: Send a POST request to the specified endpoint with client_id and client_secret as form-urlencoded data. Related: - OAuth 2.0: The underlying authorization framework. - Merchant Panel: Where client credentials (client_id, client_secret) are generated. ``` -------------------------------- ### Delete BLIK Alias API Source: https://docs-api.tpay.com/pl/payment-methods/blik Provides details for deleting a BLIK alias via the tpay API. It specifies the HTTP method, endpoint, required parameters, and an example request body. ```APIDOC DELETE /blik/alias/{aliasValue} Description: Deletes a BLIK alias from the system. Endpoint: https://api.tpay.com/blik/alias/{aliasValue} Parameters: Path Parameters: aliasValue (string): The value of the alias to be deleted. Request Body: type (string): Specifies the type of the alias, typically 'UID'. Example Request Body: { "aliasType": "UID" } ``` -------------------------------- ### Przykład odpowiedzi po utworzeniu sprzedawcy Source: https://docs-api.tpay.com/pl/merchant-accounts Przykładowa odpowiedź z systemu Tpay po pomyślnej rejestracji konta sprzedawcy, zawierająca dane utworzonego konta i link aktywacyjny. ```JSON { "result": "success", "id": "01JQ404XV7KJPRD5PHFFZ6R9YR", "offerCode": "9u7UP", "email": "jan.kowalski@example.com", "taxId": null, "regon": null, "krs": null, "legalForm": null, "categoryId": null, "verified": false, "activationLink": "https://panel.tpay.com/Auth/Account/Activate/xyz123", "website": [ { "posId": "01JQ404XVJBPR066ZK1XX5A0A0", "accountId": "01JQ404XV7KJPRD5PHFFZ6R9YR", "name": "", "friendlyName": "", "description": "", "url": "", "date": { "create": "2025-03-24 12:56:00", "modification": null }, "settings": { "confirmationCode": "i3DCcHbIA_81rI@FeP4$+LMScK2X#T_|", "isTestMode": true }, "verificationScope": 0, "verificationDate": null, "verificationStatus": 0 } ], "address": [ { "addressId": "ar_8OqmRLlQoV9eXgdx", "friendlyName": "-", "name": "-", "street": "-", "houseNumber": "", "flatNumber": "", "postalCode": "-", "city": "-", "country": "PL", "phone": "", "isMain": true, "isCorrespondence": true, "isInvoice": true } ], "person": [] } ``` -------------------------------- ### Process Full Refund Source: https://docs-api.tpay.com/pl/marketplace Initiates a complete refund for a specified transaction. Requires the transaction ID to be included in the URL. The request body should be an empty JSON object. ```APIDOC POST /marketplace/v1/transaction/{transactionId}/refunds Description: Initiates a full refund for a transaction. Endpoint: https://api.tpay.com/marketplace/v1/transaction/{transactionId}/refunds Parameters: - transactionId (string, required): The unique identifier of the transaction to be refunded. Request Body: An empty JSON object: {} Example URL: https://api.tpay.com/marketplace/v1/transaction/01GENKAM5WKYYDJQ929P7T1MXN/refunds Returns: (Details not provided in source text, typically a success status or refund ID) ``` -------------------------------- ### Create Google Pay Transaction API Source: https://docs-api.tpay.com/pl/payment-methods/google-pay Send a POST request to the /transactions endpoint to initiate a Google Pay transaction. Specify transaction amount, description, payer details, and the Google Pay group ID (166). The response includes transaction status and ID. ```APIDOC POST /transactions Endpoint for creating a Google Pay transaction. Parameters: - amount (number): Transaction amount in PLN. - description (string): Description visible to the payer. - payer.email (string): Payer's email address. - payer.name (string): Payer's full name. - payer.ip (string): Payer's IP address (IPv4 or IPv6). - pay.groupId (integer): Payment group identifier for Google Pay, value is 166. Response: - result (string): Indicates success ('success') or failure. - status (string): Current status of the transaction (e.g., 'pending'). - transactionId (string): Unique identifier for the transaction. - transactionPaymentUrl (string): URL for the payment gateway. Example Request Body: { "amount": 0.1, "description": "Testowa płatność Google Pay", "payer": { "email": "jan.nowak@example.com", "name": "Jan Nowak", "ip": "127.0.0.1" }, "pay": { "groupId": 166 } } Example Response: { "result": "success", "requestId": "8d67feda5067b7df97f0", "transactionId": "ta_zBQdVyQA1dZKVoL3", "title": "TR-BRA-CN7CN3X", "posId": "ps_NyRBLzV5kelrpjaM", "status": "pending", "date": { "creation": "2024-06-04 21:39:46", "realization": null }, "amount": 0.1, "currency": "PLN", "description": "Testowa płatność Google Pay", "hiddenDescription": "", "payer": { "payerId": "py_a9rjlZWxRLdG1bqY", "email": "jan.nowak@example.com", "name": "Jan Nowak", "ip": "127.0.0.1", "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-CN7CN3X&uid=01HZJC7HJXA31Z67XNWRV9R0A3" } ``` -------------------------------- ### Przykładowa odpowiedź po utworzeniu transakcji Source: https://docs-api.tpay.com/pl/payment-methods/google-pay Przykładowa odpowiedź JSON z API po pomyślnym utworzeniu transakcji Google Pay, zawierająca szczegóły transakcji oraz URL do panelu płatności. ```JSON { "result": "success", "requestId": "8d67feda5067b7df97f0", "transactionId": "ta_zBQdVyQA1dZKVoL3", "title": "TR-BRA-CN7CN3X", "posId": "ps_NyRBLzV5kelrpjaM", "status": "pending", "date": { "creation": "2024-06-04 21:39:46", "realization": null }, "amount": 0.1, "currency": "PLN", "description": "Testowa płatność Google Pay", "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-BRA-CN7CN3X&uid=01HZJC7HJXA31Z67XNWRV9R0A3" } ``` -------------------------------- ### APIDOC: Create BLIK Level 0 Transaction with Recurring Payment Source: https://docs-api.tpay.com/pl/payment-methods/blik This documentation describes how to create a BLIK Level 0 transaction with recurring payment authorization using the tpay API. It details the POST request to `https://api.tpay.com/transactions` and outlines the required parameters for amount, payer details, and BLIK-specific payment data, including alias configuration for recurring payments. ```APIDOC POST https://api.tpay.com/transactions Parameters: amount (float): Transaction amount in PLN. description (string): Transaction description visible to the user. payer.email (string): Payer's email address. payer.name (string): Payer's full name. payer.ip (string): Payer's IP address (IPv4 or IPv6). payer.userAgent (string): Payer's browser User Agent. groupId (integer): Payment group ID for BLIK: 150. blikPaymentData.blikToken (string): 6-digit BLIK code entered by the user. blikPaymentData.refuseNoPayId (boolean): Automatically refuse payment if BLIK code is from a bank not supporting recurring payments. blikPaymentData.aliases.value (string): Unique identifier for the Recurring Payment. blikPaymentData.aliases.label (string): Unique name for the Recurring Payment (e.g., "example@email.pl Plan Gold+"). blikPaymentData.aliases.type (string): Type of alias, e.g., "PAYID". blikPaymentData.aliases.autopayment.model (string): Model for registering the alias (A, M, or O). blikPaymentData.aliases.autopayment.frequency (string): Fee collection frequency (e.g., "1M" for monthly). Required for Model A, optional for M, not sent for O. blikPaymentData.aliases.autopayment.singleLimitAmount (float): Maximum single payment amount (in PLN), used in Model A. blikPaymentData.aliases.autopayment.totalLimitAmount (float): Total amount due (in PLN), used in Model A. blikPaymentData.aliases.autopayment.currency (string): Currency of the Recurring Payment (currently only PLN). blikPaymentData.aliases.autopayment.initDate (string): Date of the first Recurring Transaction (required for Model A, optional for O, not sent for M). blikPaymentData.aliases.autopayment.expirationDate (string): Expiration date of the Recurring Payment (required for Model A). If not provided for M or O, the payment becomes indefinite. ``` ```json { "amount": 20.08, "description": "Założenie Płatności Powtarzalnej", "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, sklep z duszą", "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" } } } } } ``` ```json { "amount": 21.08, "description": "Założenie Płatności Powtarzalnej", "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, sklep z duszą", "type": "PAYID", "autopayment": { "model": "M" } } } } } ``` -------------------------------- ### Przykład rozbudowanego żądania rejestracji Source: https://docs-api.tpay.com/pl/merchant-accounts Przykładowe żądanie POST do API rejestracji konta sprzedawcy z wypełnionymi dodatkowymi danymi, takimi jak NIP, REGON, KRS, forma działalności, kategoria oraz dane adresowe. ```JSON { "offerCode": "9u7UP", "email": "jan.kowalski@example.com", "taxId": "7773061579", "regon": "30087843700000", "krs": "0000412357", "legalForm": 36, "categoryId": 60, "address": [ { "name": "Example Sp. z o.o.", "street": "ul. Przykładowa", "houseNumber": "44b", "flatNumber": "1", "postalCode": "11-111", "city": "Warszawa", "country": "PL", "phone": "123123123", "isMain": true } ] } ``` -------------------------------- ### Przykładowe żądanie POST /transactions (curl) Source: https://docs-api.tpay.com/pl/payment-methods/google-pay Przykład użycia narzędzia curl do wysłania żądania POST do endpointu /transactions w celu utworzenia transakcji Google Pay. ```bash curl --location 'https://api.tpay.com/transactions' \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data-raw '{ "amount": 0.1, "description": "Testowa płatność Google Pay", "payer": { "email": "jan.nowak@example.com", "name": "Jan Nowak" }, "pay": { "groupId": 166 } }' ``` -------------------------------- ### Przykład podstawowego żądania rejestracji Source: https://docs-api.tpay.com/pl/merchant-accounts Podstawowe żądanie POST do API rejestracji konta sprzedawcy, zawierające jedynie wymagane pola: kod oferty i adres email. ```JSON { "offerCode": "9u7UP", "email": "jan.kowalski@example.com" } ``` -------------------------------- ### Manage Token Status and Deletion Source: https://docs-api.tpay.com/pl/tokenization Provides endpoints for retrieving the status and associated card details of a token, as well as for deleting a token. Both operations use the same base URL structure but different HTTP methods. ```APIDOC GET /tokens/{tokenValue} Description: Retrieves the status and card details for a given token. Parameters: - tokenValue (path): The unique value of the token obtained from a webhook notification. Response Schema: GetToken Response Parameters: - expirationDate (string): The expiration date of the tokenized card in MMYY format. - tokenStatus (string): The current status of the token (e.g., ACTIVE, DELETED, SUSPENDED). - cardTail (string): The last 4 digits of the tokenized card number. - cardImage (string): A URL pointing to the image of the tokenized card. Example URL: https://api.tpay.com/tokens/bfbde8ba10da6215fe92fb28b8787d154afc5cdacaee72fbb91042ccf544f871 Example Response: { "expirationDate": "0427", "tokenStatus": "ACTIVE", "cardTail": "9588", "cardImage": "https://cards-img.tpay.com/01ABCDEFGH23456IJKLM7890NO_01ABCDEFGH23456IJKLMN7890V" } DELETE /tokens/{tokenValue} Description: Deletes and deactivates a payment token. Parameters: - tokenValue (path): The unique value of the token obtained from a webhook notification. Response: - HTTP Status 204 - No Content Note: The token deletion process is asynchronous. Example URL: https://api.tpay.com/tokens/bfbde8ba10da6215fe92fb28b8787d154afc5cdacaee72fbb91042ccf544f871 ```