### React / React Native Example Source: https://docs.coinflow.cash/guides/checkout/payment-methods/payment-methods/wires/implement-wire-payments Example implementation of wire payments using React or React Native. ```APIDOC ## React / React Native Example ### Description Example implementation of wire payments using React or React Native. ### Method N/A ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Go SDK Example for Get Seller Registration Link Source: https://docs.coinflow.cash/api-reference/api-reference/marketplace/get-seller-register-link This Go code example shows how to make a POST request to the Coinflow Cash API to get a seller registration link. It utilizes the `net/http` package to create the request, set the necessary headers, and send the JSON payload. The example includes reading the response body. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api-sandbox.coinflow.cash/api/marketplace/link/seller/registration" payload := strings.NewReader("{\"email\": \"new.seller@example.com\",\n \"sellerId\": \"seller_987654321\"}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "") 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)) ``` -------------------------------- ### Checkout Link Example Source: https://docs.coinflow.cash/guides/checkout/payment-methods/payment-methods/wires/implement-wire-payments Example implementation using checkout links for wire payments. ```APIDOC ## Checkout Link Example ### Description Example implementation using checkout links for wire payments. ### Method N/A ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Get Customer Balances API Request Examples Source: https://docs.coinflow.cash/api-reference/api-reference/customers/get-checkout-balances Examples of how to fetch customer balances from the Coinflow Cash API. These snippets demonstrate making GET requests to the '/customer/balances/merchantIdOrCreditSeed' endpoint with the required authentication header. They cover common programming languages and tools. ```curl curl https://api-sandbox.coinflow.cash/api/customer/balances/merchantIdOrCreditSeed -H "x-coinflow-auth-session-key: " ``` ```python import requests url = "https://api-sandbox.coinflow.cash/api/customer/balances/merchantIdOrCreditSeed" headers = {"x-coinflow-auth-session-key": ""} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api-sandbox.coinflow.cash/api/customer/balances/merchantIdOrCreditSeed'; const options = {method: 'GET', headers: {'x-coinflow-auth-session-key': ''}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://api-sandbox.coinflow.cash/api/customer/balances/merchantIdOrCreditSeed" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("x-coinflow-auth-session-key", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api-sandbox.coinflow.cash/api/customer/balances/merchantIdOrCreditSeed") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["x-coinflow-auth-session-key"] = '' response = http.request(request) puts response.read_body ``` ```java HttpResponse response = Unirest.get("https://api-sandbox.coinflow.cash/api/customer/balances/merchantIdOrCreditSeed") .header("x-coinflow-auth-session-key", "") .asString(); ``` ```php request('GET', 'https://api-sandbox.coinflow.cash/api/customer/balances/merchantIdOrCreditSeed', [ 'headers' => [ 'x-coinflow-auth-session-key' => '', ], ]); echo $response->getBody(); ``` ```csharp var client = new RestClient("https://api-sandbox.coinflow.cash/api/customer/balances/merchantIdOrCreditSeed"); var request = new RestRequest(Method.GET); request.AddHeader("x-coinflow-auth-session-key", ""); IRestResponse response = client.Execute(request); ``` -------------------------------- ### Initial Purchase Flow with MIT Example Source: https://docs.coinflow.cash/guides/checkout/payment-scenarios/subsequent-transactions/merchant-initiated-transactions This example demonstrates an initial card purchase followed by an MIT charge. It shows the curl command for the initial purchase using a saved token and the subsequent MIT request. ```bash curl --request POST \ --url https://api-sandbox.coinflow.cash/api/checkout/card/your-merchant-id \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-user-id: customer-123' \ --data '{ "subtotal": { "cents": 2500, "currency": "USD" }, "token": "4111114324324111_bt" }' ``` -------------------------------- ### Implementation Guide: Initial Purchase Source: https://docs.coinflow.cash/guides/checkout/payment-scenarios/subsequent-transactions/card-on-file Guide for the initial purchase step, which involves storing the customer's payment credentials using either the Card Checkout or Token Checkout endpoint. ```APIDOC ## Implementation Guide Implementing Card on File checkout is a two-step process: 1. **Initial Purchase**: Store the customer’s payment credentials 2. **Subsequent Purchases**: Use the stored credentials for future transactions ### Step 1: Create Initial Card Payment For the customer’s first purchase, use either the Card Checkout or Token Checkout endpoint to process the payment and store their credentials. **Option A: Card Checkout** Use this endpoint when you have raw card details from the customer: ```APIDOC POST /api/checkout/card/{merchantId} ``` ``` -------------------------------- ### Install and Initialize nSure SDK (npm) Source: https://docs.coinflow.cash/guides/checkout/payment-security-risk-management/fraud-protection/implement-chargeback-protection This snippet demonstrates how to install the nSure SDK web client using npm or yarn, authenticate with a private registry, and initialize the SDK with your application and partner IDs. It also shows how to retrieve a device ID. ```bash // registry.npmjs.org/:_authToken=YOUR_NPM_TOKEN npm install @nsure-ai/web-client-sdk # or yarn add @nsure-ai/web-client-sdk ``` ```javascript import nSureSDK from '@nsure-ai/web-client-sdk'; const appId = '< your app id>'; const partnerId = '< partner id >'; const deviceId = nSureSDK.init({ appId, partnerId }); // you can also call getDeviceId after init: const deviceId = nSureSDK.getDeviceId(); ``` ```javascript const nSureSDK = require('@nsure-ai/web-client-sdk'); const appId = '< your app id>'; const partnerId = '< partner id >'; const deviceId = nSureSDK.init({ appId, partnerId }); // you can also call getDeviceId after init: const deviceId = nSureSDK.getDeviceId(); ``` -------------------------------- ### Initial Purchase Flow Example Source: https://docs.coinflow.cash/guides/checkout/payment-scenarios/subsequent-transactions/merchant-initiated-transactions Example demonstrating an initial card purchase followed by a Merchant Initiated Transaction (MIT) charge. ```APIDOC ## Initial Purchase Flow Example ### Description This example demonstrates an initial card purchase, which establishes a payment context, followed by a Merchant Initiated Transaction (MIT) charge. ### Option 2: Initial Purchase followed by MIT #### Step 1: Initial Purchase (Saved Token) Perform an initial purchase using a saved token. This establishes the `originalPaymentId` for future MIT charges. ##### Request Example (Initial Purchase) ```bash curl --request POST \ --url https://api-sandbox.coinflow.cash/api/checkout/card/your-merchant-id \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-user-id: customer-123' \ --data '{ "subtotal": { "cents": 2500, "currency": "USD" }, "token": "4111114324324111_bt" }' ``` *Note: The response for the initial purchase is not detailed here but would typically include a `paymentId` that can be used for subsequent MIT charges.* ``` -------------------------------- ### Complete Example: Card on File API Request and Response Source: https://docs.coinflow.cash/guides/checkout/payment-scenarios/subsequent-transactions/card-on-file Demonstrates a complete example of a Card on File API request using cURL and its corresponding JSON response. This includes sample data for subtotal, original payment ID, and chargeback protection. ```bash curl --request POST \ --url https://api-sandbox.coinflow.cash/api/checkout/card-on-file \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'Authorization: your-merchnat-api-key' \ --header 'x-device-id: device-id-from-nsure-sdk' \ --data '{ "subtotal": { "cents": 5000, "currency": "USD" }, "originalPaymentId": "550e8400-e29b-41d4-a716-446655440000", "chargebackProtectionData": [ { "productName": "Game Credits", "productType": "inGameProduct", "quantity": 500, "rawProductData": { "productID": "credits-500", "productDescription": "500 in-game currency credits" } } ] }' ``` ```json { "paymentId": "650e8400-e29b-41d4-a716-446655440001" } ``` -------------------------------- ### GET /api-reference/api-reference/checkout/validate-merchant Source: https://docs.coinflow.cash/api-reference/api-reference/marketplace/get-wallet-address-by-email Validates the merchant's identity and configuration for Apple Pay. This GET request is typically used during the setup or integration phase to ensure compatibility. ```APIDOC ## GET /api-reference/api-reference/checkout/validate-merchant ### Description Validates the merchant's identity and configuration for Apple Pay. This GET request is typically used during the setup or integration phase to ensure compatibility. ### Method GET ### Endpoint /api-reference/api-reference/checkout/validate-merchant ### Parameters #### Path Parameters None #### Query Parameters - **merchant_id** (string) - Required - The unique identifier for the merchant. - **domain_name** (string) - Required - The domain name of the merchant's website. ### Request Example ``` GET /api-reference/api-reference/checkout/validate-merchant?merchant_id=merch_xyz789&domain_name=example.com ``` ### Response #### Success Response (200) - **is_valid** (boolean) - Indicates whether the merchant is valid for Apple Pay. - **message** (string) - A message providing details about the validation status. #### Response Example ```json { "is_valid": true, "message": "Merchant validation successful." } ``` ``` -------------------------------- ### Get Balances Endpoint - C# SDK Example Source: https://docs.coinflow.cash/api-reference/api-reference/customers/get-checkout-balances This C# code snippet demonstrates how to call the Coinflow Cash API's 'Get Balances' endpoint using RestSharp. It configures a GET request and adds the required authentication header. ```csharp var client = new RestClient("https://api-sandbox.coinflow.cash/api/customer/balances/merchantIdOrCreditSeed"); var request = new RestRequest(Method.GET); request.AddHeader("x-coinflow-auth-session-key", ""); IRestResponse response = client.Execute(request); ``` -------------------------------- ### Example: Zero Authorization Flow with cURL Source: https://docs.coinflow.cash/guides/checkout/payment-scenarios/subsequent-transactions/merchant-initiated-transactions This example demonstrates the initial Zero Authorization step using cURL. It sends a POST request to the zero-authorization endpoint with the necessary token. ```bash curl --request POST \ --url https://api-sandbox.coinflow.cash/api/checkout/zero-authorization/your-merchant-id \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-user-id: customer-123' \ --data '{ "token": "4111114324324111_bt" }' ``` -------------------------------- ### Example API Call with New Card (cURL) Source: https://docs.coinflow.cash/guides/checkout/payment-scenarios/subsequent-transactions/zero-authorization This example demonstrates how to make a Zero Authorization API request using cURL when using a new card. It includes setting the request method, URL, and necessary headers like 'accept' and 'content-type'. The request body would contain the card details. ```bash curl --request POST \ --url https://api-sandbox.coinflow.cash/api/checkout/zero-authorization/your-merchant-id \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-user-id: ``` -------------------------------- ### Get Balances Endpoint - Ruby SDK Example Source: https://docs.coinflow.cash/api-reference/api-reference/customers/get-checkout-balances This Ruby code snippet demonstrates how to access the Coinflow Cash API's 'Get Balances' endpoint. It uses the Net::HTTP library to send a GET request with the required authentication header. ```ruby require 'uri' require 'net/http' url = URI("https://api-sandbox.coinflow.cash/api/customer/balances/merchantIdOrCreditSeed") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["x-coinflow-auth-session-key"] = '' response = http.request(request) puts response.read_body ``` -------------------------------- ### Example MIT Configuration Settings Source: https://docs.coinflow.cash/guides/checkout/payment-scenarios/subsequent-transactions/merchant-initiated-transactions An example JSON object illustrating the configurable settings for Merchant Initiated Transactions (MITs), including velocity controls and payment limits. ```json { "enabled": true, "maxCount": 5, "period": 86400, "maxMultiple": 3, "expiration": 2592000, "maxZeroAuthAmount": { "cents": 2000 }, "maxAmountLookback": 2592000 } ``` -------------------------------- ### Get Balances Endpoint - JavaScript SDK Example Source: https://docs.coinflow.cash/api-reference/api-reference/customers/get-checkout-balances This JavaScript code snippet shows how to fetch the balances from the Coinflow Cash API using the Fetch API. It makes a GET request to the 'Get Balances' endpoint, including the required authentication header. ```javascript const url = 'https://api-sandbox.coinflow.cash/api/customer/balances/merchantIdOrCreditSeed'; const options = {method: 'GET', headers: {'x-coinflow-auth-session-key': ''}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` -------------------------------- ### Initial Purchase with Saved Token (Bash) Source: https://docs.coinflow.cash/guides/checkout/payment-scenarios/subsequent-transactions/merchant-initiated-transactions An example cURL command for an initial purchase using a saved token. This is part of the Initial Purchase Flow and requires merchant ID, subtotal, and the token. ```bash curl --request POST \\ --url https://api-sandbox.coinflow.cash/api/checkout/card/your-merchant-id \\ --header 'accept: application/json' \\ --header 'content-type: application/json' \\ --header 'x-user-id: customer-123' \\ --data '{ "subtotal": { "cents": 2500, "currency": "USD" }, "token": "4111114324324111_bt" }' ``` -------------------------------- ### Get Withdraw Balances (cURL) Source: https://docs.coinflow.cash/api-reference/api-reference/withdraw/get-withdraw-balances Example of fetching withdraw balances using cURL. Requires an API key in the 'x-coinflow-auth-wallet' header. ```curl curl https://api-sandbox.coinflow.cash/api/withdraw/balances \ -H "x-coinflow-auth-wallet: " ``` -------------------------------- ### GET /api-reference/api-reference/invoices/get-invoice Source: https://docs.coinflow.cash/guides/checkout/implementation-overview/getting-started-with-implmentation Retrieves details for a specific invoice. Use this endpoint to get information about a particular invoice, such as its status, amount, and due date. ```APIDOC ## GET /api-reference/api-reference/invoices/get-invoice ### Description Retrieves details for a specific invoice. Use this endpoint to get information about a particular invoice, such as its status, amount, and due date. ### Method GET ### Endpoint /api-reference/api-reference/invoices/get-invoice ### Parameters #### Query Parameters - **invoiceId** (string) - Required - The unique identifier of the invoice to retrieve. ### Request Example ```json { "example": "GET /api-reference/api-reference/invoices/get-invoice?invoiceId=inv_abc123" } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier for the invoice. - **amount** (number) - The total amount of the invoice. - **currency** (string) - The currency of the invoice amount. - **status** (string) - The current status of the invoice (e.g., 'paid', 'unpaid', 'due'). - **dueDate** (string) - The due date of the invoice. #### Response Example ```json { "example": { "id": "inv_abc123", "amount": 100.00, "currency": "USD", "status": "paid", "dueDate": "2023-11-30T23:59:59Z" } } ``` ``` -------------------------------- ### Example Implementation on Coinflow's Prebuilt UI Source: https://docs.coinflow.cash/guides/checkout/payment-security-risk-management/fraud-protection/implement-chargeback-protection Demonstrates how to use the `chargebackProtectionData` prop within the `CoinflowPurchase` component for the Prebuilt UI. ```APIDOC ## Example Implementation on Coinflow's Prebuilt UI ### Description This example shows how to pass `chargebackProtectionData` to the `CoinflowPurchase` component when using Coinflow's prebuilt UI. ### Request Body ```jsx ``` ``` -------------------------------- ### Get Balances Endpoint - Java SDK Example Source: https://docs.coinflow.cash/api-reference/api-reference/customers/get-checkout-balances This Java code snippet shows how to use Unirest to call the Coinflow Cash API's 'Get Balances' endpoint. It configures a GET request with the necessary authentication header and retrieves the response as a string. ```java HttpResponse response = Unirest.get("https://api-sandbox.coinflow.cash/api/customer/balances/merchantIdOrCreditSeed") .header("x-coinflow-auth-session-key", "") .asString(); ``` -------------------------------- ### Get Balances Endpoint - Python SDK Example Source: https://docs.coinflow.cash/api-reference/api-reference/customers/get-checkout-balances This Python code snippet demonstrates how to call the Coinflow Cash API's 'Get Balances' endpoint using the requests library. It sends a GET request to the specified URL with the necessary authentication header. ```python import requests url = "https://api-sandbox.coinflow.cash/api/customer/balances/merchantIdOrCreditSeed" headers = {"x-coinflow-auth-session-key": ""} response = requests.get(url, headers=headers) print(response.json()) ``` -------------------------------- ### Example: Merchant Initiated Transaction (MIT) with cURL Source: https://docs.coinflow.cash/guides/checkout/payment-scenarios/subsequent-transactions/merchant-initiated-transactions This example shows how to perform a Merchant Initiated Transaction (MIT) using cURL after a Zero Authorization. It includes the subtotal, original payment ID, and settlement type. ```bash curl --request POST \ --url https://api-sandbox.coinflow.cash/api/checkout/merchant-initiated-transaction \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'Authorization: your-merchant-api-key' \ --header 'x-user-id: customer-123' \ --data '{ "subtotal": { "cents": 5000, "currency": "USD" }, "originalPaymentId": "550e8400-e29b-41d4-a716-446655440000", "settlementType": "USDC" }' ``` -------------------------------- ### Web SDK Initialization and Configuration Source: https://docs.coinflow.cash/guides/checkout/payment-security-risk-management/fraud-protection/implement-chargeback-protection This code snippet demonstrates how to initialize the nSure SDK on a web page. It includes loading the SDK script and configuring it with your application and partner IDs. This setup is crucial for gathering user device and interaction data for fraud prediction. ```html ``` -------------------------------- ### Get Coinflow Wallet Balance (PHP) Source: https://docs.coinflow.cash/api-reference/api-reference/merchant/get-payout-balance This PHP code example demonstrates how to get the Coinflow wallet balance using Guzzle HTTP client. It sends a GET request with the Authorization header containing the API key. ```php request('GET', 'https://api-sandbox.coinflow.cash/api/merchant/withdraws/payout/balance', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ``` -------------------------------- ### Example MIT Configuration (JSON) Source: https://docs.coinflow.cash/guides/checkout/payment-scenarios/subsequent-transactions/merchant-initiated-transactions This JSON configuration enables MIT transactions, sets limits on the number of transactions per period, defines multipliers for maximum charges based on historical payments and zero authorizations, and specifies expiration times for original authorizations. ```json "enabled": true, "maxCount": 5, "period": 86400, "maxMultiple": 3, "expiration": 2592000, "maxZeroAuthAmount": { "cents": 2000 }, "maxAmountLookback": 2592000 ``` -------------------------------- ### Get Withdrawal Balances (Swift) Source: https://docs.coinflow.cash/api-reference/api-reference/withdraw/get-withdraw-balances Retrieves all token balances for a specific wallet using the Coinflow Cash API. This Swift example demonstrates making a GET request to the /withdraw/balances endpoint with the necessary authentication header. ```swift import Foundation let headers = ["x-coinflow-auth-wallet": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.coinflow.cash/api/withdraw/balances")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` -------------------------------- ### GET /api-reference/api-reference/merchant/get-merchant-v-2 Source: https://docs.coinflow.cash/guides/checkout/payment-methods/payment-methods/wires/implement-wire-payments Retrieves merchant information (V2). ```APIDOC ## GET /api-reference/api-reference/merchant/get-merchant-v-2 ### Description Retrieves merchant information using the V2 API. ### Method GET ### Endpoint /api-reference/api-reference/merchant/get-merchant-v-2 ### Parameters #### Query Parameters - **merchantId** (string) - Required - The ID of the merchant to retrieve. ### Response #### Success Response (200) - **merchantId** (string) - The unique identifier for the merchant. - **name** (string) - The name of the merchant. - **email** (string) - The email address of the merchant. - **createdAt** (string) - The timestamp when the merchant was created. #### Response Example ```json { "merchantId": "merch_123", "name": "Example Merchant", "email": "merchant@example.com", "createdAt": "2023-01-15T09:30:00Z" } ``` ``` -------------------------------- ### Card on File Workflow Source: https://docs.coinflow.cash/guides/checkout/payment-scenarios/subsequent-transactions/card-on-file This section details the four-step process for using the Card on File feature. It begins with the customer's initial purchase and opt-in, followed by secure storage, and then subsequent purchases using the stored credentials. ```plaintext Customer Makes Initial Purchase: Customer completes their first transaction and opts in to save their payment credentials for future purchases. Coinflow Securely Stores Credentials: Payment details are tokenized and stored securely in Coinflow’s PCI-compliant vault. Customer Initiates Future Purchase: For subsequent purchases, customer selects their saved payment method and authorizes the transaction. Payment is Processed: Coinflow processes the payment using the stored credentials without requiring the customer to re-enter card details. ``` -------------------------------- ### Get Balances Source: https://docs.coinflow.cash/guides/checkout/payment-security-risk-management/fraud-protection/implement-chargeback-protection Retrieves the checkout balances for a customer. ```APIDOC ## GET /api/reference/api-reference/customers/get-checkout-balances ### Description Retrieves the checkout balances for a customer. ### Method GET ### Endpoint /api/reference/api-reference/customers/get-checkout-balances ### Parameters #### Path Parameters None #### Query Parameters * **customer_id** (string) - Required - The ID of the customer. ### Response #### Success Response (200) * **balances** (object) - An object containing various balance types. * **available** (number) - The available balance. * **pending** (number) - The pending balance. * **currency** (string) - The currency of the balances. #### Response Example ```json { "balances": { "available": 150.75, "pending": 25.00, "currency": "USD" } } ``` ``` -------------------------------- ### Initial Purchase with New Card Details (Bash) Source: https://docs.coinflow.cash/guides/checkout/payment-scenarios/subsequent-transactions/merchant-initiated-transactions Demonstrates an initial purchase using new card details via a cURL command. This includes the merchant ID, subtotal, and sensitive card information like number, expiry, and CVV. ```bash curl --request POST \\ --url https://api-sandbox.coinflow.cash/api/checkout/card/your-merchant-id \\ --header 'accept: application/json' \\ --header 'content-type: application/json' \\ --header 'x-user-id: customer-123' \\ --data '{ "subtotal": { "cents": 2500, "currency": "USD" }, "card": { "number": "4111111111111111", "expiryMonth": "12", "expiryYear": "2025", "cvv": "123" } }' ``` -------------------------------- ### Get Customer Source: https://docs.coinflow.cash/guides/checkout/payment-security-risk-management/fraud-protection/implement-chargeback-protection Retrieves the details of a specific customer. ```APIDOC ## GET /api/reference/api-reference/customers/get-customer ### Description Retrieves the details of a specific customer. ### Method GET ### Endpoint /api/reference/api-reference/customers/get-customer ### Parameters #### Path Parameters None #### Query Parameters * **customer_id** (string) - Required - The ID of the customer to retrieve. ### Response #### Success Response (200) * **customer_id** (string) - The ID of the customer. * **name** (string) - The name of the customer. * **email** (string) - The email address of the customer. #### Response Example ```json { "customer_id": "cust_12345", "name": "John Doe", "email": "john.doe@example.com" } ``` ``` -------------------------------- ### SDK Initialization Source: https://docs.coinflow.cash/guides/checkout/payment-security-risk-management/fraud-protection/implement-chargeback-protection Add this script to every page on your site to initialize the Coinflow SDK and enable device and user interaction tracking. ```APIDOC ## SDK Initialization ### Description This script initializes the Coinflow SDK, allowing it to gather information about the user's device and interaction with your website for fraud prediction. ### Method Client-side JavaScript ### Endpoint Not applicable (added to website HTML) ### Parameters None ### Request Example ```html ``` ### Response None (initializes SDK functionality) ``` -------------------------------- ### Get Withdraw Balances (Java) Source: https://docs.coinflow.cash/api-reference/api-reference/withdraw/get-withdraw-balances Java code using Unirest to fetch withdraw balances. This example demonstrates how to set the required headers for authentication. ```java HttpResponse response = Unirest.get("https://api-sandbox.coinflow.cash/api/withdraw/balances") .header("x-coinflow-auth-wallet", "") .asString(); ``` -------------------------------- ### Example Implementation on Coinflow's APIs Source: https://docs.coinflow.cash/guides/checkout/payment-security-risk-management/fraud-protection/implement-chargeback-protection Provides a `curl` example for sending `chargebackProtectionData` when creating a checkout transaction via Coinflow's APIs. ```APIDOC ## Example Implementation on Coinflow's APIs ### Description This example demonstrates how to include `chargebackProtectionData` in the request payload when creating a checkout transaction using Coinflow's API. ### Method POST ### Endpoint `https://api-sandbox.coinflow.cash/api/checkout/ach/{merchantId}` ### Request Body ```json { "subtotal": { "cents": 100 }, "transactionData": { "type": "safeMint" }, "token": "5a000000-0000-0000-0000-000000000000", "chargebackProtectionData": [ { "productType": "inGameProduct", "productName": "Sword", "quantity": 1, "rawProductData": { "productID": "sword12345", "productDescription": "A legendary sword with magical powers.", "productCategory": "Weapon", "weight": "15 lbs", "dimensions": "40 in x 5 in", "origin": "Ancient Kingdom", "craftedBy": "Master Blacksmith", "craftingDate": "2024-06-19" } } ] } ``` ### Request Example (curl) ```bash curl --request POST \ --url https://api-sandbox.coinflow.cash/api/checkout/ach/merchantId \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --data '\n{\n \"subtotal\": {\n \"cents\": 100\n },\n \"transactionData\": {\n \"type\": \"safeMint\"\n },\n \"token\": \"5a000000-0000-0000-0000-000000000000\",\n \"chargebackProtectionData\": [\n {\n \"productType\": \"inGameProduct\",\n \"productName\": \"Sword\",\n \"quantity\": 1,\n \"rawProductData\": {\n \"productID\": \"sword12345\",\n \"productDescription\": \"A legendary sword with magical powers.\",\n \"productCategory\": \"Weapon\",\n \"weight\": \"15 lbs\",\n \"dimensions\": \"40 in x 5 in\",\n \"origin\": \"Ancient Kingdom\",\n \"craftedBy\": \"Master Blacksmith\",\n \"craftingDate\": \"2024-06-19\"\n }\n }\n ]\n}\n' ``` ``` -------------------------------- ### Next.js App Initialization and Configuration (JavaScript) Source: https://docs.coinflow.cash/guides/checkout/payment-security-risk-management/fraud-protection/implement-chargeback-protection This snippet appears to be part of a Next.js application's initialization process. It configures the application's internal state and loads necessary chunks for routing and rendering, including error and not-found pages. ```javascript self.__next_f = self.__next_f || []; self.__next_f.push([0]); self.__next_f.push([1, "1:\"$Sreact.fragment\"\n2:I[49653,[],\"\"]\n3:I[51532, [\"7835\", \"static/chunks/7835-3a815ec4eaaff021.js\", \"600\", \"static/chunks/600-cce08eabd32817a3.js\", \"7040\", \"static/chunks/7040-e937728722937a85.js\", \"8549\", \"static/chunks/8549-1690eb2d5d0fe7f7.js\", \"8039\", \"static/chunks/app/error-2b9b8051f4eb6e97.js\"], \"default\"]\n4:I[86001,[],\"\"]\n5:I[28850, [\"6187\", \"static/chunks/6187-ab09ae000765f073.js\", \"1526\", \"static/chunks/1526-37f29a4fc8bbc18f.js\", \"1916\", \"static/chunks/1916-1b320037501f42ea.js\", \"9502\", \"static/chunks/9502-0647310323f96f8c.js\", \"4345\", \"static/chunks/app/not-found-98b342ac4ee1b9d7.js\"], \"default\"]\n29:I[83991,[],\"\"]\n:HL[\"https://app.buildwithfern.com/_next/static/css/88f0ad7a06f150f1.css\",\"style\"]\n:HL[\"https://app.buildwithfern.com/_next/static/css/80bca615e6d01b34.css\",\"style\"]\n"]) self.__next_f.push([1, "0:{\"P\":null,\"b\":\"Zaf1SxAsW2paEVezDgM4r\",\"p\":\"https://app.buildwithfern.com\",\"c\":[\"\",\"docs.coinflow.cash\",\"docs.coinflow.cash\",\"static\",\"%2Fguides%2Fcheckout%2Fpayment-security-risk-management%2Ffraud-protection%2Fimplement-chargeback-protection\"]... (truncated)"]) ``` -------------------------------- ### Complete Checkout with 3DS Challenge Implementation Guide (Link) Source: https://docs.coinflow.cash/guides/checkout/payment-scenarios/subsequent-transactions/card-on-file Provides a link to a detailed guide on implementing the complete 3D Secure challenge flow within your checkout process. ```html Complete 3DS Challenge Implementation Guide ``` -------------------------------- ### GET /api/checkout/validate-merchant Source: https://docs.coinflow.cash/api-reference/api-reference/customers/add-bank-account Validates the merchant's identity and capabilities for Apple Pay. This GET request is typically used during the Apple Pay setup process. ```APIDOC ## GET /api/checkout/validate-merchant ### Description Validates the merchant's identity and capabilities for Apple Pay. This GET request is typically used during the Apple Pay setup process. ### Method GET ### Endpoint /api/checkout/validate-merchant ### Parameters #### Path Parameters None #### Query Parameters - **merchant_id** (string) - Required - The unique identifier for the merchant. - **domain_name** (string) - Required - The domain name to validate. ### Request Example ``` GET /api/checkout/validate-merchant?merchant_id=merch_xyz&domain_name=example.com ``` ### Response #### Success Response (200) - **is_valid** (boolean) - Indicates if the merchant is valid for Apple Pay. - **message** (string) - A message providing details about the validation. #### Response Example ```json { "is_valid": true, "message": "Merchant validation successful for Apple Pay." } ``` ```