### Query transaction with Go Source: https://docs.paybyrd.com/api-reference/transactions/query Go example using net/http to GET a transaction. Prints the response body. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://gateway.paybyrd.com/api/v2/transactions/{transactionId}" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("x-api-key", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### 200 Response Body for Setup URL Source: https://docs.paybyrd.com/api-reference/webhooks/setup-url Example 200 response body from the setup URL request. Contains the configured webhook URL, a generated webhookUser UUID, and a webhookPassword used for webhook authentication. ```json { "url": "https://your-url.com/webhook", "webhookUser": "b73e9449-e1dc-485a-b4c7-19c540e96cd1", "webhookPassword": "@bc123" } ``` -------------------------------- ### Successful webhook setup response Source: https://docs.paybyrd.com/api-reference/webhooks/setup-url Example success response (HTTP 200) from the webhook setup endpoint. Contains the configured URL, a generated webhookUser UUID, and a webhookPassword for authentication. ```json 200 { "url": "https://your-url.com/webhook", "webhookUser": "b73e9449-e1dc-485a-b4c7-19c540e96cd1", "webhookPassword": "@bc123" } ``` -------------------------------- ### Install Card Collect with yarn Source: https://docs.paybyrd.com/embed/card-collect Install the @paybyrd/card-collect package using yarn. ```bash yarn add @paybyrd/card-collect ``` -------------------------------- ### Query transaction with Python requests Source: https://docs.paybyrd.com/api-reference/transactions/query Python example using the requests library to GET a transaction. Prints the response text. ```python import requests url = "https://gateway.paybyrd.com/api/v2/transactions/{transactionId}" headers = {"x-api-key": ""} response = requests.get(url, headers=headers) print(response.text) ``` -------------------------------- ### Install Card Collect with npm Source: https://docs.paybyrd.com/embed/card-collect Install the @paybyrd/card-collect package using npm. ```bash npm install @paybyrd/card-collect ``` -------------------------------- ### Install @paybyrd/threedsecure-service-js Source: https://docs.paybyrd.com/advanced/3ds-authentication/sdk-setup Install the Paybyrd ThreeDSecure SDK using npm or yarn. The SDK is compatible with TypeScript. ```bash npm i @paybyrd/threedsecure-service-js ``` ```bash yarn add @paybyrd/threedsecure-service-js ``` -------------------------------- ### Initialize Paybyrd Payment App with InitiateRequest Source: https://docs.paybyrd.com/integrations/point-of-sale/payment-sdk-android Creates an InitiateRequest with service credential email, password, merchant identifier, and forceInit flag. Calls PaybyrdSettingsSDK.createInitializationData to get an intent and starts the activity for result using the initialization request code. ```kotlin val initRequest = InitiateRequest( serviceCredentialEmail, serviceCredencialPassword, merchantIdentifier, forceInit ) val initData = PaybyrdSettingsSDK.createInitializationData( requireContext(), initRequest ) startActivityForResult(initData.intent, PaybyrdSettingsSDK.INITIALIZATION_REQUEST_CODE) ``` -------------------------------- ### Query transaction with Ruby Net::HTTP Source: https://docs.paybyrd.com/api-reference/transactions/query Ruby example using Net::HTTP to GET a transaction. Prints the response body. ```ruby require 'uri' require 'net/http' url = URI("https://gateway.paybyrd.com/api/v2/transactions/{transactionId}") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["x-api-key"] = '' response = http.request(request) puts response.read_body ``` -------------------------------- ### Setup Webhook URL with PUT /api/v1/webhook Source: https://docs.paybyrd.com/api-reference/webhooks/setup-url Send a PUT request to the PayByrd webhook endpoint to set up a webhook URL. All examples use the same endpoint, headers, and payload; replace with your actual API key. ```bash curl --request PUT \ --url https://gateway.paybyrd.com/api/v1/webhook \ --header 'Content-Type: application/json' \ --header 'x-api-key: ' \ --data ' { "url": "https://your-url.com/webhook" } ' ``` ```python import requests url = "https://gateway.paybyrd.com/api/v1/webhook" payload = { "url": "https://your-url.com/webhook" } headers = { "x-api-key": "", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.text) ``` ```javascript const options = { method: 'PUT', headers: {'x-api-key': '', 'Content-Type': 'application/json'}, body: JSON.stringify({url: 'https://your-url.com/webhook'}) }; fetch('https://gateway.paybyrd.com/api/v1/webhook', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); ``` ```php "https://gateway.paybyrd.com/api/v1/webhook", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "PUT", CURLOPT_POSTFIELDS => json_encode([ 'url' => 'https://your-url.com/webhook' ]), CURLOPT_HTTPHEADER => [ "Content-Type: application/json", "x-api-key: " ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gateway.paybyrd.com/api/v1/webhook" payload := strings.NewReader("{\n \"url\": \"https://your-url.com/webhook\"\n}") req, _ := http.NewRequest("PUT", url, payload) req.Header.Add("x-api-key", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` ```java HttpResponse response = Unirest.put("https://gateway.paybyrd.com/api/v1/webhook") .header("x-api-key", "") .header("Content-Type", "application/json") .body("{\n \"url\": \"https://your-url.com/webhook\"\n}") .asString(); ``` ```ruby require 'uri' require 'net/http' url = URI("https://gateway.paybyrd.com/api/v1/webhook") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Put.new(url) request["x-api-key"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"url\": \"https://your-url.com/webhook\"\n}" response = http.request(request) puts response.read_body ``` -------------------------------- ### Go HTTP GET to get all webhook settings Source: https://docs.paybyrd.com/api-reference/webhooks/gets-all-webhook-settings Uses Go's net/http package to send a GET request to the PayByrd webhooks endpoint. Requires an x-api-key header. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://gateway.paybyrd.com/api/v2/webhooks" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("x-api-key", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Query transaction with Java Unirest Source: https://docs.paybyrd.com/api-reference/transactions/query Java example using Unirest to GET a transaction. Returns the response as a string. ```java HttpResponse response = Unirest.get("https://gateway.paybyrd.com/api/v2/transactions/{transactionId}") .header("x-api-key", "") .asString(); ``` -------------------------------- ### Return codes example response Source: https://docs.paybyrd.com/api-reference/api-code-reference Example JSON response showing the code and description fields returned by all payment and transaction endpoints, including Create Payment, Capture, Refund, Release, and Query Transaction. ```json { "code": "BYRD200", "description": "Operation successfully completed", "transactionId": "c16ce479-319d-4e7b-a966-7735c34b2cc5", "amount": "10.00" } ``` -------------------------------- ### Go GET request to retrieve a token Source: https://docs.paybyrd.com/api-reference/tokenization/get-token-by-id Uses the net/http package to send a GET request with the x-api-key header and prints the response body. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://gateway.paybyrd.com/api/v2/tokens/{tokenId}" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("x-api-key", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### GET /api/v1/settings Source: https://docs.paybyrd.com/api-reference/webhooks Lists all webhook configurations associated with the API key. ```APIDOC ## GET /api/v1/settings ### Description Lists all webhook configurations associated with the API key. ### Method GET ### Endpoint https://webhook.paybyrd.com/api/v1/settings ### Parameters #### Headers - **x-api-key** (string) - Required - Your API key for authentication. ### Request Example bash curl --location 'https://webhook.paybyrd.com/api/v1/settings' \ --header 'x-api-key: {your_api_key}' ### Response #### Success Response (200) No response body documented. ``` -------------------------------- ### Checkout URL examples for each variant Source: https://docs.paybyrd.com/embed/checkout-parameter-reference Examples of the Checkout URL for each display variant: no variant (default), default, detailed, minimal, and immersive. The immersive variant is based on default with an extra banner image. ```text https://chk.paybyrd.com/?checkoutKey=<…>&orderId=<…>&configs=<…> ``` ```text https://chk.paybyrd.com/default?checkoutKey=<…>&orderId=<…>&configs=<…> ``` ```text https://chk.paybyrd.com/detailed?checkoutKey=<…>&orderId=<…>&configs=<…> ``` ```text https://chk.paybyrd.com/minimal?checkoutKey=<…>&orderId=<…>&configs=<…> ``` ```text https://chk.paybyrd.com/immersive?checkoutKey=<…>&orderId=<…>&configs=<…> ``` -------------------------------- ### Metadata object example Source: https://docs.paybyrd.com/api-reference/orders/create-order Example of the metadata object that can be passed to Paybyrd and is returned in order queries and status change notifications. ```json { "key1": 1, "key2": "value" } ``` -------------------------------- ### 200 response example Source: https://docs.paybyrd.com/api-reference/transactions/query Example JSON response for a successful query. Contains transaction details such as amount, status, and referenced transactions. ```json { "amount": "13.00", "isoAmount": 1300, "brand": "MASTER", "code": "BYRD200", "createdDate": "2021-06-01T01:21:41Z", "currency": "EUR", "description": "Operation successfully completed", "externalCustomIdentifier": "33ff7bd9-1d6e-4bd0-bc2d-a4aef8614972", "externalSessionIdentifier": "bda69b31-8a81-4779-801e-f7d6e5d3fa47", "externalTransactionIdentifier": "dc3f1e75-0e4b-49c5-a68e-5adea241e749", "index": 0, "initiatedFrom": "PayByLink", "operationType": "Capture", "personId": 10, "referencedTransactions": [ { "amount": "13.00", "isoAmount": 1300, "capturedDate": "2021-05-31T22:04:31Z", "createdDate": "2021-05-31T22:01:57Z", "currency": "EUR", "externalCustomIdentifier": "c9a625d4-d968-47a0-b237-e5d4f31dfcd4", "index": 1, "initiatedFrom": "PayByLink", "operationType": "PreAuth", "orderRef": "AMZ1962", "personId": 10, "subscriptionGuid": "5b16391d-b8b8-45c9-8aa3-4f6f3ce5a656", "terminalId": "EM30X4X5X0", "transactionDate": "2021-05-31T22:01:57Z", "transactionId": "c9a625d4-d968-47a0-b237-e5d4f31dfcd4" } ], "status": "Success", "subscriptionGuid": "5b16391d-b8b8-45c9-8aa3-4f6f3ce5a656", "transactionDate": "2021-06-01T01:21:41Z", "transactionId": "33ff7bd9-1d6e-4bd0-bc2d-a4aef8614972", "acquirerResponseCode": "00-I", "acquirerResponseMessage": "Authorized", "acquirerEntity": "11854", "acquirerReference": "999999935" } ``` -------------------------------- ### GET webhook settings with Go net/http - Gets a webhook settings by its Id Source: https://docs.paybyrd.com/api-reference/webhooks/gets-a-webhook-settings-by-its-id Sends a GET request using Go's net/http package and prints the response body. ```Go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://gateway.paybyrd.com/api/v2/webhooks/{webhookId}" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("x-api-key", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Query Order Response Example Source: https://docs.paybyrd.com/api-reference/orders/query-order Example response body for a successful query of an order. Shows the order details, shopper information, shopping cart, payment options, and transaction details including Multicaixa Express deeplink and QR code URL. ```json { "orderId": "63a8a157-81c9-46ea-84b4-2bef6daad3fa", "orderDate": "2021-08-24T17:45:27Z", "expiresAt": "2021-08-25T17:45:27Z", "status": "paid", "isoAmount": 5000, "currency": "EUR", "orderRef": "ABC123456", "shopper": { "shopperId": "676b5023-9624-4d19-bdd2-c61b1be803b7", "firstName": "JHOSH", "lastName": "JONES", "email": "jhoshjs@dominio.com", "phoneCountryCode": 351, "phoneNumber": "123123123", "ip": "111.111.111.111" }, "shoppingCart": [ { "description": "Product", "amount": 2500, "categories": [ "Category 1", "Category 2" ], "shipping": { "shippingMethod": "STD" }, "type": "Product", "imageUrl": "https://cdn.merchant.com/products/ticket.png" } ], "orderOptions": { "redirectUrl": "https://your-site-url/payment-finished", "culture": "en-US", "checkoutVersion": 2, "expiresIn": "00:15:00" }, "paymentOptions": { "maxAttempts": 1, "sessionExpiresIn": "00:10:00", "allowedPaymentMethods": [ "CARD", "SIBS_MULTIBANCO", "SEPA", "IDEAL", "MBWAY" ], "cardOptions": { "isPreAuth": false }, "tokenOptions": { "customReference": "ABC123456", "tokenizationIsRequired": false, "tokenizationMethod": "cardOnFile" } }, "index": 1, "transactions": { "currency": "AOA", "orderRef": "AMZ1962", "brand": "MULTICAIXAEXPRESS", "operationType": "Payment", "status": "Success", "createdDate": "2021-05-31T22:01:57Z", "transactionDate": "2021-05-31T22:01:57Z", "initiatedFrom": "HostedForm", "personId": 10, "index": 2, "externalSessionIdentifier": "20c7c4b3-95cc-4ead-aa0b-918b634df05a,", "externalTransactionIdentifier": "430f4c76-4eb8-40e0-bc80-562b2960a83f,", "externalCustomIdentifier": "c9a625d4-d968-47a0-b237-e5d4f31dfcd4", "transactionId": "c9a625d4-d968-47a0-b237-e5d4f31dfcd4", "amount": "300.10", "multicaixaExpress": { "deeplink": "mcxwallet://purchase?qrref=000201010212260700032205203742530497325406300.105802AO5908ProxyPay6006Luanda61081000-10062430532fe4eeddd078343c391d6d10721233a3207034446304F577", "deeplinkRedirect": "https://api.sandbox.proxypay.co.ao/deeplink/LTvDt6U2WiFU0Ds_TScsbSbULbbCIbB2zrZsAS3r96hqDKVFMDAwMjAxMDEwMjEyMjYwNzAwMDMyMjA1MjAzNzQyNTMwNDk3MzI1NDA2MzAwLjEwNTgwMkFPNTkwOFByb3h5UGF5NjAwNkx1YW5kYTYxMDgxMDAwLTEwMDYyNDMwNTMyZmU0ZWVkZGQwNzgzNDNjMzkxZDZkMTA3MjEyMzNhMzIwNzAzNDQ0NjMwNEY1Nzc=", "qrCodeUrl": "https://api.sandbox.proxypay.co.ao/qrcode/LTvDt6U2WiFU0Ds_TScsbSbULbbCIbB2zrZsAS3r96hqDKVFMDAwMjAxMDEwMjEyMjYwNzAwMDMyMjA1MjAzNzQyNTMwNDk3MzI1NDA2MzAwLjEwNTgwMkFPNTkwOFByb3h5UGF5NjAwNkx1YW5kYTYxMDgxMDAwLTEwMDYyNDMwNTMyZmU0ZWVkZGQwNzgzNDNjMzkxZDZkMTA3MjEyMzNhMzIwNzAzNDQ0NjMwNEY1Nzc=", "expiresAt": "2026-05-19T18:00:37" } } } ``` -------------------------------- ### Install Paybyrd extension via Composer Source: https://docs.paybyrd.com/integrations/ecommerce-plugins/adobe-commerce-magento Use this Composer command to install the Paybyrd payment gateway extension. Requires the extension name and version as shown. Ensure your Magento environment meets the prerequisites before running. ```bash composer require paybyrd/paymentgateway:1.1.1 ``` -------------------------------- ### 200 response example for query transactions by acquirerCustomId Source: https://docs.paybyrd.com/api-reference/transactions/query-by-acquirer-custom-identifier Example JSON response returned when the transaction is found. Contains transaction details such as currency, amount, status, and card information. ```json [ { "currency": "EUR", "acquirer": "SIMULATED", "brand": "MASTER", "paymentMethod": "Card", "operationType": "Payment", "status": "Success", "fingerPrint": "f7f76173-f357-4863-bbc3-f5b6204a2769", "createdDate": "2025-05-12T18:04:38Z", "transactionDate": "2025-05-12T18:04:38Z", "capturedDate": "2025-05-12T18:04:41Z", "maskedCardNumber": "555534******1115", "authorizationCode": "327161", "initiatedFrom": "Server", "subscriptionGuid": "b9852997-0e6a-4542-a9fd-e9ae76967653", "personId": 10, "expiresAt": "2025-05-12T18:19:39Z", "attempt": 0, "index": 0, "externalSessionIdentifier": "b7fc1639-6dda-4c20-b618-097ef1e4e842", "externalTransactionIdentifier": "b15dc08a-277e-4c24-95e4-0ceb10540efd", "externalCustomIdentifier": "bc0a8270d48b4a3d9f1bf0a4eab365dc", "acquirerResponseCode": "00", "acquirerResponseMessage": "Success", "card": { "holder": "Jane Jones", "number": "555534******1115", "expiresAt": "12/25", "installments": 1, "installmentAmount": 2634, "isPayerTraveling": false, "countryCode": "QAT" }, "airportCode": "LIS", "applicationId": "sellgate", "marketId": "PT", "acceptTokenization": true, "cardInfoComposition": { "cardServiceType": "Credit", "sourceEnvironment": "Online", "cardCommercialType": "Corporate", "cardIssueLocation": "NonEea" }, "transactionId": "bc0a8270-d48b-4a3d-9f1b-f0a4eab365dc", "amount": "26.34", "isoAmount": 2634 } ] ``` -------------------------------- ### GET /api/v2/tokens Source: https://docs.paybyrd.com/api-reference/tokenization/get-token-by-reference This snippet documents the GET /api/v2/tokens endpoint, including its authentication header, response structure, and example. ```APIDOC ## GET /api/v2/tokens ### Description Retrieves a token by its custom reference. ### Method GET ### Endpoint https://gateway.paybyrd.com/api/v2/tokens ### Parameters #### Header Parameters - **x-api-key** (string) - Required - API key for authentication. ### Request Example No request body is required. ### Response #### Success Response (200) - **data** (array) - List of token objects. - **tokenId** (string) - Unique identifier of the token. - **customReference** (string) - Custom reference associated with the token. - **alias** (string) - Alias for the token. - **brand** (string) - Card brand (e.g., MASTER). - **expiration** (string) - Card expiration date in MM/YY format. - **maskedCardNumber** (string) - Masked card number. - **success** (boolean) - Indicates if the request was successful. - **errorCode** (string) - Error code if any. - **pagination** (object) - Pagination details. - **pageNumber** (integer) - Current page number. - **pageSize** (integer) - Number of items per page. - **total** (integer) - Total number of items. - **totalAvailable** (integer) - Total available items. #### Response Example { "data": [ { "tokenId": "512f2ebd-0256-423d-9d6f-433606c15f41", "customReference": "Wallet123", "alias": "MyPersonalCard1", "brand": "MASTER", "expiration": "12/25", "maskedCardNumber": "514968******8886" } ], "success": true, "errorCode": "", "pagination": { "pageNumber": 1, "pageSize": 10, "total": 1, "totalAvailable": 0 } } ``` -------------------------------- ### Operation type example response Source: https://docs.paybyrd.com/api-reference/api-code-reference Example JSON response showing the operationType field, returned by Query Transaction (GET /api/v2/transactions/{transactionId}). ```json { "operationType": "Payment", "status": "Success", "brand": "VISA", "transactionId": "8cb922ee-01cd-453d-90b9-b377e4f1c3cb", "amount": "5.00" } ``` -------------------------------- ### cURL GET request to retrieve token by reference Source: https://docs.paybyrd.com/api-reference/tokenization/get-token-by-reference Sends a GET request to https://gateway.paybyrd.com/api/v2/tokens with the required x-api-key header. Replace with your actual API key. ```bash curl --request GET \ --url https://gateway.paybyrd.com/api/v2/tokens \ --header 'x-api-key: ' ``` -------------------------------- ### Brand example response Source: https://docs.paybyrd.com/api-reference/api-code-reference Example JSON response showing the brand field, returned by Create Payment (POST /api/v2/payment) and Query Transaction (GET /api/v2/transactions/{transactionId}). ```json { "brand": "VISA", "operationType": "Payment", "status": "Success", "transactionId": "8cb922ee-01cd-453d-90b9-b377e4f1c3cb", "amount": "5.00" } ``` -------------------------------- ### List Settlement Files with Net::HTTP (Ruby) Source: https://docs.paybyrd.com/api-reference/settlement-files/list-settlement-files Ruby example using Net::HTTP to call the List Settlement Files endpoint. Requires an x-api-key header with a valid API key. ```ruby require 'uri' require 'net/http' url = URI("https://financehub.paybyrd.com/api/v1/SettlementFiles") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["x-api-key"] = '' response = http.request(request) puts response.read_body ``` -------------------------------- ### Python GET request to retrieve token by reference Source: https://docs.paybyrd.com/api-reference/tokenization/get-token-by-reference Uses the requests library to send a GET request to the tokens endpoint with the x-api-key header. Prints the response text. ```python import requests url = "https://gateway.paybyrd.com/api/v2/tokens" headers = {"x-api-key": ""} response = requests.get(url, headers=headers) print(response.text) ``` -------------------------------- ### 200 response - Gets a webhook settings by its Id Source: https://docs.paybyrd.com/api-reference/webhooks/gets-a-webhook-settings-by-its-id Example 200 response for a successful GET request, containing the webhook's id, url, credentials, and events list. ```JSON { "id": "8668e1dc-3f0c-407d-9aff-f5dda1ee8eaf", "url": "https://your-url.com/webhook", "webhookUser": "b73e9449-e1dc-485a-b4c7-19c540e96cd1", "webhookPassword": "@bc123", "events": [] } ``` -------------------------------- ### Receipt Response Example Source: https://docs.paybyrd.com/api-reference/transactions/receipt Example response body for the receipt endpoint. Shows the structured receipt data including merchant details, payment details, and the formatted receipt lines. ```json { "merchantDetails": [ { "key": "MerchantDetailsPublicName", "label": "name", "value": "Your store name" }, { "key": "MerchantDetailsAddress", "label": "Address", "value": "Your store address" }, { "key": "MerchantDetailsZip", "label": "Zip", "value": "5544MH" }, { "key": "MerchantDetailsCity", "label": "City", "value": "Amsterdam" }, { "key": "MerchantDetailsCountry", "label": "Country", "value": "Netherlands" }, { "key": "MerchantDetailsContact", "label": "Contact", "value": "store_email@mail.com" }, { "key": "MerchantDetailsAdditionalInformation", "label": "Additional Information" } ], "receiptType": [ { "key": "ReceiptType", "label": "Receipt Type", "value": "Cardholder Receipt" } ], "transactionType": [ { "key": "TransactionType", "label": "Type", "value": "Payment" } ], "date": [ { "key": "Date", "label": "Date", "value": "5/6/2022" } ], "time": [ { "key": "Time", "label": "Time", "value": "12:27:12 PM" } ], "identifier": [ { "key": "Identifier", "label": "PWID", "value": "adc5e128b21f4366847f66c9e244b5f0" } ], "statusText": [ { "key": "StatusText", "label": "Information", "value": "Please retain receipt!" } ], "amountAndCurrency": [ { "key": "AmountAndCurrency", "label": "Amount", "value": "€16.00" } ], "subject": [ { "key": "Subject", "label": "Description", "value": "" } ], "clearingDetails": [ { "key": "ClearingDetailsTransactionIdentifier", "label": "Transaction", "value": "CI_aUJ" }, { "key": "ClearingDetailsAuthorizationCode", "label": "Authorization", "value": "AI_sed/II_5z" }, { "key": "ClearingDetailsMerchantId", "label": "Merchant ID", "value": "949824be-2be5-42b4-9220-cce565fb2ccc" }, { "key": "ClearingDetailsTerminalId", "label": "Terminal ID", "value": "BAD13041" } ], "paymentDetails": [ { "key": "PaymentDetailsEMVApplicationID", "label": "AID", "value": "A0000000031010" }, { "key": "PaymentDetailsSource", "label": "Entry Mode", "value": "Contactless" }, { "key": "PaymentDetailsSchemeOrLabel", "label": "Card", "value": "VISA CREDITO" }, { "key": "PaymentDetailsMaskedAccount", "label": "Account", "value": "**** **** **** 9660" } ], "signatureLineRequired": false, "tipIncluded": false, "lines": [ "Your store name", "SA", "Your store address", "12", "5544MH", "Amsterdam", "Netherlands", "storeemail@mail.com", "", "Cardholder Receipt Payment", "", "€10.00", "", "Card VISA CREDITO", "Account **** **** **** 9660", "AID A0000000031010", "Entry Mode Contactless", "", " Please retain receipt! ", "", "5/6/2022 12:27:12 PM", "", "Transaction CI_aUJ", "Authorization AI_sed/II_5z9", "Merchant ID", "949824be-2be5-42b4-9220-cce565", " fb2ccc", "Terminal ID BAD13041", "" ] } ``` -------------------------------- ### Create webhook with Go Source: https://docs.paybyrd.com/api-reference/webhooks/creates-a-new-webhook-setting Uses the net/http package to POST the webhook URL with the required headers and prints the response body. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gateway.paybyrd.com/api/v2/webhooks" payload := strings.NewReader("{\n \"url\": \"https://your-url.com/webhook\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("x-api-key", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Finish two-step card payment with Go net/http Source: https://docs.paybyrd.com/api-reference/payments/finish-two-step-card-payment Go example using net/http to POST card details to the finish two-step card payment endpoint. Requires an API key and transaction ID. Prints the response body. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gateway.paybyrd.com/api/v2/payment/{transactionId}/pay" payload := strings.NewReader("{\n \"card\": {\n \"number\": \"5386134136087954\",\n \"expiration\": \"03/29\",\n \"cvv\": \"965\",\n \"holder\": \"Peter Parker\",\n \"ThreeDsVersion\": \"V2\",\n \"Aav\": \"cbd05c44c572458ba7468df0f75c932a\",\n \"DsTransactionId\": \"a3ad6ed8-c4b0-4cb4-972e-46e86a041ad1\",\n \"Eci\": \"01\",\n \"VerificationMethod\": \"ThreeDSecure\"\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("x-api-key", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Order status example response Source: https://docs.paybyrd.com/api-reference/api-code-reference Example JSON response showing the order status field, returned by Create Order (POST /api/v2/orders) and Query Order (GET /api/v2/orders/{orderId}). ```json { "orderId": "e83aa1a1-152c-439e-af1e-fc4178520807", "status": "created", "code": "BYRD200", "description": "Operation successfully completed" } ``` -------------------------------- ### 200 response for get all webhook settings Source: https://docs.paybyrd.com/api-reference/webhooks/gets-all-webhook-settings Example JSON response returned by the GET /api/v2/webhooks endpoint. Contains an array of webhook objects with id, url, webhookUser, webhookPassword, and events fields. ```json [ { "id": "8668e1dc-3f0c-407d-9aff-f5dda1ee8eaf", "url": "https://your-url.com/webhook1", "webhookUser": "b73e9449-e1dc-485a-b4c7-19c540e96cd1", "webhookPassword": "@bc123", "events": [] }, { "id": "c1532b84-a819-4e7a-986e-63bfb4fb1ecf", "url": "https://your-url.com/webhook2", "webhookUser": "d75620b6-8f3e-48f3-bb7d-99ffd0dbf135", "webhookPassword": "@bc123", "events": [] } ] ``` -------------------------------- ### 200 Response for Get Token By Id Source: https://docs.paybyrd.com/api-reference/tokenization/get-token-by-id Example JSON response returned when the token is successfully retrieved. ```json { "tokenId": "512f2ebd-0256-423d-9d6f-433606c15f41", "customReference": "Wallet123", "alias": "MyPersonalCard1", "brand": "MASTER", "expiration": "12/25", "maskedCardNumber": "514968******8886" } ``` -------------------------------- ### Transaction status example response Source: https://docs.paybyrd.com/api-reference/api-code-reference Example JSON response showing the status field at the transaction level, returned by Create Payment (POST /api/v2/payment) and Query Transaction (GET /api/v2/transactions/{transactionId}). ```json { "code": "BYRD200", "status": "Success", "operationType": "Payment", "brand": "VISA", "transactionId": "8cb922ee-01cd-453d-90b9-b377e4f1c3cb", "amount": "5.00" } ``` -------------------------------- ### List Settlement Files with Unirest (Java) Source: https://docs.paybyrd.com/api-reference/settlement-files/list-settlement-files Java example using the Unirest HTTP library to call the List Settlement Files endpoint. Requires an x-api-key header with a valid API key. ```java HttpResponse response = Unirest.get("https://financehub.paybyrd.com/api/v1/SettlementFiles") .header("x-api-key", "") .asString(); ``` -------------------------------- ### Query Order with Go Source: https://docs.paybyrd.com/api-reference/orders/query-order Use this Go program to query an order using the net/http package. Replace {orderId} and with your actual values. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://gateway.paybyrd.com/api/v2/orders/{orderId}" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("x-api-key", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Create Token with Go Source: https://docs.paybyrd.com/api-reference/tokenization/create-token Uses the net/http package to send a POST request with a JSON payload. The response body is read and printed. Replace with your actual API key. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gateway.paybyrd.com/api/v2/tokens" payload := strings.NewReader("{\n \"Type\": \"Card\",\n \"CustomReference\": \"Wallet123\",\n \"Alias\": \"MyShoppingCard\",\n \"RedirectUrl\": \"http://client.co/3ds/validation?token=123456\",\n \"Card\": {\n \"number\": \"5149682323738886\",\n \"expiration\": \"03/29\",\n \"cvv\": \"929\",\n \"holder\": \"Peter Parker\",\n \"aav\": \"\",\n \"dsTransactionId\": \"\",\n \"eci\": \"\",\n \"xid\": \"\"\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("x-api-key", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Create Subscription - Success Response Source: https://docs.paybyrd.com/api-reference/subscription/create Example response body for a successful subscription creation. Contains the operation status, subscription ID, amount, currency, interval details, and a checkout URL for payment. ```json { "code": "BYRD200", "description": "Operation successfully completed", "operationStatus": "Success", "subscriptionId": "435483a2-78b5-49e3-8f37-cd1c18834e02", "isoAmount": 1000, "currency": "EUR", "orderRef": "AMZ1962", "productDescription": "Spider-Man HQ subscription", "intervalType": "monthly", "interval": 1, "startDate": "1962-08-15", "endDate": "2082-08-15", "timeZone": "Europe/Berlin", "checkoutUrl": "https://link.paybyrd.com/sub_Kr6ZKx8uD" } ``` -------------------------------- ### Query transaction with PHP cURL Source: https://docs.paybyrd.com/api-reference/transactions/query PHP example using cURL to GET a transaction. Handles errors and prints the response. ```php "https://gateway.paybyrd.com/api/v2/transactions/{transactionId}", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "x-api-key: " ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } ``` -------------------------------- ### Query transaction with JavaScript fetch Source: https://docs.paybyrd.com/api-reference/transactions/query JavaScript example using fetch to GET a transaction. Logs the JSON response or error. ```javascript const options = {method: 'GET', headers: {'x-api-key': ''}}; fetch('https://gateway.paybyrd.com/api/v2/transactions/{transactionId}', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); ``` -------------------------------- ### Create Subscription with Go net/http Source: https://docs.paybyrd.com/api-reference/subscription/create Creates a subscription using the PayByrd API v2 with Go's net/http. Replace with your actual API key. The response body is printed. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gateway.paybyrd.com/api/v2/subscriptions" payload := strings.NewReader("{\n \"personId\": 10,\n \"isoAmount\": 1000,\n \"currency\": \"EUR\",\n \"orderRef\": \"AMZ1962\",\n \"productDescription\": \"Spider-Man HQ subscription\",\n \"intervalType\": \"monthly\",\n \"interval\": 1,\n \"startDate\": \"1962-08-15\",\n \"endDate\": \"2082-08-15\",\n \"timeZone\": \"Europe/Berlin\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("x-api-key", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### 200 response for GET token by reference Source: https://docs.paybyrd.com/api-reference/tokenization/get-token-by-reference Example successful response with status 200. Contains token data including tokenId, customReference, alias, brand, expiration, and maskedCardNumber, along with pagination details. ```json { "data": [ { "tokenId": "512f2ebd-0256-423d-9d6f-433606c15f41", "customReference": "Wallet123", "alias": "MyPersonalCard1", "brand": "MASTER", "expiration": "12/25", "maskedCardNumber": "514968******8886" } ], "success": true, "errorCode": "", "pagination": { "pageNumber": 1, "pageSize": 10, "total": 1, "totalAvailable": 0 } } ```