### Payment Methods and Wallets Response Example Source: https://github.com/saferpay/jsonapi/blob/master/texts/ChapterManagementApi.md Example JSON response showing available payment methods and wallets for a terminal. ```json { "PaymentMethods": [ { "PaymentMethod": "VISA", "Currencies": [ "USD" ], "LogoUrl": "https://www.saferpay.com/static/logo/visa.svg?v=637381079349290910" }, { "PaymentMethod": "MASTERCARD", "Currencies": [ "EUR", "CHF" ], "LogoUrl": "https://www.saferpay.com/static/logo/mastercard.svg?v=637381079349290910" }, { "PaymentMethod": "MAESTRO", "Currencies": [ "EUR" ], "LogoUrl": "https://www.saferpay.com/static/logo/maestro.svg?v=637381079349290910" }, { "PaymentMethod": "PAYPAL", "Currencies": [ "EUR", "CHF", "USD" ], "LogoUrl": "https://www.saferpay.com/static/logo/paypal.svg?v=637381079349290910" } ], "Wallets": [ { "WalletName": "APPLEPAY", "LogoUrl": "https://www.saferpay.com/static/logo/applepay.svg?v=637381079349290910" }, { "WalletName": "GOOGLEPAY", "LogoUrl": "https://www.saferpay.com/static/logo/googlepay.svg?v=637381079349290910" } ] } ``` -------------------------------- ### PaymentPage Configurations Example Source: https://github.com/saferpay/jsonapi/blob/master/texts/ChapterManagementApi.md This JSON object shows an example of payment page configurations. It includes an array of configurations, each with a name, default status, and description. ```json { "Configurations": [ { "name":"default", "isDefault": true", "Description": "Default Configuration" }, { "name":"special", "isDefault": false", "Description": "Special Payment Page Configuration" }, { "name":"event", "isDefault": false", "Description": "Special Payment Page Configuration for Events" } ] } ``` -------------------------------- ### Terminals GetTerminals Response Example Source: https://github.com/saferpay/jsonapi/blob/master/texts/ChapterManagementApi.md Example JSON response for retrieving a list of terminals associated with a customer. ```json { "Terminals": [ { "TerminalId": "1000001", "Type": "ECOM", "Description": "Terminal 1 for Payment Page / Ecommerce" }, { "TerminalId": "1000002", "Type": "MPO", "Description": "Terminal 2 for Mail Phone Order" }, { "TerminalId": "1000002", "Type": "SPG", "Description": "Terminal 3 for Secure Pay Gate" } ] } ``` -------------------------------- ### OmniChannel AcquireTransaction Request Example Source: https://github.com/saferpay/jsonapi/blob/master/texts/ChapterOmniChannel.md This is an example of a request body for the OmniChannel AcquireTransaction API. Ensure that 'SpecVersion', 'CustomerId', and 'RequestId' in 'RequestHeader' are replaced with your actual values. ```json { "RequestHeader": { "SpecVersion": "[current Spec-Version]", "CustomerId": "[your customer id]", "RequestId": "[your request id]", "RetryIndicator": 0 }, "TerminalId": "17791723", "SixTransactionReference": "1:100002:1:87768996410", "OrderId": "Id of the order" } ``` -------------------------------- ### PHP cURL Example for Basic Authentication Source: https://context7.com/saferpay/jsonapi/llms.txt A PHP cURL implementation for making requests to the Saferpay API using HTTP Basic Authentication. Handles request setup, execution, and error checking. ```php // PHP cURL example with Basic Auth function saferpay_request($username, $password, $url, $payload) { $curl = curl_init($url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HTTPHEADER, [ "Content-type: application/json", "Accept: application/json; charset=utf-8" ]); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($payload)); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($curl, CURLOPT_USERPWD, $username . ":" . $password); $json_response = curl_exec($curl); $status = curl_getinfo($curl, CURLINFO_HTTP_CODE); curl_close($curl); if ($status != 200) { throw new Exception("Saferpay error $status: " . $json_response); } return json_decode($json_response, true); } ``` -------------------------------- ### Payment Request Example Source: https://github.com/saferpay/jsonapi/blob/master/texts/ChapterTransaction.md This JSON object demonstrates the structure for a payment request, including header, terminal ID, payment details, and the payment method. ```json { "RequestHeader": { "SpecVersion": "[current Spec-Version]", "CustomerId": "[your customer id]", "RequestId": "[your request id]", "RetryIndicator": 0 }, "TerminalId": "[your terminal id]", "Payment": { "Amount": { "Value": "100", "CurrencyCode": "CHF" } }, "PaymentMethod": "BANCONTACT" } ``` -------------------------------- ### Markdown Table of Contents Example Source: https://github.com/saferpay/jsonapi/blob/master/texts/99_mdss.md Demonstrates the structure of a Markdown Table of Contents using anchors for internal linking. ```markdown # Markdown CheatSheet This is intended as a quick reference and showcase. For more complete info, see [John Gruber's original spec](http://daringfireball.net/markdown/). ## Table of Contents 1. [Headers](#headers) 1. [Emphasis](#emphasis) 1. [Lists](#lists) 1. [Links](#links) 1. [Images](#images) 1. [Code and Syntax Highlighting](#code) 1. [Tables](#tables) 1. [Blockquotes](#blockquotes) 1. [Inline HTML](#html) 1. [Horizontal Rule](#hr) 1. [Line Breaks](#lines) 1. [Youtube videos](#videos) --->>> ``` ## Table of Contents 1. [Table of Contents](#TOC) 1. [Headers](#headers) ... ``` <<<--- ``` -------------------------------- ### SecurePayGate Offer Response Example Source: https://github.com/saferpay/jsonapi/blob/master/texts/ChapterManagementApi.md This JSON object represents a typical response for a SecurePayGate offer, containing the OfferId and the PaymentLink. ```json { "OfferId": "503a3d7b-072b-400f-9e7e-8ec15191c737", "PaymentLink": "https://www.saferpay.com/SecurePayGate/Payment/123456/12345678/503a3d7b-072b-400f-9e7e-8ec15191c737" } ``` -------------------------------- ### Transaction Response Example Source: https://github.com/saferpay/jsonapi/blob/master/texts/ChapterTransaction.md This JSON object demonstrates the structure of a successful transaction response, including token, expiration, and redirect URL. ```json { "ResponseHeader": { "SpecVersion": "[current Spec-Version]", "RequestId": "[your request id]" }, "Token": "234uhfh78234hlasdfh8234e", "Expiration": "2015-01-30T12:45:22.258+01:00", "RedirectUrl": "https://www.saferpay.com/vt2/Api/..." } ``` -------------------------------- ### Transaction Refund Request Example Source: https://github.com/saferpay/jsonapi/blob/master/texts/ChapterTransaction.md Use this structure to initiate a refund for a previous transaction. Ensure all mandatory fields like RequestHeader and Refund details are provided. ```json { "RequestHeader": { "SpecVersion": "[current Spec-Version]", "CustomerId": "[your customer id]", "RequestId": "[your request id]", "RetryIndicator": 0 }, "Refund": { "Amount": { "Value": "100", "CurrencyCode": "CHF" } }, "CaptureReference": { "CaptureId": "723n4MAjMdhjSAhAKEUdA8jtl9jb_c" } } ``` -------------------------------- ### Transaction Response Example Source: https://github.com/saferpay/jsonapi/blob/master/texts/ChapterTransaction.md This JSON snippet illustrates a typical transaction response, including payer details and liability information. ```json { "CountryCode": "CH" } }, "Payer": { "IpAddress": "1.2.3.4", "IpLocation": "DE" }, "Liability": { "LiabilityShift": true, "LiableEntity": "THREEDS", "ThreeDs": { "Authenticated": true, "Xid": "ARkvCgk5Y1t/BDFFXkUPGX9DUgs=", "Version": 2, "AuthenticationType": "STRONG_CUSTOMER_AUTHENTICATION" } } } ``` -------------------------------- ### Capture Response Example Source: https://github.com/saferpay/jsonapi/blob/master/texts/ChapterTransaction.md This JSON object represents a successful capture response, including CaptureId, Status, and Date. ```json { "ResponseHeader": { "SpecVersion": "[current Spec-Version]", "RequestId": "[unique request identifier]" }, "CaptureId": "723n4MAjMdhjSAhAKEUdA8jtl9jb_c", "Status": "CAPTURED", "Date": "2018-08-08T13:45:22.258+02:00" } ``` -------------------------------- ### Transaction AssertCapture Request Example Source: https://github.com/saferpay/jsonapi/blob/master/texts/ChapterTransaction.md This JSON object demonstrates the structure for a Transaction AssertCapture API request, including RequestHeader and CaptureReference. ```json { "RequestHeader": { "SpecVersion": "[current Spec-Version]", "CustomerId": "[your customer id]", "RequestId": "[unique request id]", "RetryIndicator": 0 }, "CaptureReference": { "CaptureId": "24218eabae254caea6f898e413fe_c" } } ``` -------------------------------- ### Batch Close Response Example Source: https://github.com/saferpay/jsonapi/blob/master/texts/ChapterBatch.md This is a sample successful response for a batch close request. It confirms the operation with a 'ResponseHeader' containing the specification version and the request ID. ```json { "ResponseHeader": { "SpecVersion": "[current Spec-Version]", "RequestId": "[your request id]" } } ``` -------------------------------- ### C# Code Block Source: https://github.com/saferpay/jsonapi/blob/master/texts/99_mdss.md Example of a C# code block with syntax highlighting. Ensure the correct language identifier (cs) is used. ```cs var s = "C# syntax highlighting"; Console.WriteLine(s); ``` -------------------------------- ### Authorize Referenced Transaction Source: https://context7.com/saferpay/jsonapi/llms.txt Use this to perform a follow-up authorization for recurring or installment payments, referencing a prior initial transaction without a new 3DS challenge. ```bash curl -X POST https://test.saferpay.com/api/Payment/v1/Transaction/AuthorizeReferenced \ -u "API_LOGIN:API_PASSWORD" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{ "RequestHeader": { "SpecVersion": "1.52", "CustomerId": "123456", "RequestId": "ref-auth-002", "RetryIndicator": 0 }, "TerminalId": "17654321", "Payment": { "Amount": { "Value": "990", "CurrencyCode": "EUR" }, "Description": "Recurring charge April", "PayerNote": "Sub-April-2024" }, "TransactionReference": { "TransactionId": "723n4MAjMdhjSAhAKEUdA8jtl9jb" } }' ``` -------------------------------- ### Initiate Alternative Payment Source: https://context7.com/saferpay/jsonapi/llms.txt Initializes an alternative payment method (e.g., Bancontact, BLIK) that requires additional steps such as QR code scanning before authorization. Requires a NotifyUrl for asynchronous updates. ```bash curl -X POST https://test.saferpay.com/api/Payment/v1/Transaction/AlternativePayment \ -u "API_LOGIN:API_PASSWORD" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{ "RequestHeader": { "SpecVersion": "1.52", "CustomerId": "123456", "RequestId": "altpay-001", "RetryIndicator": 0 }, "TerminalId": "17654321", "Payment": { "Amount": { "Value": "1000", "CurrencyCode": "EUR" } }, "PaymentMethod": "BANCONTACT", "Notification": { "NotifyUrl": "https://myshop.example.com/payment/notify" } }' ``` -------------------------------- ### Get Terminal API Endpoint Source: https://github.com/saferpay/jsonapi/blob/master/texts/ChapterManagementApi.md This GET request is used to retrieve details of a specific terminal. The URL requires the customer ID and terminal ID. ```http GET /rest/customers/[customerId]/terminals/[terminalId] ``` -------------------------------- ### Create Chapter Source: https://github.com/saferpay/jsonapi/blob/master/texts/ChapterManagementApi.md Creates a new chapter with the provided details. ```APIDOC ## POST /chapters ### Description Creates a new chapter. ### Method POST ### Endpoint /chapters ### Request Body - **title** (string) - Required - The title of the chapter. - **content** (string) - Required - The content of the chapter. - **order** (integer) - Optional - The order of the chapter. ### Request Example { "title": "Introduction", "content": "This is the introduction.", "order": 1 } ### Response #### Success Response (201) - **id** (string) - The unique identifier of the created chapter. - **title** (string) - The title of the chapter. - **content** (string) - The content of the chapter. - **order** (integer) - The order of the chapter. #### Response Example { "id": "chapter-123", "title": "Introduction", "content": "This is the introduction.", "order": 1 } ``` -------------------------------- ### SecurePayGate Offer Response Example Source: https://github.com/saferpay/jsonapi/blob/master/texts/ChapterManagementApi.md This JSON object represents a typical response for a SecurePayGate offer, including details like offer ID, payment link, status, payment information, and dates. ```json { "OfferId": "503a3d7b-072b-400f-9e7e-8ec15191c737", "PaymentLink": "https://www.saferpay.com/SecurePayGate/Payment/123456/12345678/503a3d7b-072b-400f-9e7e-8ec15191c737", "Status": "OPEN", "Payment": { "Amount": { "Value": "100", "CurrencyCode": "CHF" }, "OrderId": "cd0005bf21bb4906bcbea939d74cee72", "Description": "Hallo" }, "CreationDate": "2023-03-01T11:37:47.682+01:00", "ExpirationDate": "2023-04-01T00:00:00+02:00" } ``` -------------------------------- ### SecurePayGate Single Use Payment Link GET Request Source: https://github.com/saferpay/jsonapi/blob/master/texts/ChapterManagementApi.md This GET request is used to fetch the status of a previously created single-use payment link. No request body is needed. ```http GET /rest/customers/[customerId]/terminals/[terminalId]/spg-offers/[offerId] HTTP/1.1 ``` -------------------------------- ### Payment Request Example Source: https://github.com/saferpay/jsonapi/blob/master/texts/ChapterTransaction.md This JSON object demonstrates a typical payment request structure. Ensure all placeholder values like '[current Spec-Version]', '[your customer id]', '[unique request id]', and '[your terminal id]' are replaced with actual data. ```json { "RequestHeader": { "SpecVersion": "[current Spec-Version]", "CustomerId": "[your customer id]", "RequestId": "[unique request id]", "RetryIndicator": 0 }, "TerminalId": "[your terminal id]", "Payment": { "Amount": { "Value": "100", "CurrencyCode": "CHF" }, "Description": "Test123", "PayerNote": "Order123_Testshop" }, "PaymentMeans": { "Card": { "Number": "912345678901234", "ExpYear": 2015, "ExpMonth": 9, "HolderName": "Max Mustermann", "VerificationCode": "123" } } } ``` -------------------------------- ### Example Error Response Source: https://github.com/saferpay/jsonapi/blob/master/texts/ErrorResponse.md This is an example of an error response that might be returned by the API. It includes details about the error, such as the error name, a human-readable message, specific error details, and relevant transaction/order IDs. ```json { "ResponseHeader": { "SpecVersion": "[current Spec-Version]", "RequestId": "[your request id]" }, "Behavior": "DO_NOT_RETRY", "ErrorName": "VALIDATION_FAILED", "ErrorMessage": "Request validation failed", "ErrorDetail": [ "PaymentMeans.BankAccount.IBAN: The field IBAN is invalid." ], "TransactionId": "723n4MAjMdhjSAhAKEUdA8jtl9jb", "OrderId": "c52ad18472354511ab2c33b59e796901" } ``` -------------------------------- ### Markdown Image Syntax Source: https://github.com/saferpay/jsonapi/blob/master/texts/99_mdss.md Demonstrates both inline-style and reference-style image syntax in Markdown. Ensure the image path is correct. ```markdown Here's our logo (hover to see the title text): Inline-style:  Reference-style: ![alt text][logo] [logo]: https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png "Logo Title Text 2" ``` -------------------------------- ### AlternativePayment Source: https://context7.com/saferpay/jsonapi/llms.txt Initializes an alternative payment method (e.g., Bancontact, BLIK) that requires additional steps such as QR code scanning before authorization. ```APIDOC ## POST /Payment/v1/Transaction/AlternativePayment ### Description Initializes an alternative payment method (e.g., Bancontact, BLIK) that requires additional steps such as QR code scanning before authorization. ### Method POST ### Endpoint /Payment/v1/Transaction/AlternativePayment ### Request Body - **RequestHeader** (object) - Required - Header information for the request. - **SpecVersion** (string) - Required - The version of the Saferpay API specification. - **CustomerId** (string) - Required - The customer ID. - **RequestId** (string) - Required - A unique identifier for the request. - **RetryIndicator** (integer) - Optional - Indicates if this request is a retry. - **TerminalId** (string) - Required - The ID of the terminal. - **Payment** (object) - Required - Details of the payment. - **Amount** (object) - Required - The payment amount. - **Value** (string) - Required - The amount value. - **CurrencyCode** (string) - Required - The ISO 4217 currency code. - **PaymentMethod** (string) - Required - The alternative payment method to use (e.g., "BANCONTACT"). - **Notification** (object) - Optional - Notification settings. - **NotifyUrl** (string) - Required - The URL to send payment notifications to. ### Request Example ```json { "RequestHeader": { "SpecVersion": "1.52", "CustomerId": "123456", "RequestId": "altpay-001", "RetryIndicator": 0 }, "TerminalId": "17654321", "Payment": { "Amount": { "Value": "1000", "CurrencyCode": "EUR" } }, "PaymentMethod": "BANCONTACT", "Notification": { "NotifyUrl": "https://myshop.example.com/payment/notify" } } ``` ### Response #### Success Response (200) - **Token** (string) - A token representing the alternative payment session. - **Expiration** (string) - The expiration date and time of the token. - **ProcessingData** (object) - Data required for processing the alternative payment. - **Bancontact** (object) - Specific data for Bancontact payments. - **QrCodeData** (string) - Data to generate a QR code. - **IntentUrl** (string) - A URL to initiate the payment process. #### Response Example ```json { "Token": "234uhfh78234hlasdfh8234e", "Expiration": "2024-01-01T20:00:00.000Z", "ProcessingData": { "Bancontact": { "QrCodeData": "someQRcodeData", "IntentUrl": "https://www.saferpay.com/vt2/Api/..." } } } ``` **Note**: Display QR code to payer; poll QueryAlternativePayment for status. ``` -------------------------------- ### Get Chapter by ID Source: https://github.com/saferpay/jsonapi/blob/master/texts/ChapterManagementApi.md Retrieves a specific chapter by its unique identifier. ```APIDOC ## GET /chapters/{id} ### Description Retrieves a specific chapter by its ID. ### Method GET ### Endpoint /chapters/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the chapter. ### Response #### Success Response (200) - **id** (string) - The unique identifier of the chapter. - **title** (string) - The title of the chapter. - **content** (string) - The content of the chapter. - **order** (integer) - The order of the chapter. #### Response Example { "id": "chapter-123", "title": "Introduction", "content": "This is the introduction.", "order": 1 } ``` -------------------------------- ### Alias Inquire Source: https://github.com/saferpay/jsonapi/blob/master/texts/ChapterAliasStore.md This method can be used to get the latest details of an alias. ```APIDOC ## POST /Payment/v1/Alias/Inquire ### Description This method can be used to get the latest details of an alias. ### Method POST ### Endpoint /Payment/v1/Alias/Inquire ### Parameters #### Request Body - **AliasId** (string) - mandatory - The alias for which you want to receive details. - **RequestHeader** (object) - mandatory - General information about the request. ### Request Example { "RequestHeader": { "SpecVersion": "[current Spec-Version]", "CustomerId": "[your customer id]", "RequestId": "[unique request identifier]", "RetryIndicator": 0 }, "AliasId": "alias35nfd9mkzfw0x57iwx" } ### Response #### Success Response (200) - **ResponseHeader** (object) - Contains general information about the response. #### Response Example { "ResponseHeader": { "SpecVersion": "[current Spec-Version]", "RequestId": "[your request id]" } } ``` -------------------------------- ### Get Terminal Details Source: https://github.com/saferpay/jsonapi/blob/master/texts/ChapterManagementApi.md This method is used to retrieve details of one terminal. ```APIDOC ## GET /rest/customers/[customerId]/terminals/[terminalId] ### Description This method is used to retrieve details of one terminal. ### Method GET ### Endpoint /rest/customers/[customerId]/terminals/[terminalId] ### Request Body No body needed ### Response #### Success Response (200) - **field1** (type) - Description #### Response Example { "example": "No example available" } ``` -------------------------------- ### Transaction Request Example Source: https://github.com/saferpay/jsonapi/blob/master/texts/ChapterTransaction.md This JSON object demonstrates a typical transaction request, including essential RequestHeader and TransactionReference details. Ensure that the SpecVersion, CustomerId, and RequestId are correctly populated. ```json { "RequestHeader": { "SpecVersion": "[current Spec-Version]", "CustomerId": "[your customer id]", "RequestId": "[unique request id]", "RetryIndicator": 0 }, "TransactionReference": { "TransactionId": "723n4MAjMdhjSAhAKEUdA8jtl9jb" } } ``` -------------------------------- ### Terminal Information Response Example Source: https://github.com/saferpay/jsonapi/blob/master/texts/ChapterManagementApi.md This JSON object represents a successful response containing details about a specific terminal, including its ID, type, description, and available payment methods and wallets. ```json { "TerminalId": "1000001", "Type": "ECOM", "Description": "Terminal 1 for Payment Page / Ecommerce", "PaymentMethods": [ { "PaymentMethod": "VISA", "Currencies": [ "USD" ], "LogoUrl": "https://www.saferpay.com/static/logo/visa.svg?v=637381079349290910" }, { "PaymentMethod": "MASTERCARD", "Currencies": [ "EUR", "CHF" ], "LogoUrl": "https://www.saferpay.com/static/logo/mastercard.svg?v=637381079349290910" }, { "PaymentMethod": "MAESTRO", "Currencies": [ "EUR" ], "LogoUrl": "https://www.saferpay.com/static/logo/maestro.svg?v=637381079349290910" }, { "PaymentMethod": "PAYPAL", "Currencies": [ "EUR", "CHF", "USD" ], "LogoUrl": "https://www.saferpay.com/static/logo/paypal.svg?v=637381079349290910" } ], "Wallets": [ { "WalletName": "APPLEPAY", "LogoUrl": "https://www.saferpay.com/static/logo/applepay.svg?v=637381079349290910" }, { "WalletName": "GOOGLEPAY", "LogoUrl": "https://www.saferpay.com/static/logo/googlepay.svg?v=637381079349290910" } ] } ``` -------------------------------- ### Transaction Authorize Source: https://github.com/saferpay/jsonapi/blob/master/texts/ChapterTransaction.md This function may be called to authorize a transaction which was started by a call to Transaction/Initialize. ```APIDOC ## POST /Payment/v1/Transaction/Authorize ### Description This function may be called to authorize a transaction which was started by a call to Transaction/Initialize. ### Method POST ### Endpoint /Payment/v1/Transaction/Authorize ### Response #### Success Response (200) - **ResponseHeader** (object) - Mandatory - Contains general information about the response. - **Token** (string) - Mandatory - Id for referencing later. Example: `234uhfh78234hlasdfh8234e` - **Expiration** (date) - Mandatory - Expiration date / time of the generated token in ISO 8601 format in UTC. After this time is exceeded, the token will not be accepted for any further actions except Asserts. Example: `2015-01-30T13:45:22.258+02:00` - **LiabilityShift** (boolean) - Indicates if liability shift to issuer is possible or not. Not present if PaymentMeans container was not present in InitializeTransaction request. True, if liability shift to issuer is possible, false if not. - **RedirectRequired** (boolean) - Mandatory - True if a redirect must be performed to continue, false otherwise - **Redirect** (object) - Mandatory if RedirectRequired is true. Contains the URL for the redirect to use for example the Saferpay hosted register form. #### Response Example { "ResponseHeader": { "SpecVersion": "[current Spec-Version]", "RequestId": "[your request id]" }, "Token": "234uhfh78234hlasdfh8234e", "Expiration": "2015-01-30T12:45:22.258+01:00", "LiabilityShift": true, "RedirectRequired": true, "Redirect": { "RedirectUrl": "https://www.saferpay.com/vt2/Api/...", "PaymentMeansRequired": true } } ``` -------------------------------- ### Transaction QueryAlternativePayment Source: https://github.com/saferpay/jsonapi/blob/master/texts/ChapterTransaction.md Call this method to get information about a previously initialized alternative payment transaction. ```APIDOC ## POST /Payment/v1/Transaction/QueryAlternativePayment ### Description Call this method to get information about a previously initialized alternative payment transaction. ### Method POST ### Endpoint /Payment/v1/Transaction/QueryAlternativePayment ### Parameters #### Request Body - **RequestHeader** (object) - Required - General information about the request. - **Token** (string) - Required - Token returned by initial call. Example: 234uhfh78234hlasdfh8234e ### Request Example { "RequestHeader": { "SpecVersion": "[current Spec-Version]", "CustomerId": "[your customer id]", "RequestId": "[unique request identifier]", "RetryIndicator": 0 }, "Token": "234uhfh78234hlasdfh8234e" } ### Response #### Success Response (200) - **ResponseHeader** (object) - Contains general information about the response. - **Token** (string) - Id for referencing later. Example: 234uhfh78234hlasdfh8234e - **Expiration** (date) - Expiration date / time of the generated token in ISO 8601 format in UTC. After this time, the token won’t be accepted for any further action. Example: 2015-01-30T13:45:22.258+02:00 - **ProcessingData** (object) - data required by the merchant system to process the payment (e.g. QR-code data, intent URL, ...) #### Response Example { "ResponseHeader": { "SpecVersion": "[current Spec-Version]", "RequestId": "[your request id]" }, "Token": "234uhfh78234hlasdfh8234e", "Expiration": "2015-01-30T12:45:22.258+01:00", "ProcessingData": { "Bancontact": { "QrCodeData": "someQRcodeData", "IntentUrl": "https://www.saferpay.com/vt2/Api/..." } } } ``` -------------------------------- ### Initialize Payment Page Session (cURL) Source: https://context7.com/saferpay/jsonapi/llms.txt Use this cURL command to initialize a Payment Page session. It requires a RequestHeader, TerminalId, Payment details, supported PaymentMethods, Payer information, and return/notification URLs. ```bash curl -X POST https://test.saferpay.com/api/Payment/v1/PaymentPage/Initialize \ -u "API_LOGIN:API_PASSWORD" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{ "RequestHeader": { "SpecVersion": "1.52", "CustomerId": "123456", "RequestId": "order-20240101-001", "RetryIndicator": 0 }, "TerminalId": "17654321", "Payment": { "Amount": { "Value": "2500", "CurrencyCode": "CHF" }, "OrderId": "order-20240101-001", "Description": "Order #001 – My Shop" }, "PaymentMethods": ["VISA", "MASTERCARD", "PAYPAL", "TWINT"], "Payer": { "IpAddress": "192.168.1.1", "LanguageCode": "en" }, "ReturnUrl": { "Url": "https://myshop.example.com/payment/return" }, "Notification": { "SuccessNotifyUrl": "https://myshop.example.com/payment/notify/success", "FailNotifyUrl": "https://myshop.example.com/payment/notify/fail" } }' ``` -------------------------------- ### OmniChannel InsertAlias Response Source: https://github.com/saferpay/jsonapi/blob/master/texts/ChapterOmniChannel.md This is an example of a successful response when creating an alias, including alias and payment means information. ```json { "ResponseHeader": { "SpecVersion": "[current Spec-Version]", "RequestId": "[your request id]" }, "Alias": { "Id": "alias35nfd9mkzfw0x57iwx", "Lifetime": 1000 }, "PaymentMeans": { "Brand": { "PaymentMethod": "VISA", "Name": "VISA Saferpay Test" }, "DisplayText": "9123 45xx xxxx 1234", "Card": { "MaskedNumber": "912345xxxxxx1234", "ExpYear": 2015, "ExpMonth": 9, "HolderName": "Max Mustermann", "CountryCode": "CH" } } } ``` -------------------------------- ### RequestAddress Fields Source: https://github.com/saferpay/jsonapi/blob/master/texts/ContainerDictionary.md This section details the fields available within the RequestAddress container, including their data types, descriptions, and examples. ```APIDOC ## Container "Common_Models_Data_RequestAddress" ### Fields - **City** (string) - The payer's city. Example: `Zurich` - **Company** (string) - The payer's company. Example: `ACME Corp.` - **CountryCode** (string) - The payer's country code (ISO 3166-1 alpha-2). Example: `CH` - **CountrySubdivisionCode** (string) - The payer's country subdivision code (ISO 3166 or ISO 3166-2). Example: `CH-ZH` - **DateOfBirth** (string) - The payer's date of birth in YYYY-MM-DD format. Example: `1990-05-31` - **Email** (string) - The payer's email address. Example: `payer@provider.com` - **FirstName** (string) - The payer's first name. Example: `John` - **Gender** (string) - The payer's gender (MALE, FEMALE, DIVERSE, COMPANY). Example: `COMPANY` - **LastName** (string) - The payer's last name. Example: `Doe` - **Phone** (string) - The payer's phone number. Example: `+41123456789` - **Street** (string) - The payer's street. Example: `Bakerstreet 32` - **Street2** (string) - The payer's street, second line. Example: `Stewart House` ``` -------------------------------- ### Transaction Response Example Source: https://github.com/saferpay/jsonapi/blob/master/texts/ChapterTransaction.md This JSON object represents a successful transaction response, including ResponseHeader, TransactionId, OrderId, and Date. ```json { "ResponseHeader": { "SpecVersion": "[current Spec-Version]", "RequestId": "[your request id]" }, "TransactionId": "723n4MAjMdhjSAhAKEUdA8jtl9jb", "OrderId": "c52ad18472354511ab2c33b59e796901", "Date": "2015-01-30T12:45:22.258+01:00" } ``` -------------------------------- ### Markdown List Syntax Source: https://github.com/saferpay/jsonapi/blob/master/texts/99_mdss.md Demonstrates ordered and unordered lists, including nested sub-lists and indented paragraphs within list items. Shows how to create line breaks within list items using two trailing spaces. ```markdown 1. First ordered list item 2. Another item * Unordered sub-list. 1. Actual numbers don't matter, just that it's a number 1. Ordered sub-list 4. And another item. You can have properly indented paragraphs within list items. Notice the blank line above, and the leading spaces (at least one, but we'll use three here to also align the raw Markdown). To have a line break without a paragraph, you will need to use two trailing spaces. Note that this line is separate, but within the same paragraph. (This is contrary to the typical GFM line break behaviour, where trailing spaces are not required.) * Unordered list can use asterisks - Or minuses + Or pluses ``` -------------------------------- ### HTML Table Source: https://github.com/saferpay/jsonapi/blob/master/texts/99_mdss.md Demonstrates how to create an HTML table within Markdown. Tables are not part of the core Markdown specification and require raw HTML. ```html
| Header | Another Header |
|---|---|
| field 1 | value one |