### Initialize Node.js Project and Install Dependencies Source: https://www.blindpay.com/docs/getting-started/quick-start Sets up a new Node.js project and installs the necessary libraries: Express for the server and ethers for blockchain interaction. These are the foundational steps for building the payout API. ```bash npm init npm install express ethers ``` -------------------------------- ### Install Solana Dependencies (Bash) Source: https://www.blindpay.com/docs/essentials/payouts Installs the required Node.js packages for interacting with the Solana blockchain, specifically `@solana/web3.js` for blockchain operations and `bs58` for base58 encoding/decoding. ```bash npm install @solana/web3.js bs58 ``` -------------------------------- ### Full Webhook Verification Example in JavaScript Source: https://www.blindpay.com/docs/essentials/webhooks This comprehensive example demonstrates the complete process of verifying a BlindPay webhook in JavaScript. It includes obtaining the secret, defining payload and message details, constructing the signed content, calculating the signature, and formatting the expected signature string. ```javascript const crypto = require('node:crypto') // Example values const secret = 'whsec_plJ3nmyCDGBKInavdOK15jsl' const payload = '{"event_type":"ping","data":{"success":true}}' const msg_id = 'msg_loFOjxBNrRLzqYUf' const timestamp = '1731705121' // Expected signature: v1,rAvfW3dJ/X/qxhsaXPOyyCGmRKsaKWcsNccKXlIktD0= const signedContent = `${msg_id}.${timestamp}.${payload}` const secretBytes = require('node:buffer').Buffer.from(secret.split('_')[1], 'base64') const signature = crypto .createHmac('sha256', secretBytes) .update(signedContent) .digest('base64') console.log(`v1,${signature}`) ``` -------------------------------- ### Run the Express.js Application Source: https://www.blindpay.com/docs/getting-started/quick-start Executes the Node.js application to start the Express.js server. Once running, the application can be accessed via a web browser at http://localhost:3000. ```bash node index.js ``` -------------------------------- ### Run Solana Delegation Script (Bash) Source: https://www.blindpay.com/docs/essentials/payouts Executes the `solana-delegate.js` script using Node.js to perform the Solana delegation process after dependencies are installed and the script is created. ```bash node solana-delegate.js ``` -------------------------------- ### Create Receiver with Standard KYB (Business) - cURL Source: https://www.blindpay.com/docs/essentials/receivers This cURL example shows how to create a receiver for a business entity using standard KYB (Know Your Business) requirements. It includes business-specific details and documentation. ```bash curl --request POST \ --url https://api.blindpay.com/v1/instances/in_000000000000/receivers \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ \ "tos_id": "", \ "type": "business", \ "kyc_type": "standard", \ "email": "test@blindpay.com", \ "tax_id": "123456", \ "address_line_1": "8 The Green", \ "city": "Dover", \ "state_province_region": "DE", \ "country": "US", \ "postal_code": "19901", \ "phone_number": "+13022006336", \ "proof_of_address_doc_type": "UTILITY_BILL" \ }' ``` -------------------------------- ### Create Payin Quote (PIX) using BlindPay API Source: https://www.blindpay.com/docs/essentials/payin-quotes This example illustrates creating a payin quote for PIX payments through the BlindPay API. It includes optional payer_rules for specifying allowed tax IDs. Remember to format amounts as integers and use 'USDB' for development or 'USDC'/'USDT' for production. ```curl curl https://api.blindpay.com/v1/instances/in_000000000000/payin-quotes \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \ --data '{ "blockchain_wallet_id": "bw_000000000000", "currency_type": "sender", "cover_fees": false, "request_amount": 10000, "payment_method": "pix", "token": "USDB", "payer_rules": { "pix_allowed_tax_ids": [ "14747677786" ] } }' ``` -------------------------------- ### Add RTP Bank Account via API Source: https://www.blindpay.com/docs/essentials/bank-accounts This example illustrates adding a bank account for Real-Time Payments (RTP) using the BlindPay API. It includes beneficiary name, account and routing numbers, and address details. Ensure the specified country and postal code are accurate. ```curl curl --request POST \ --url https://api.blindpay.com/v1/instances/in_000000000000/receivers/re_000000000000/bank-accounts \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ \ "type": "rtp", \ "name": "Display Name", \ "beneficiary_name": "", \ "routing_number": "", \ "account_number": "", \ "address_line_1": "", \ "address_line_2": "", \ "city": "", \ "state_province_region": "", \ "country": "", \ "postal_code": "" \ }' ``` -------------------------------- ### Add SPEI Bank Account via API (Bitso) Source: https://www.blindpay.com/docs/essentials/bank-accounts This example demonstrates adding a bank account for SPEI transfers via Bitso using the BlindPay API. It requires a display name, beneficiary name, SPEI protocol, institution code, and CLABE number. ```curl curl --request POST \ --url https://api.blindpay.com/v1/instances/in_000000000000/receivers/re_000000000000/bank-accounts \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ \ "type": "spei_bitso", \ "name": "Display Name", \ "beneficiary_name": "", \ "spei_protocol": "", \ "spei_institution_code": "", \ "spei_clabe": "" \ }' ``` -------------------------------- ### Create Stellar Asset Trustline Source: https://www.blindpay.com/docs/essentials/payouts Creates a trustline for USDB asset on Stellar Testnet. This is a one-time setup required before you can receive USDB tokens. ```APIDOC ## POST /v1/instances/{instance_id}/create-asset-trustline ### Description Creates a trustline for USDB asset on Stellar Testnet. This is a one-time setup required before you can receive USDB tokens. ### Method POST ### Endpoint /v1/instances/{instance_id}/create-asset-trustline ### Parameters #### Path Parameters - **instance_id** (string) - Required - Your instance ID. #### Header Parameters - **Authorization** (string) - Required - Bearer YOUR_SECRET_TOKEN - **Content-Type** (string) - Required - application/json #### Request Body - **address** (string) - Required - The Stellar address for which to create the trustline. ### Request Example ```json { "address": "YOUR_ADDRESS" } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. - **xdr** (string) - An unsigned XDR transaction for the trustline setup. This needs to be signed and submitted. #### Response Example ```json { "success": true, "xdr": "AAAAA..." } ``` ``` -------------------------------- ### Create Payin Quote (Transfers) using BlindPay API Source: https://www.blindpay.com/docs/essentials/payin-quotes This example shows how to generate a payin quote for Transfers 3.0 via the BlindPay API. It includes the 'transfers_allowed_tax_id' within payer_rules. Remember to use integer values for 'request_amount' and the correct token for your environment. ```curl curl https://api.blindpay.com/v1/instances/in_000000000000/payin-quotes \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \ --data '{ "blockchain_wallet_id": "bw_000000000000", "currency_type": "sender", "cover_fees": false, "request_amount": 2000000, "payment_method": "transfers", "token": "USDB", "payer_rules": { "transfers_allowed_tax_id": "30-27383762-7" } }' ``` -------------------------------- ### Get Message to Sign for Secure Wallet Addition Source: https://www.blindpay.com/docs/essentials/blockchain-wallets Retrieve a message that needs to be signed by the external wallet to verify ownership before adding it securely. ```APIDOC ## GET /v1/instances/{instance_id}/receivers/{receiver_id}/blockchain-wallets/sign-message ### Description Retrieves a message to be signed by the user's external blockchain wallet. This is the first step in the secure method of adding a wallet, ensuring ownership verification. ### Method GET ### Endpoint `/v1/instances/{instance_id}/receivers/{receiver_id}/blockchain-wallets/sign-message` ### Parameters #### Path Parameters - **instance_id** (string) - Required - The unique identifier for the BlindPay instance. - **receiver_id** (string) - Required - The unique identifier for the receiver. #### Query Parameters None #### Request Body None ### Request Example ```bash curl https://api.blindpay.com/v1/instances/in_000000000000/receivers/re_000000000000/blockchain-wallets/sign-message \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' ``` ### Response #### Success Response (200) - **message** (string) - The message to be signed by the external wallet. #### Response Example ```json { "message": "Please sign this message to confirm ownership of your wallet." } ``` ``` -------------------------------- ### POST /v1/e/instances/{instance_id}/tos Source: https://www.blindpay.com/docs/essentials/terms-of-service Generates a URL for users to accept BlindPay's Terms of Service. This is a mandatory step before a user can create a receiver. ```APIDOC ## POST /v1/e/instances/{instance_id}/tos ### Description Generates a URL for users to accept BlindPay's Terms of Service. This is a mandatory step before a user can create a receiver. ### Method POST ### Endpoint /v1/e/instances/{instance_id}/tos ### Parameters #### Path Parameters - **instance_id** (string) - Required - Your development instance ID (e.g., `in_000000000000`). #### Query Parameters None #### Request Body - **idempotency_key** (uuid) - Required - A unique UUID to ensure the request is processed only once. ### Request Example ```json { "idempotency_key": "" } ``` ### Response #### Success Response (200) - **url** (string) - The URL that the user needs to access to accept the terms of service. This URL includes `session_token`, `idempotency_key`, and optionally `redirect_url` and `receiver_id` as query parameters. #### Response Example ``` https://app.blindpay.com/e/terms-of-service?session_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZGVtcG90ZW5jeV9rZXkiOiI1ZDhiMTQ5ZS1hNTVkLTRiNWItYThmOC03YzRmYTMxNWY4NTQiLCJleHAiOjE3NDI3OTk5MjcsImlhdCI6MTc0Mjc5OTgwN30.gP5imRCt_Ws-SFD7Pc8HRiGooxGM8pd_hXWUEcwKE0I&idempotency_key=5d8b149e-a55d-4b5b-a8f8-7c4fa315f854&redirect_url= ``` **URL Query Parameters:** - **session_token** (jwt) - Required - Provided by the API, used for session management. - **idempotency_key** (uuid) - Required - The same UUID sent in the request body. - **redirect_url** (string) - Optional - The URL to redirect the user to after they accept the terms. Recommended for a seamless user experience. - **receiver_id** (string) - Optional - Mandatory when accepting a new version of the Terms of Service. Specify the receiver ID (e.g., `re_000000000000`) for which a new TOS version is being accepted. ``` -------------------------------- ### POST /v1/instances/{instance_id}/prepare-delegate-solana Source: https://www.blindpay.com/docs/essentials/payouts Prepares a delegation transaction for Solana payouts. This endpoint returns a serialized transaction that needs to be signed. ```APIDOC ## POST /v1/instances/{instance_id}/prepare-delegate-solana ### Description Prepares a delegation transaction for Solana payouts. This endpoint returns a serialized transaction that needs to be signed. ### Method POST ### Endpoint `https://api.blindpay.com/v1/instances/{instance_id}/prepare-delegate-solana` ### Parameters #### Path Parameters - **instance_id** (string) - Required - Your instance ID. #### Query Parameters None #### Request Body - **owner_address** (string) - Required - Your Solana wallet address. - **token_address** (string) - Required - The address of the token to be delegated. - **amount** (string) - Required - The amount of tokens to delegate. ### Request Example ```json { "owner_address": "YOUR_SOLANA_WALLET_ADDRESS", "token_address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "amount": "50000000" } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the transaction preparation was successful. - **transaction** (string) - The serialized transaction that needs to be signed. #### Response Example ```json { "success": true, "transaction": "AQAAA..." } ``` ``` -------------------------------- ### POST /v1/e/instances/{instance_id}/tos Source: https://www.blindpay.com/docs/getting-started/quick-start-payin Accepts the terms of service for a given instance. This is a prerequisite for creating receivers. ```APIDOC ## POST /v1/e/instances/{instance_id}/tos ### Description Accepts the terms of service for a given instance. This is a prerequisite for creating receivers. ### Method POST ### Endpoint `/v1/e/instances/{instance_id}/tos` ### Parameters #### Path Parameters - **instance_id** (string) - Required - Your development instance ID. #### Request Body - **idempotency_key** (string) - Required - A unique key to ensure the request is processed only once. ### Request Example ```json { "idempotency_key": "" } ``` ### Response #### Success Response (200) - **tos_id** (string) - The ID of the accepted terms of service, used for creating receivers. #### Response Example (Response body not provided in documentation, but it will contain the tos_id) ``` -------------------------------- ### Create Stellar Asset Trustline API Request Source: https://www.blindpay.com/docs/essentials/payouts Initiates the creation of a trustline for USDB tokens on the Stellar Testnet. This is a one-time setup per wallet and returns an unsigned XDR transaction that needs to be signed and submitted. ```Bash curl --request POST \ --url https://api.blindpay.com/v1/instances/{instance_id}/create-asset-trustline \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "address": "YOUR_ADDRESS" }' ``` -------------------------------- ### Get Message to Sign for Wallet Integration (cURL) Source: https://www.blindpay.com/docs/essentials/blockchain-wallets This cURL command retrieves a message that needs to be signed to securely add an external blockchain wallet to BlindPay. It requires your API instance and receiver IDs, along with an authorization token. ```bash curl https://api.blindpay.com/v1/instances/in_000000000000/receivers/re_000000000000/blockchain-wallets/sign-message \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' ``` -------------------------------- ### Create Receiver Source: https://www.blindpay.com/docs/getting-started/quick-start-payin Creates a new receiver on a development instance, which will be automatically approved by KYC. Requires API key, instance ID, and previously obtained tos_id. Accepts various personal and address details, along with document uploads. ```bash curl --request POST \ --url https://api.blindpay.com/v1/instances/in_000000000000/receivers \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ \ "tos_id": "", \ "type": "individual", \ "kyc_type": "standard", \ "email": "email@example.com", \ "tax_id": "12345678", \ "address_line_1": "8 The Green", \ "address_line_2": "#12345", \ "city": "Dover", \ "state_province_region": "DE", \ "country": "US", \ "postal_code": "02050", \ "ip_address": "127.0.0.1", \ "phone_number": "+13022006100", \ "proof_of_address_doc_type": "UTILITY_BILL", \ "proof_of_address_doc_file": "https://pub-4fabf5dd55154f19a0384b16f2b816d9.r2.dev/v4-460px-Get-Proof-of-Address-Step-3-Version-2.jpg.jpeg", \ "first_name": "John", \ "last_name": "Doe", \ "date_of_birth": "1998-01-01T00:00:00Z", \ "id_doc_country": "US", \ "id_doc_type": "PASSPORT", \ "id_doc_front_file": "https://pub-4fabf5dd55154f19a0384b16f2b816d9.r2.dev/1000_F_365165797_VwQbNaD4yjWwQ6y1ENKh1xS0TXauOQvj.jpg", \ "selfie_file": "https://pub-4fabf5dd55154f19a0384b16f2b816d9.r2.dev/selfie.png" \ }' ``` -------------------------------- ### Initiate Payin using cURL Source: https://www.blindpay.com/docs/getting-started/quick-start-payin Initiates a fiat to stablecoin transfer using a payin quote ID. Requires your API key, instance ID, and payin quote ID. The response provides essential details for the end user, such as memo_code and bank transfer information. ```bash curl https://api.blindpay.com/v1/instances/in_000000000000/payins/evm \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \ --data '{ \ "payin_quote_id": "pq_000000000000" \ }' ``` -------------------------------- ### POST /v1/instances/{instance_id}/payins/evm Source: https://www.blindpay.com/docs/getting-started/quick-start-payin Initiates a payin by transferring fiat to stablecoins using a payin quote ID. The response includes `memo_code` and `blindpay_bank_details` for the end user. ```APIDOC ## POST /v1/instances/{instance_id}/payins/evm ### Description Initiates a payin transaction by transferring fiat currency to stablecoins. This endpoint requires a `payin_quote_id` that must be created beforehand. The response provides essential details like `memo_code` and `blindpay_bank_details` for the end user. ### Method POST ### Endpoint `/v1/instances/{instance_id}/payins/evm` ### Parameters #### Path Parameters - **instance_id** (string) - Required - Your instance ID (e.g., `in_000000000000`). #### Request Body - **payin_quote_id** (string) - Required - The ID of the payin quote created previously (e.g., `pq_000000000000`). ### Request Example ```json { "payin_quote_id": "pq_000000000000" } ``` ### Response #### Success Response (200) - **memo_code** (string) - A code to be used for transaction memoization. - **blindpay_bank_details** (object) - Bank details for the fiat deposit. - **routing_number** (string) - The routing number for the bank. - **account_number** (string) - The account number for the bank. - **account_type** (string) - The type of the bank account. - **beneficiary** (object) - Information about the beneficiary. - **name** (string) - The name of the beneficiary. - **address_line_1** (string) - The first line of the beneficiary's address. - **address_line_2** (string) - The second line of the beneficiary's address. - **receiving_bank** (object) - Information about the receiving bank. - **name** (string) - The name of the receiving bank. - **address_line_1** (string) - The first line of the receiving bank's address. - **address_line_2** (string) - The second line of the receiving bank's address. #### Response Example ```json { "memo_code": "12345678", "blindpay_bank_details": { "routing_number": "121145349", "account_number": "621327727210181", "account_type": "Business checking", "beneficiary": { "name": "BlindPay, Inc.", "address_line_1": "8 The Green, #19364", "address_line_2": "Dover, DE 19901" }, "receiving_bank": { "name": "Column NA - Brex", "address_line_1": "1 Letterman Drive, Building A, Suite A4-700", "address_line_2": "San Francisco, CA 94129" } } } ``` ``` -------------------------------- ### Initiate Payin (EVM) Source: https://www.blindpay.com/docs/essentials/payins Initiates a payin process for EVM-compatible chains. A payin quote must be created beforehand and is valid for 5 minutes. ```APIDOC ## POST /v1/instances/{instance_id}/payins/evm ### Description Initiates a payin process for EVM-compatible chains. The payin converts fiat money to stablecoins and sends them to a specified blockchain wallet. ### Method POST ### Endpoint `/v1/instances/in_000000000000/payins/evm` ### Parameters #### Path Parameters - **instance_id** (string) - Required - The ID of the development instance. #### Query Parameters None #### Request Body - **payin_quote_id** (string) - Required - The ID of the previously generated payin quote. ### Request Example ```json { "payin_quote_id": "pq_000000000000" } ``` ### Response #### Success Response (200) - **payin_id** (string) - The ID of the initiated payin. - **status** (string) - The current status of the payin. #### Response Example ```json { "payin_id": "py_1234567890abcdef", "status": "initiated" } ``` ### Testing Scenarios - To simulate a failed payin, set the amount to `666.00`. - To simulate a refunded payin, set the amount to `777.00`. ### Notes - Replace `YOUR_SECRET_TOKEN` with your API key in the `Authorization` header. - Supported EVM chains include Ethereum, Polygon, Base, and Arbitrum for USDC and USDT. - The payin must be initiated within 5 minutes of quote generation. ``` -------------------------------- ### Accept Terms of Service with BlindPay API Source: https://www.blindpay.com/docs/getting-started/quick-start Accepts the terms of service for a given instance, which is a prerequisite for creating receivers. Requires your API key and instance ID. The response contains a URL to finalize the acceptance. ```bash curl --request POST \ --url https://api.blindpay.com/v1/e/instances/in_000000000000/tos \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "idempotency_key": "" }' ``` -------------------------------- ### Create Offramp Wallet with cURL Source: https://www.blindpay.com/docs/essentials/offramp-wallets This cURL command demonstrates how to create an offramp wallet by sending a POST request to the BlindPay API. It requires authentication with a Bearer token and specifies the network for the wallet. The response will contain the details of the newly created offramp wallet. ```bash curl --request POST \ --url https://api.blindpay.com/v1/instances/in_000000000000/receivers/re_000000000000/bank-accounts/ba_000000000000/offramp-wallets \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "network": "tron" }' ``` -------------------------------- ### Accept Terms of Service API Source: https://www.blindpay.com/docs/getting-started/quick-start Accepts the terms of service for a given instance. This is a prerequisite for creating receivers. For production, the customer should accept the terms. ```APIDOC ## POST /v1/e/instances/{instance_id}/tos ### Description Accepts the terms of service for a given instance. This is a prerequisite for creating receivers. For production, the customer should accept the terms. ### Method POST ### Endpoint `https://api.blindpay.com/v1/e/instances/in_000000000000/tos` ### Parameters #### Path Parameters - **instance_id** (string) - Required - The ID of the instance. #### Query Parameters None #### Request Body - **idempotency_key** (string) - Required - A unique key to ensure the request is processed only once. ### Request Example ```json { "idempotency_key": "" } ``` ### Response #### Success Response (200) - **tos_id** (string) - The ID of the accepted terms of service, used for creating receivers. #### Response Example ```json { "tos_id": "to_fuu6PrnGEHhl" } ``` ``` -------------------------------- ### Create Receiver with Enhanced KYC (Individual) - cURL Source: https://www.blindpay.com/docs/essentials/receivers This cURL command illustrates how to create a receiver for an individual requiring enhanced KYC. It includes additional fields for source of funds and transaction purpose compared to standard KYC. ```bash curl --request POST \ --url https://api.blindpay.com/v1/instances/in_000000000000/receivers \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ \ "tos_id": "", \ "type": "individual", \ "kyc_type": "enhanced", \ "email": "email@example.com", \ "tax_id": "123456788", \ "address_line_1": "8 The Green", \ "address_line_2": "#12345", \ "city": "Dover", \ "state_province_region": "DE", \ "country": "US", \ "postal_code": "02050", \ "ip_address": "127.0.0.1", \ "phone_number": "+13022006100", \ "proof_of_address_doc_type": "UTILITY_BILL", \ "proof_of_address_doc_file": "https://pub-4fabf5dd55154f19a0384b16f2b816d9.r2.dev/v4-460px-Get-Proof-of-Address-Step-3-Version-2.jpg.jpeg", \ "first_name": "John", \ "last_name": "Doe", \ "date_of_birth": "1998-01-01T00:00:00Z", \ "id_doc_country": "US", \ "id_doc_type": "PASSPORT", \ "id_doc_front_file": "https://pub-4fabf5dd55154f19a0384b16f2b816d9.r2.dev/1000_F_365165797_VwQbNaD4yjWwQ6y1ENKh1xS0TXauOQvj.jpg", \ "selfie_file": "https://pub-4fabf5dd55154f19a0384b16f2b816d9.r2.dev/selfie.png", \ "source_of_funds_doc_file": "https://pub-4fabf5dd55154f19a0384b16f2b816d9.r2.dev/source-of-funds.jpg", \ "source_of_funds_doc_type": "business_income", \ "purpose_of_transactions": "business_transactions", \ "purpose_of_transactions_explanation": "I am using the money for my personal expenses." \ }' ``` -------------------------------- ### Generate Terms of Service URL (cURL) Source: https://www.blindpay.com/docs/essentials/terms-of-service This cURL command initiates the generation of a BlindPay Terms of Service URL. It requires your API key and instance ID. The response contains a URL that the user must visit to accept the terms. ```bash curl --request POST \ --url https://api.blindpay.com/v1/e/instances/in_000000000000/tos \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ \ "idempotency_key": "" \ }' ``` -------------------------------- ### Prepare Solana Delegation Transaction via cURL Source: https://www.blindpay.com/docs/essentials/payouts This cURL command prepares a token delegation transaction for a Solana payout on BlindPay. It requires your API token, instance ID, the owner's Solana wallet address, the token address, and the amount to delegate. ```bash curl --request POST \ --url https://api.blindpay.com/v1/instances/{instance_id}/prepare-delegate-solana \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "owner_address": "YOUR_SOLANA_WALLET_ADDRESS", "token_address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "amount": "50000000" }' ``` -------------------------------- ### POST /v1/instances/{instance_id}/receivers Source: https://www.blindpay.com/docs/essentials/receivers Creates a new receiver for a given instance. This endpoint supports various KYC types, including standard and enhanced individual and business verification. ```APIDOC ## POST /v1/instances/{instance_id}/receivers ### Description Creates a new receiver for a given instance. This endpoint supports various KYC types, including standard and enhanced individual and business verification. ### Method POST ### Endpoint `/v1/instances/{instance_id}/receivers` ### Parameters #### Path Parameters - **instance_id** (string) - Required - The ID of the development instance. #### Query Parameters None #### Request Body - **tos_id** (string) - Required - The ID obtained from terms of service acceptance. - **type** (string) - Required - The type of receiver ('individual' or 'business'). - **kyc_type** (string) - Required - The KYC type ('standard' or 'enhanced'). - **email** (string) - Required - The email address of the receiver. - **tax_id** (string) - Required - The tax ID of the receiver. - **address_line_1** (string) - Required - The first line of the receiver's address. - **address_line_2** (string) - Optional - The second line of the receiver's address. - **city** (string) - Required - The city of the receiver's address. - **state_province_region** (string) - Required - The state, province, or region of the receiver's address. - **country** (string) - Required - The country of the receiver's address. - **postal_code** (string) - Required - The postal code of the receiver's address. - **ip_address** (string) - Optional - The IP address associated with the receiver. - **phone_number** (string) - Optional - The phone number of the receiver. - **proof_of_address_doc_type** (string) - Optional - The type of proof of address document. - **proof_of_address_doc_file** (string) - Optional - URL to the proof of address document. - **first_name** (string) - Required for 'individual' type - The first name of the receiver. - **last_name** (string) - Required for 'individual' type - The last name of the receiver. - **date_of_birth** (string) - Required for 'individual' type - The date of birth of the receiver (ISO 8601 format). - **id_doc_country** (string) - Required for 'individual' type - The country of the identification document. - **id_doc_type** (string) - Required for 'individual' type - The type of identification document. - **id_doc_front_file** (string) - Required for 'individual' type - URL to the front of the identification document. - **selfie_file** (string) - Required for 'individual' type - URL to the selfie of the receiver. - **source_of_funds_doc_file** (string) - Required for 'enhanced' KYC - URL to the source of funds document. - **source_of_funds_doc_type** (string) - Required for 'enhanced' KYC - The type of source of funds document. - **purpose_of_transactions** (string) - Required for 'enhanced' KYC - The stated purpose of transactions. - **purpose_of_transactions_explanation** (string) - Optional for 'enhanced' KYC - An explanation for the purpose of transactions. ### Request Example (Standard Individual KYC) ```json { "tos_id": "", "type": "individual", "kyc_type": "standard", "email": "email@example.com", "tax_id": "12345678", "address_line_1": "8 The Green", "address_line_2": "#12345", "city": "Dover", "state_province_region": "DE", "country": "US", "postal_code": "02050", "ip_address": "127.0.0.1", "phone_number": "+13022006100", "proof_of_address_doc_type": "UTILITY_BILL", "proof_of_address_doc_file": "https://pub-4fabf5dd55154f19a0384b16f2b816d9.r2.dev/v4-460px-Get-Proof-of-Address-Step-3-Version-2.jpg.jpeg", "first_name": "John", "last_name": "Doe", "date_of_birth": "1998-01-01T00:00:00Z", "id_doc_country": "US", "id_doc_type": "PASSPORT", "id_doc_front_file": "https://pub-4fabf5dd55154f19a0384b16f2b816d9.r2.dev/1000_F_365165797_VwQbNaD4yjWwQ6y1ENKh1xS0TXauOQvj.jpg", "selfie_file": "https://pub-4fabf5dd55154f19a0384b16f2b816d9.r2.dev/selfie.png" } ``` ### Request Example (Enhanced Individual KYC) ```json { "tos_id": "", "type": "individual", "kyc_type": "enhanced", "email": "email@example.com", "tax_id": "123456788", "address_line_1": "8 The Green", "address_line_2": "#12345", "city": "Dover", "state_province_region": "DE", "country": "US", "postal_code": "02050", "ip_address": "127.0.0.1", "phone_number": "+13022006100", "proof_of_address_doc_type": "UTILITY_BILL", "proof_of_address_doc_file": "https://pub-4fabf5dd55154f19a0384b16f2b816d9.r2.dev/v4-460px-Get-Proof-of-Address-Step-3-Version-2.jpg.jpeg", "first_name": "John", "last_name": "Doe", "date_of_birth": "1998-01-01T00:00:00Z", "id_doc_country": "US", "id_doc_type": "PASSPORT", "id_doc_front_file": "https://pub-4fabf5dd55154f19a0384b16f2b816d9.r2.dev/1000_F_365165797_VwQbNaD4yjWwQ6y1ENKh1xS0TXauOQvj.jpg", "selfie_file": "https://pub-4fabf5dd55154f19a0384b16f2b816d9.r2.dev/selfie.png", "source_of_funds_doc_file": "https://pub-4fabf5dd55154f19a0384b16f2b816d9.r2.dev/source-of-funds.jpg", "source_of_funds_doc_type": "business_income", "purpose_of_transactions": "business_transactions", "purpose_of_transactions_explanation": "I am using the money for my personal expenses." } ``` ### Request Example (Standard Business KYC) ```json { "tos_id": "", "type": "business", "kyc_type": "standard", "email": "test@blindpay.com", "tax_id": "123456", "address_line_1": "8 The Green", "city": "Dover", "state_province_region": "DE", "country": "US", "postal_code": "19901", "phone_number": "+13022006336", "proof_of_address_doc_type": "UTILITY_BILL" } ``` ### Response #### Success Response (201 Created) - **id** (string) - The unique identifier for the created receiver. - **status** (string) - The current status of the receiver (e.g., 'pending_verification', 'active'). #### Response Example ```json { "id": "rcv_12345abcdef", "status": "pending_verification" } ``` ``` -------------------------------- ### Initiate EVM Payin with cURL Source: https://www.blindpay.com/docs/essentials/payins Initiates a payin process for EVM chains using the BlindPay API. This requires a pre-generated payin quote ID and an API key for authentication. The request is a POST to the /payins/evm endpoint. ```bash curl https://api.blindpay.com/v1/instances/in_000000000000/payins/evm \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \ --data '{ "payin_quote_id": "pq_000000000000" }' ``` -------------------------------- ### Create Payin Quote (PSE) using BlindPay API Source: https://www.blindpay.com/docs/essentials/payin-quotes This snippet demonstrates creating a payin quote for PSE payments using the BlindPay API. It requires detailed payer information within the 'payer_rules' object. Ensure 'request_amount' is an integer and use 'USDB' for development or 'USDC'/'USDT' for production. ```curl curl https://api.blindpay.com/v1/instances/in_000000000000/payin-quotes \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \ --data '{ "blockchain_wallet_id": "bw_000000000000", "currency_type": "sender", "cover_fees": false, "request_amount": 20000000, "payment_method": "pse", "token": "USDB", "payer_rules": { "pse_full_name": "", "pse_document_type": "NIT", "pse_document_number": "", "pse_email": "", "pse_phone": "", "pse_bank_code": "" } }' ``` -------------------------------- ### Create Payin Quote (SPEI) using BlindPay API Source: https://www.blindpay.com/docs/essentials/payin-quotes This snippet demonstrates creating a payin quote for SPEI payments using the BlindPay API. Ensure that the 'request_amount' is an integer and select the appropriate token ('USDB' for development, 'USDC'/'USDT' for production). ```curl curl https://api.blindpay.com/v1/instances/in_000000000000/payin-quotes \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \ --data '{ "blockchain_wallet_id": "bw_000000000000", "currency_type": "sender", "cover_fees": false, "request_amount": 100000, "payment_method": "spei", "token": "USDB" }' ``` -------------------------------- ### Add Bank Account to Receiver (cURL) Source: https://www.blindpay.com/docs/essentials/bank-accounts This snippet demonstrates how to add a bank account to a receiver using a cURL command. It requires the API endpoint URL, authorization token, content type, and a JSON payload containing the bank account details. Ensure to replace placeholder values with actual data. ```shell curl --url https://api.blindpay.com/v1/instances/in_000000000000/receivers/re_000000000000/bank-accounts \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "type": "transfers_bitso", "name": "Display Name", "beneficiary_name": "", "transfers_type": "", "transfers_account": "" }' ``` -------------------------------- ### Create Payin Quote Source: https://www.blindpay.com/docs/getting-started/quick-start-payin Generates a payin quote to determine the stablecoin amount received for a given fiat amount and payment method. Supports ACH payments and USDC stablecoin. Requires API key, instance ID, and the blockchain wallet ID. Allows for fee coverage. ```bash curl https://api.blindpay.com/v1/instances/in_000000000000/payin-quotes \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \ --data '{ \ "blockchain_wallet_id": "bw_000000000000", \ "currency_type": "sender", \ "cover_fees": true, \ "request_amount": 1000, \ "payment_method": "ach", \ "token": "USDC" \ }' ``` -------------------------------- ### Create a Receiver with BlindPay API Source: https://www.blindpay.com/docs/getting-started/quick-start Creates a new receiver entity within your BlindPay instance. This endpoint requires the `tos_id` obtained after accepting terms of service, along with receiver details such as email, tax ID, address, and identification documents. Development instances have automatic KYC approval. ```bash curl --request POST \ --url https://api.blindpay.com/v1/instances/in_000000000000/receivers \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "tos_id": "to_fuu6PrnGEHhl", "type": "individual", "kyc_type": "standard", "email": "email@example.com", "tax_id": "12345678", "address_line_1": "8 The Green", "address_line_2": "#12345", "city": "Dover", "state_province_region": "DE", "country": "US", "postal_code": "02050", "ip_address": "127.0.0.1", "phone_number": "+1234567890", "proof_of_address_doc_type": "UTILITY_BILL", "proof_of_address_doc_file": "https://pub-4fabf5dd55154f19a0384b16f2b816d9.r2.dev/v4-460px-Get-Proof-of-Address-Step-3-Version-2.jpg.jpeg", "first_name": "John", "last_name": "Doe", "date_of_birth": "1998-01-01T00:00:00Z", "id_doc_country": "US", "id_doc_type": "PASSPORT", "id_doc_front_file": "https://pub-4fabf5dd55154f19a0384b16f2b816d9.r2.dev/1000_F_365165797_VwQbNaD4yjWwQ6y1ENKh1xS0TXauOQvj.jpg", "selfie_file": "https://pub-4fabf5dd55154f19a0384b16f2b816d9.r2.dev/selfie.png" }' ```