### Balance Response Example Source: https://www.qvapay.com/docs/merchants/balance This is an example of a successful JSON response when querying the balance. It includes the current balance in USD. ```json { "balance": 150.75 } ``` -------------------------------- ### Get Application Info using cURL Source: https://www.qvapay.com/docs/merchants/info Use this cURL command to retrieve information about your registered QvaPay application. Ensure your app-id and app-secret are correctly provided in the headers. ```bash curl -X POST https://api.qvapay.com/v2/info \ -H "Content-Type: application/json" \ -H "app-id: {tu-app-uuid}" \ -H "app-secret: {tu-app-secret}" ``` -------------------------------- ### QvaPay Application Info Response Source: https://www.qvapay.com/docs/merchants/info This is an example of the JSON response received when querying the /v2/info endpoint. It includes details such as the app's UUID, name, URLs, and status. ```json { "uuid": "550e8400-e29b-41d4-a716-446655440000", "name": "Mi Tienda", "url": "https://mitienda.com", "desc": "Tienda de productos digitales", "callback": "https://mitienda.com/webhook", "success_url": "https://mitienda.com/success", "cancel_url": "https://mitienda.com/cancel", "logo": "apps/logo.png", "active": true, "enabled": true, "card": false, "created_at": "2024-01-15T10:30:00.000Z", "updated_at": "2024-06-20T14:00:00.000Z", "app_photo_url": "https://media.qvapay.com/apps/logo.png" } ``` -------------------------------- ### POST /v2/info Source: https://www.qvapay.com/docs/merchants/info Retrieves information about your registered application in QvaPay, useful for verifying credentials and checking current configuration. ```APIDOC ## POST /v2/info ### Description Retorna la información de tu aplicación registrada en QvaPay. Es útil para verificar que tus credenciales funcionan correctamente y consultar la configuración actual de tu app. ### Method POST ### Endpoint https://api.qvapay.com/v2/info ### Parameters #### Request Headers - **app-id** (string) - Required - Your application UUID - **app-secret** (string) - Required - Your application secret ### Request Example curl -X POST https://api.qvapay.com/v2/info \ -H "Content-Type: application/json" \ -H "app-id: {tu-app-uuid}" \ -H "app-secret: {tu-app-secret}" ### Response #### Success Response (200) - **uuid** (string) - Identificador único de la app - **name** (string) - Nombre de la app - **url** (string) - URL del sitio web - **desc** (string) - Descripción de la app - **callback** (string) - URL de webhook para notificaciones - **success_url** (string) - URL de redirección tras pago exitoso - **cancel_url** (string) - URL de redirección tras cancelación - **logo** (string) - Ruta del logo - **active** (boolean) - Si la app está activa - **enabled** (boolean) - Si la app está habilitada - **card** (boolean) - Si tiene feature de tarjeta habilitado - **app_photo_url** (string) - URL completa del logo #### Response Example { "uuid": "550e8400-e29b-41d4-a716-446655440000", "name": "Mi Tienda", "url": "https://mitienda.com", "desc": "Tienda de productos digitales", "callback": "https://mitienda.com/webhook", "success_url": "https://mitienda.com/success", "cancel_url": "https://mitienda.com/cancel", "logo": "apps/logo.png", "active": true, "enabled": true, "card": false, "created_at": "2024-01-15T10:30:00.000Z", "updated_at": "2024-06-20T14:00:00.000Z", "app_photo_url": "https://media.qvapay.com/apps/logo.png" } ``` -------------------------------- ### Consult Balance with cURL Source: https://www.qvapay.com/docs/merchants/balance Use this cURL command to make a POST request to the /v2/balance endpoint. Ensure you replace placeholders with your actual app-id and app-secret for authentication. ```bash curl -X POST https://api.qvapay.com/v2/balance \ -H "Content-Type: application/json" \ -H "app-id: {tu-app-uuid}" \ -H "app-secret: {tu-app-secret}" ``` -------------------------------- ### User Login Request Body Source: https://www.qvapay.com/docs/auth/login Send email and password for initial authentication. Include 'two_factor_code' for the second step if required. ```json { "email": "usuario@ejemplo.com", "password": "contraseña123", "remember": true, "two_factor_code": "1234" } ``` -------------------------------- ### POST /auth/login Source: https://www.qvapay.com/docs/auth/login Authenticates a user with email and password, supporting 2FA via PIN or OTP. ```APIDOC ## POST /auth/login ### Description Authenticates a user with email and password. The process requires two-factor authentication (2FA) via PIN or OTP code. If OTP is active, the PIN will not be functional for this endpoint. ### Method POST ### Endpoint /auth/login ### Parameters #### Request Body - **email** (string) - Required - Email of the user - **password** (string) - Required - Password of the user - **remember** (boolean) - Optional - Keep session active for 180 days (default 2 hours) - **two_factor_code** (string) - Optional - 2FA code: 4-digit PIN or 6-digit OTP code ### Request Example { "email": "usuario@ejemplo.com", "password": "contraseña123", "remember": true, "two_factor_code": "1234" } ### Response #### Success Response (200) - **accessToken** (string) - Bearer token for authenticated requests - **token_type** (string) - Type of token (Bearer) - **me** (object) - Authenticated user data #### Response Example (202 - 2FA Required) { "info": "Código 2FA requerido", "notified": false, "has_otp": true } #### Response Example (200 - Success) { "accessToken": "203955|abc123...", "token_type": "Bearer", "me": { "uuid": "550e8400-e29b-41d4-a716-446655440000", "email": "usuario@ejemplo.com", "name": "Juan", "username": "juan123", "balance": "150.75" } } ``` -------------------------------- ### POST /v2/create_invoice Source: https://www.qvapay.com/docs/merchants/create-invoice Creates a payment invoice for a user to pay. The invoice is created with a 'pending' status and generates a payment URL. ```APIDOC ## POST /v2/create_invoice ### Description Creates a new payment invoice. The invoice is created with a `pending` status and generates a payment URL that you can share with your customer. ### Method POST ### Endpoint /v2/create_invoice ### Parameters #### Request Body - **amount** (number) - Required - The amount to charge (greater than 0, maximum 100,000) - **description** (string) - Required - Description of the payment (1-255 characters) - **remote_id** (string) - Required - External identifier from your system (1-255 characters) - **webhook** (string) - Optional - URL for payment notifications (must be a valid URL) - **products** (array) - Optional - List of included products - **products[].name** (string) - Required - Product name - **products[].price** (number) - Required - Product price - **products[].quantity** (number) - Optional - Quantity (defaults to 1) - **expire_at** (string) - Optional - Expiration date in ISO 8601 format (must be in the future) ### Request Example ```json { "amount": 25.00, "description": "Compra de producto digital", "remote_id": "order-12345", "webhook": "https://mitienda.com/webhook/qvapay", "products": [ { "name": "Producto 1", "price": 15.00, "quantity": 1 }, { "name": "Producto 2", "price": 10.00, "quantity": 1 } ], "expire_at": "2024-12-31T23:59:59.000Z" } ``` ### Response #### Success Response (200) - **app_id** (string) - UUID of your app - **amount** (number) - Invoice amount - **description** (string) - Payment description - **remote_id** (string) - Your external identifier - **transaction_uuid** (string) - Transaction UUID in QvaPay - **expire_at** (string | null) - Expiration date - **url** (string) - Payment URL to share with the customer #### Response Example ```json { "app_id": "550e8400-e29b-41d4-a716-446655440000", "amount": 25.00, "description": "Compra de producto digital", "remote_id": "order-12345", "transaction_uuid": "7c9e6679-7425-40de-944b-e07fc1f90ae7", "expire_at": "2024-12-31T23:59:59.000Z", "url": "https://www.qvapay.com/pay/7c9e6679-7425-40de-944b-e07fc1f90ae7" } ``` ### Errors - **400**: Invalid request data (amount, description, etc.) ``` -------------------------------- ### Successful Login Response Source: https://www.qvapay.com/docs/auth/login Upon successful authentication, the API returns an access token and user details. ```json { "accessToken": "203955|abc123...", "token_type": "Bearer", "me": { "uuid": "550e8400-e29b-41d4-a716-446655440000", "email": "usuario@ejemplo.com", "name": "Juan", "username": "juan123", "balance": "150.75" } } ``` -------------------------------- ### Create Invoice Request and Response Source: https://www.qvapay.com/docs/merchants/create-invoice The request body requires payment details and optional product lists. The response returns the transaction UUID and the payment URL. ```json { "amount": 25.00, "description": "Compra de producto digital", "remote_id": "order-12345", "webhook": "https://mitienda.com/webhook/qvapay", "products": [ { "name": "Producto 1", "price": 15.00, "quantity": 1 }, { "name": "Producto 2", "price": 10.00, "quantity": 1 } ], "expire_at": "2024-12-31T23:59:59.000Z" } ``` ```json { "app_id": "550e8400-e29b-41d4-a716-446655440000", "amount": 25.00, "description": "Compra de producto digital", "remote_id": "order-12345", "transaction_uuid": "7c9e6679-7425-40de-944b-e07fc1f90ae7", "expire_at": "2024-12-31T23:59:59.000Z", "url": "https://www.qvapay.com/pay/7c9e6679-7425-40de-944b-e07fc1f90ae7" } ``` -------------------------------- ### POST /v2/balance Source: https://www.qvapay.com/docs/merchants/balance Retrieves the current balance of the application owner. ```APIDOC ## POST /v2/balance ### Description Retorna el balance actual del propietario de la aplicación. ### Method POST ### Endpoint https://api.qvapay.com/v2/balance ### Parameters #### Request Headers - **app-id** (string) - Required - Application UUID - **app-secret** (string) - Required - Application Secret ### Request Example curl -X POST https://api.qvapay.com/v2/balance \ -H "Content-Type: application/json" \ -H "app-id: {tu-app-uuid}" \ -H "app-secret: {tu-app-secret}" ### Response #### Success Response (200) - **balance** (number) - Balance actual en USD #### Response Example { "balance": 150.75 } ### Errors - **404** - Usuario propietario no encontrado ``` -------------------------------- ### 2FA Required Response Source: https://www.qvapay.com/docs/auth/login This response indicates that a two-factor authentication code is needed to complete the login process. ```json { "info": "Código 2FA requerido", "notified": false, "has_otp": true } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.