### GET /plans Source: https://www.lava.so/v1/openapi List all plans for the authenticated merchant. Plans define pricing that can be assigned to customers. ```markdown ### Parameters - **cursor** (string, query, optional): Pagination cursor from a previous response - **limit** (integer, query, optional): Maximum number of results to return (1-100) ### Responses #### 200 - List of plans - **data** (array (SubscriptionConfig)) Array items: - **plan_id** (string) (required): Unique identifier for the plan - **merchant_id** (string) (required): Merchant ID that owns this plan - **name** (string) (required): Name of the plan - **period_amount** (string) (required): Period amount in USD (high precision decimal as string) - **included_credit** (string) (required): Included credit per billing cycle in USD (high precision decimal as string) - **billing_interval** (string (day|week|month|year)) (required): How often the subscription is billed ("day"|"week"|"month"|"year") - **rollover_type** (string (full|none)) (required): Cycle rollover: whether unused included credit rolls to next cycle ("full"|"none") - **bundle_rollover_type** (string (full|none)) (required): Bundle rollover: whether unused bundle credit rolls to next cycle ("full"|"none") - **default_auto_top_up_bundle_id** (string) (required): ID of the credit bundle that will be auto-purchased when a subscription cycle runs out of credit. Null if auto top-up is disabled. - **linked_meters** (array (object)) (required): Meters linked to this plan Array items: - **meter_id** (string) (required): Meter ID - **name** (string) (required): Meter name - **credit_bundles** (array (object)) (required): Credit bundles available for this plan Array items: - **credit_bundle_id** (string) (required): Credit bundle ID - **name** (string) (required): Credit bundle name - **cost** (string) (required): Cost of the bundle in USD - **credit_amount** (string) (required): Amount of credits in the bundle - **created_at** (string (date-time)) (required): When the plan was created - **has_more** (boolean) - **next_cursor** (string) #### 401 - Unauthorized **Error** - **error** (object) (required) - **message** (string) (required): Human-readable error message describing what went wrong (example: "Invalid authentication credentials") - **code** (string) (required): Machine-readable error code describing what went wrong (example: "forward_token_json_invalid") - **status** (integer) (required): HTTP status code of the error (example: 400) - **issues** (array (object)): Optional array of specific validation issues with their paths and messages (example: [{"path":["model"],"message":"Missing required field: model"},{"path":["messages","0","content"],"message":"Invalid message content format"}]) Array items: - **path** (array (string)) (required): Path to the field that caused the validation error - **message** (string) (required): Error message describing the validation issue ### Example Usage ```bash curl -X GET "https://api.lavapayments.com/v1//plans?cursor=string&limit=10" ``` ``` -------------------------------- ### GET /customers/{customer_id} Source: https://www.lava.so/v1/openapi Get a customer by ID ```markdown ### Parameters - **customer_id** (string, path, required): Customer ID ### Responses #### 200 - Customer details **Customer** - **customer_id** (string) (required): Unique identifier for the customer (example: "con_01KKMGDVD5CESK21E8Z1GF6MET") - **contact** (object) (required) - **phone** (string) (required): User's phone number in E.164 format (example: "+14155552671") - **email** (string) (required): User's email address (example: "user@example.com") - **first_name** (string) (required): User's first name (example: "Jane") - **last_name** (string) (required): User's last name (example: "Smith") - **subscription** (object) (required) - **subscription_id** (string) (required): Subscription ID - **plan_id** (string) (required): Plan ID - **name** (string) (required): Display name of the plan - **status** (string (active|cancelled)) (required): Subscription status ("active"|"cancelled") - **created_at** (string (date-time)) (required): ISO 8601 timestamp when the customer was created (example: "2023-05-15T08:35:42Z") #### 401 - Unauthorized **Error** - **error** (object) (required) - **message** (string) (required): Human-readable error message describing what went wrong (example: "Invalid authentication credentials") - **code** (string) (required): Machine-readable error code describing what went wrong (example: "forward_token_json_invalid") - **status** (integer) (required): HTTP status code of the error (example: 400) - **issues** (array (object)): Optional array of specific validation issues with their paths and messages (example: [{"path":["model"],"message":"Missing required field: model"},{"path":["messages","0","content"],"message":"Invalid message content format"}]) Array items: - **path** (array (string)) (required): Path to the field that caused the validation error - **message** (string) (required): Error message describing the validation issue #### 404 - Customer not found **Error** - **error** (object) (required) - **message** (string) (required): Human-readable error message describing what went wrong (example: "Invalid authentication credentials") - **code** (string) (required): Machine-readable error code describing what went wrong (example: "forward_token_json_invalid") - **status** (integer) (required): HTTP status code of the error (example: 400) - **issues** (array (object)): Optional array of specific validation issues with their paths and messages (example: [{"path":["model"],"message":"Missing required field: model"},{"path":["messages","0","content"],"message":"Invalid message content format"}]) Array items: - **path** (array (string)) (required): Path to the field that caused the validation error - **message** (string) (required): Error message describing the validation issue #### 500 - Internal server error **Error** - **error** (object) (required) - **message** (string) (required): Human-readable error message describing what went wrong (example: "Invalid authentication credentials") - **code** (string) (required): Machine-readable error code describing what went wrong (example: "forward_token_json_invalid") - **status** (integer) (required): HTTP status code of the error (example: 400) - **issues** (array (object)): Optional array of specific validation issues with their paths and messages (example: [{"path":["model"],"message":"Missing required field: model"},{"path":["messages","0","content"],"message":"Invalid message content format"}]) Array items: - **path** (array (string)) (required): Path to the field that caused the validation error - **message** (string) (required): Error message describing the validation issue ### Example Usage ```bash curl -X GET "https://api.lavapayments.com/v1//customers/{customer_id}" ``` ``` -------------------------------- ### GET /plans/{id} Source: https://www.lava.so/v1/openapi Get a specific plan by ID, including linked meters and credit bundles ```markdown ### Parameters - **id** (string, path, required): Plan ID ### Responses #### 200 - Plan details **SubscriptionConfig** - **plan_id** (string) (required): Unique identifier for the plan - **merchant_id** (string) (required): Merchant ID that owns this plan - **name** (string) (required): Name of the plan - **period_amount** (string) (required): Period amount in USD (high precision decimal as string) - **included_credit** (string) (required): Included credit per billing cycle in USD (high precision decimal as string) - **billing_interval** (string (day|week|month|year)) (required): How often the subscription is billed ("day"|"week"|"month"|"year") - **rollover_type** (string (full|none)) (required): Cycle rollover: whether unused included credit rolls to next cycle ("full"|"none") - **bundle_rollover_type** (string (full|none)) (required): Bundle rollover: whether unused bundle credit rolls to next cycle ("full"|"none") - **default_auto_top_up_bundle_id** (string) (required): ID of the credit bundle that will be auto-purchased when a subscription cycle runs out of credit. Null if auto top-up is disabled. - **linked_meters** (array (object)) (required): Meters linked to this plan Array items: - **meter_id** (string) (required): Meter ID - **name** (string) (required): Meter name - **credit_bundles** (array (object)) (required): Credit bundles available for this plan Array items: - **credit_bundle_id** (string) (required): Credit bundle ID - **name** (string) (required): Credit bundle name - **cost** (string) (required): Cost of the bundle in USD - **credit_amount** (string) (required): Amount of credits in the bundle - **created_at** (string (date-time)) (required): When the plan was created #### 401 - Unauthorized **Error** - **error** (object) (required) - **message** (string) (required): Human-readable error message describing what went wrong (example: "Invalid authentication credentials") - **code** (string) (required): Machine-readable error code describing what went wrong (example: "forward_token_json_invalid") - **status** (integer) (required): HTTP status code of the error (example: 400) - **issues** (array (object)): Optional array of specific validation issues with their paths and messages (example: [{"path":["model"],"message":"Missing required field: model"},{"path":["messages","0","content"],"message":"Invalid message content format"}]) Array items: - **path** (array (string)) (required): Path to the field that caused the validation error - **message** (string) (required): Error message describing the validation issue #### 404 - Plan not found **Error** - **error** (object) (required) - **message** (string) (required): Human-readable error message describing what went wrong (example: "Invalid authentication credentials") - **code** (string) (required): Machine-readable error code describing what went wrong (example: "forward_token_json_invalid") - **status** (integer) (required): HTTP status code of the error (example: 400) - **issues** (array (object)): Optional array of specific validation issues with their paths and messages (example: [{"path":["model"],"message":"Missing required field: model"},{"path":["messages","0","content"],"message":"Invalid message content format"}]) Array items: - **path** (array (string)) (required): Path to the field that caused the validation error - **message** (string) (required): Error message describing the validation issue ### Example Usage ```bash curl -X GET "https://api.lavapayments.com/v1//plans/{id}" ``` ``` -------------------------------- ### GET /wallet_keys Source: https://www.lava.so/v1/openapi List wallet keys for the authenticated wallet. Keys are returned with a masked preview. Requires a wallet API key (lava_wk_*). ```markdown ### Parameters - **cursor** (string, query, optional): Pagination cursor from a previous response - **limit** (integer, query, optional): Maximum number of results to return (1-100) ### Responses #### 200 - List of wallet keys - **data** (array (WalletKey)) Array items: - **wallet_key_id** (string) (required): Unique identifier for the wallet key - **key_preview** (string) (required): Masked key preview (e.g., lava_wk_a1b2c3d4****) - **name** (string) (required): Display name of the wallet key - **wallet_id** (string) (required): Wallet this key belongs to - **last_used_at** (string (date-time)): When the key was last used - **created_at** (string (date-time)) (required): When the wallet key was created - **has_more** (boolean) - **next_cursor** (string) #### 401 - Unauthorized **Error** - **error** (object) (required) - **message** (string) (required): Human-readable error message describing what went wrong (example: "Invalid authentication credentials") - **code** (string) (required): Machine-readable error code describing what went wrong (example: "forward_token_json_invalid") - **status** (integer) (required): HTTP status code of the error (example: 400) - **issues** (array (object)): Optional array of specific validation issues with their paths and messages (example: [{"path":["model"],"message":"Missing required field: model"},{"path":["messages","0","content"],"message":"Invalid message content format"}]) Array items: - **path** (array (string)) (required): Path to the field that caused the validation error - **message** (string) (required): Error message describing the validation issue ### Example Usage ```bash curl -X GET "https://api.lavapayments.com/v1//wallet_keys?cursor=string&limit=10" ``` ``` -------------------------------- ### GET /credit_bundles Source: https://www.lava.so/v1/openapi List all credit bundles for the authenticated merchant. Optionally filter by plan_id. ```markdown ### Parameters - **cursor** (string, query, optional): Pagination cursor from a previous response - **limit** (integer, query, optional): Maximum number of results to return (1-100) - **plan_id** (string, query, optional): Filter credit bundles by plan ID ### Responses #### 200 - List of credit bundles - **data** (array (CreditBundle)) Array items: - **credit_bundle_id** (string) (required): Unique identifier for the credit bundle - **plan_id** (string) (required): Plan this bundle belongs to - **name** (string) (required): Display name of the credit bundle - **cost** (string) (required): Price of the bundle in USD (high precision decimal as string) - **credit_amount** (string) (required): Amount of credits in the bundle (high precision decimal as string) - **created_at** (string (date-time)) (required): When the credit bundle was created - **has_more** (boolean) - **next_cursor** (string) #### 401 - Unauthorized **Error** - **error** (object) (required) - **message** (string) (required): Human-readable error message describing what went wrong (example: "Invalid authentication credentials") - **code** (string) (required): Machine-readable error code describing what went wrong (example: "forward_token_json_invalid") - **status** (integer) (required): HTTP status code of the error (example: 400) - **issues** (array (object)): Optional array of specific validation issues with their paths and messages (example: [{"path":["model"],"message":"Missing required field: model"},{"path":["messages","0","content"],"message":"Invalid message content format"}]) Array items: - **path** (array (string)) (required): Path to the field that caused the validation error - **message** (string) (required): Error message describing the validation issue ### Example Usage ```bash curl -X GET "https://api.lavapayments.com/v1//credit_bundles?cursor=string&limit=10&plan_id=string" ``` ``` -------------------------------- ### POST /checkout_sessions Source: https://www.lava.so/v1/openapi Create a new checkout session. Supports two modes: subscription (start a recurring plan) and credit_bundle (one-time credit pack purchase). Pass the returned checkout_session_token to the @lavapayments/checkout SDK to open the checkout flow. ```markdown ### Request Body **Content-Type:** application/json - **checkout_mode** (string (subscription|credit_bundle)) (required): Checkout mode: 'subscription' creates a recurring subscription checkout, 'credit_bundle' purchases a credit pack for an existing subscriber (example: "subscription") ("subscription"|"credit_bundle") - **origin_url** (string (uri)) (required): Origin url where the checkout will be opened (example: "https://your-app.example.com/") - **customer_id** (string): Required for credit_bundle mode. Optional for subscription mode — omit for new customers (checkout collects identity and creates a customer) or include for returning customers (reuses the existing customer). (example: "con_01KKMGDVD5Z10209TZPNCAA5R8") - **plan_id** (string): Required when checkout_mode is 'subscription' - identifies the plan to use (example: "sc_123") - **credit_bundle_id** (string): Required when checkout_mode is 'credit_bundle' - identifies the credit bundle to purchase (example: "cb_abc123") ### Responses #### 200 - Checkout session created **CheckoutSession** - **checkout_session_id** (string) (required): Unique identifier for the checkout session (example: "cs_01KKMGDVD484AV9GKV3DD05TQ8") - **checkout_session_token** (string) (required): Opaque token for the @lavapayments/checkout SDK. Pass this to open() to launch the checkout flow. (example: "eyJzZWNyZXQiOiJjc3NfbGl2ZV9sVzBfOENBZ1N2Mms2YWdHWC1MUGFSUWt1VGNBanNSaVZBX1dVNE9ybzdyNXBwUmwxVnNwQUxMIiwiYmFzZSI6Imh0dHBzOi8vd3d3LmxhdmEuc28vIn0=") - **checkout_mode** (string (subscription|credit_bundle)) (required): Checkout mode: 'subscription' creates a recurring subscription checkout, 'credit_bundle' purchases a credit pack for an existing subscriber (example: "subscription") ("subscription"|"credit_bundle") - **origin_url** (string) (required): Origin url where the checkout will be opened (example: "https://your-app.example.com/") - **customer_id** (string): Identifier for the customer (only available after checkout completion) (example: "con_01KKMGDVD4RERVDT6ERV9E7AC0") - **plan_id** (string): Identifier for the plan (only available for subscription mode) (example: "sc_123") - **created_at** (string (date-time)) (required): ISO 8601 timestamp when the checkout session was created (example: "2023-05-15T08:30:00Z") - **completed_at** (string (date-time)): If completed, ISO 8601 timestamp when the checkout was completed (example: "2023-05-15T08:35:42Z") #### 400 - Bad request **Error** - **error** (object) (required) - **message** (string) (required): Human-readable error message describing what went wrong (example: "Invalid authentication credentials") - **code** (string) (required): Machine-readable error code describing what went wrong (example: "forward_token_json_invalid") - **status** (integer) (required): HTTP status code of the error (example: 400) - **issues** (array (object)): Optional array of specific validation issues with their paths and messages (example: [{"path":["model"],"message":"Missing required field: model"},{"path":["messages","0","content"],"message":"Invalid message content format"}]) Array items: - **path** (array (string)) (required): Path to the field that caused the validation error - **message** (string) (required): Error message describing the validation issue #### 401 - Unauthorized **Error** - **error** (object) (required) - **message** (string) (required): Human-readable error message describing what went wrong (example: "Invalid authentication credentials") - **code** (string) (required): Machine-readable error code describing what went wrong (example: "forward_token_json_invalid") - **status** (integer) (required): HTTP status code of the error (example: 400) - **issues** (array (object)): Optional array of specific validation issues with their paths and messages (example: [{"path":["model"],"message":"Missing required field: model"},{"path":["messages","0","content"],"message":"Invalid message content format"}]) Array items: - **path** (array (string)) (required): Path to the field that caused the validation error - **message** (string) (required): Error message describing the validation issue #### 500 - Internal server error **Error** - **error** (object) (required) - **message** (string) (required): Human-readable error message describing what went wrong (example: "Invalid authentication credentials") - **code** (string) (required): Machine-readable error code describing what went wrong (example: "forward_token_json_invalid") - **status** (integer) (required): HTTP status code of the error (example: 400) - **issues** (array (object)): Optional array of specific validation issues with their paths and messages (example: [{"path":["model"],"message":"Missing required field: model"},{"path":["messages","0","content"],"message":"Invalid message content format"}]) Array items: - **path** (array (string)) (required): Path to the field that caused the validation error - **message** (string) (required): Error message describing the validation issue ### Example Usage ```bash curl -X POST "https://api.lavapayments.com/v1//checkout_sessions" \ -H "Content-Type: application/json" \ -d '{ "checkout_mode": "subscription", "origin_url": "https://your-app.example.com/", "customer_id": "con_01KKMGDVD5Z10209TZPNCAA5R8", "plan_id": "sc_123", "credit_bundle_id": "cb_abc123" }' ``` ``` -------------------------------- ### GET /models Source: https://www.lava.so/v1/openapi Returns a list of available AI models in OpenAI-compatible format. When authenticated with a spend key, results are filtered by the key's allowed models and providers. No authentication is required, but authenticated requests may return filtered results. ```markdown ### Responses #### 200 - List of available models - **object** (string (list)) ("list") - **data** (array (Model)) Array items: - **id** (string) (required): Model identifier (e.g., gpt-4o, claude-sonnet-4-6) - **object** (string (model)) (required): Object type, always 'model' ("model") - **created** (integer) (required): Unix timestamp of when the model was registered - **owned_by** (string) (required): Provider that owns this model (e.g., openai, anthropic) ### Example Usage ```bash curl -X GET "https://api.lavapayments.com/v1//models" ``` ``` -------------------------------- ### GET /subscriptions Source: https://www.lava.so/v1/openapi List all subscriptions for the authenticated merchant. Filter by status (active, cancelled, or all) and customer_id. ```markdown ### Parameters - **status** (string (active|cancelled|all), query, optional): Filter by subscription status (default: active) - **customer_id** (string, query, optional): Filter by customer ID - **cursor** (string, query, optional): Pagination cursor from a previous response - **limit** (integer, query, optional): Maximum number of results to return (1-100) ### Responses #### 200 - List of subscriptions - **data** (array (Subscription)) (required) Array items: - **subscription_id** (string) (required): Unique identifier for the subscription - **plan_id** (string) (required): Plan ID - **customer_id** (string) (required): Customer ID this subscription belongs to - **status** (string (active|cancelled)) (required): Subscription status ("active"|"cancelled") - **auto_top_up_bundle_id** (string) (required): ID of the credit bundle that will be auto-purchased when subscription credit runs out. Null if auto top-up is disabled. - **started_at** (string (date-time)) (required): When the subscription started - **cancelled_at** (string (date-time)) (required): When the subscription was cancelled, or null - **cycle_start_at** (string (date-time)) (required): Current billing cycle start date - **cycle_end_at** (string (date-time)) (required): Current billing cycle end date - **plan** (object) (required) - **name** (string) (required): Plan name - **period_amount** (string) (required): Plan cost per billing cycle in USD - **included_credit** (string) (required): Credits included per billing cycle in USD - **billing_interval** (string (day|week|month|year)) (required): How often the subscription is billed ("day"|"week"|"month"|"year") - **rollover_type** (string (full|none)) (required): Whether unused included credit rolls over ("full"|"none") - **bundle_rollover_type** (string (full|none)) (required): Whether unused bundle credit rolls over ("full"|"none") - **credits** (object) (required) - **total_remaining** (string) (required): Total remaining credits in USD - **cycle_remaining** (string) (required): Remaining cycle credits in USD - **bundle_remaining** (string) (required): Remaining bundle credits in USD - **pending_change** (object) (required): Scheduled change at end of current billing cycle - **type** (string (cancellation|downgrade)) (required): Type of pending change ("cancellation"|"downgrade") - **effective_at** (string (date-time)) (required): When the change will take effect (cycle end date) - **plan_id** (string): Target plan ID (downgrade only) - **name** (string): Target plan name (downgrade only) - **period_amount** (string): Target plan cost per cycle in USD (downgrade only) - **included_credit** (string): Target plan included credits per cycle in USD (downgrade only) - **customer** (object) (required) - **phone** (string) (required): Customer phone number - **email** (string): Customer email - **first_name** (string): Customer first name - **last_name** (string): Customer last name - **has_more** (boolean) (required) - **next_cursor** (string) #### 401 - Unauthorized **Error** - **error** (object) (required) - **message** (string) (required): Human-readable error message describing what went wrong (example: "Invalid authentication credentials") - **code** (string) (required): Machine-readable error code describing what went wrong (example: "forward_token_json_invalid") - **status** (integer) (required): HTTP status code of the error (example: 400) - **issues** (array (object)): Optional array of specific validation issues with their paths and messages (example: [{"path":["model"],"message":"Missing required field: model"},{"path":["messages","0","content"],"message":"Invalid message content format"}]) Array items: - **path** (array (string)) (required): Path to the field that caused the validation error - **message** (string) (required): Error message describing the validation issue ### Example Usage ```bash curl -X GET "https://api.lavapayments.com/v1//subscriptions?status=active&customer_id=string&cursor=string&limit=10" ``` ``` -------------------------------- ### GET /webhooks Source: https://www.lava.so/v1/openapi List all webhooks for the authenticated merchant. ```markdown ### Parameters - **cursor** (string, query, optional): Pagination cursor from a previous response - **limit** (integer, query, optional): Maximum number of results to return (1-100) ### Responses #### 200 - List of webhooks - **data** (array (Webhook)) Array items: - **webhook_id** (string) (required): Unique identifier for the webhook - **name** (string) (required): Display name of the webhook - **url** (string) (required): URL that receives webhook events - **created_at** (string (date-time)) (required): When the webhook was created - **has_more** (boolean) - **next_cursor** (string) #### 401 - Unauthorized **Error** - **error** (object) (required) - **message** (string) (required): Human-readable error message describing what went wrong (example: "Invalid authentication credentials") - **code** (string) (required): Machine-readable error code describing what went wrong (example: "forward_token_json_invalid") - **status** (integer) (required): HTTP status code of the error (example: 400) - **issues** (array (object)): Optional array of specific validation issues with their paths and messages (example: [{"path":["model"],"message":"Missing required field: model"},{"path":["messages","0","content"],"message":"Invalid message content format"}]) Array items: - **path** (array (string)) (required): Path to the field that caused the validation error - **message** (string) (required): Error message describing the validation issue ### Example Usage ```bash curl -X GET "https://api.lavapayments.com/v1//webhooks?cursor=string&limit=10" ``` ``` -------------------------------- ### GET /customers/{customer_id}/subscription Source: https://www.lava.so/v1/openapi Returns the active subscription for a customer, including plan details, current cycle credits, and any pending changes (cancellation or downgrade). Use this to show subscription status and remaining credits. ```markdown ### Parameters - **customer_id** (string, path, required): Customer ID ### Responses #### 200 - Customer subscription details **CustomerSubscription** - **subscription** (object) (required): Active subscription details for a customer - **subscription_id** (string) (required): Subscription ID - **plan_id** (string) (required): Plan ID - **name** (string) (required): Display name of the plan - **status** (string (active|cancelled)) (required): Subscription status ("active"|"cancelled") - **billing_interval** (string (day|week|month|year)) (required): How often the subscription is billed ("day"|"week"|"month"|"year") - **period_amount** (string) (required): Plan cost per billing cycle in USD - **included_credit** (string) (required): Credits included per billing cycle in USD - **cycle_start_at** (string (date-time)) (required): Current billing cycle start date - **cycle_end_at** (string (date-time)) (required): Current billing cycle end date - **credits** (object) (required): Subscription credit balances for the current cycle - **total_remaining** (string) (required): Total remaining credits (cycle + bundle) in USD with 12 decimal precision - **cycle_remaining** (string) (required): Credits remaining from plan inclusion in USD with 12 decimal precision - **bundle_remaining** (string) (required): Credits remaining from purchased bundles in USD with 12 decimal precision - **cycle_rollover** (string (full|none)) (required): Whether unused cycle credits roll over to the next cycle ("full"|"none") - **bundle_rollover** (string (full|none)) (required): Whether unused bundle credits roll over to the next cycle ("full"|"none") - **pending_change** (object) (required): Scheduled change at end of current billing cycle - **type** (string (cancellation|downgrade)) (required): Type of pending change ("cancellation"|"downgrade") - **effective_at** (string (date-time)) (required): When the change will take effect (cycle end date) - **plan_id** (string): Target plan ID (downgrade only) - **name** (string): Target plan name (downgrade only) - **period_amount** (string): Target plan cost per cycle in USD (downgrade only) - **included_credit** (string): Target plan included credits per cycle in USD (downgrade only) #### 401 - Unauthorized **Error** - **error** (object) (required) - **message** (string) (required): Human-readable error message describing what went wrong (example: "Invalid authentication credentials") - **code** (string) (required): Machine-readable error code describing what went wrong (example: "forward_token_json_invalid") - **status** (integer) (required): HTTP status code of the error (example: 400) - **issues** (array (object)): Optional array of specific validation issues with their paths and messages (example: [{"path":["model"],"message":"Missing required field: model"},{"path":["messages","0","content"],"message":"Invalid message content format"}]) Array items: - **path** (array (string)) (required): Path to the field that caused the validation error - **message** (string) (required): Error message describing the validation issue #### 404 - Customer not found **Error** - **error** (object) (required) - **message** (string) (required): Human-readable error message describing what went wrong (example: "Invalid authentication credentials") - **code** (string) (required): Machine-readable error code describing what went wrong (example: "forward_token_json_invalid") - **status** (integer) (required): HTTP status code of the error (example: 400) - **issues** (array (object)): Optional array of specific validation issues with their paths and messages (example: [{"path":["model"],"message":"Missing required field: model"},{"path":["messages","0","content"],"message":"Invalid message content format"}]) Array items: - **path** (array (string)) (required): Path to the field that caused the validation error - **message** (string) (required): Error message describing the validation issue #### 500 - Internal server error **Error** - **error** (object) (required) - **message** (string) (required): Human-readable error message describing what went wrong (example: "Invalid authentication credentials") - **code** (string) (required): Machine-readable error code describing what went wrong (example: "forward_token_json_invalid") - **status** (integer) (required): HTTP status code of the error (example: 400) - **issues** (array (object)): Optional array of specific validation issues with their paths and messages (example: [{"path":["model"],"message":"Missing required field: model"},{"path":["messages","0","content"],"message":"Invalid message content format"}]) Array items: - **path** (array (string)) (required): Path to the field that caused the validation error - **message** (string) (required): Error message describing the validation issue ### Example Usage ```bash curl -X GET "https://api.lavapayments.com/v1//customers/{customer_id}/subscription" ``` ``` -------------------------------- ### GET /customers Source: https://www.lava.so/v1/openapi List all customers for the authenticated merchant with pagination support and optional filtering ```markdown ### Parameters - **cursor** (string, query, optional): Pagination cursor from a previous response - **limit** (integer, query, optional): Maximum number of results to return (1-100) ### Responses #### 200 - List of customers - **data** (array (Customer)) Array items: - **customer_id** (string) (required): Unique identifier for the customer (example: "con_01KKMGDVD5CESK21E8Z1GF6MET") - **contact** (object) (required) - **phone** (string) (required): User's phone number in E.164 format (example: "+14155552671") - **email** (string) (required): User's email address (example: "user@example.com") - **first_name** (string) (required): User's first name (example: "Jane") - **last_name** (string) (required): User's last name (example: "Smith") - **subscription** (object) (required) - **subscription_id** (string) (required): Subscription ID - **plan_id** (string) (required): Plan ID - **name** (string) (required): Display name of the plan - **status** (string (active|cancelled)) (required): Subscription status ("active"|"cancelled") - **created_at** (string (date-time)) (required): ISO 8601 timestamp when the customer was created (example: "2023-05-15T08:35:42Z") - **has_more** (boolean) - **next_cursor** (string) #### 400 - Bad request **Error** - **error** (object) (required) - **message** (string) (required): Human-readable error message describing what went wrong (example: "Invalid authentication credentials") - **code** (string) (required): Machine-readable error code describing what went wrong (example: "forward_token_json_invalid") - **status** (integer) (required): HTTP status code of the error (example: 400) - **issues** (array (object)): Optional array of specific validation issues with their paths and messages (example: [{"path":["model"],"message":"Missing required field: model"},{"path":["messages","0","content"],"message":"Invalid message content format"}]) Array items: - **path** (array (string)) (required): Path to the field that caused the validation error - **message** (string) (required): Error message describing the validation issue #### 401 - Unauthorized **Error** - **error** (object) (required) - **message** (string) (required): Human-readable error message describing what went wrong (example: "Invalid authentication credentials") - **code** (string) (required): Machine-readable error code describing what went wrong (example: "forward_token_json_invalid") - **status** (integer) (required): HTTP status code of the error (example: 400) - **issues** (array (object)): Optional array of specific validation issues with their paths and messages (example: [{"path":["model"],"message":"Missing required field: model"},{"path":["messages","0","content"],"message":"Invalid message content format"}]) Array items: - **path** (array (string)) (required): Path to the field that caused the validation error - **message** (string) (required): Error message describing the validation issue #### 500 - Internal server error **Error** - **error** (object) (required) - **message** (string) (required): Human-readable error message describing what went wrong (example: "Invalid authentication credentials") - **code** (string) (required): Machine-readable error code describing what went wrong (example: "forward_token_json_invalid") - **status** (integer) (required): HTTP status code of the error (example: 400) - **issues** (array (object)): Optional array of specific validation issues with their paths and messages (example: [{"path":["model"],"message":"Missing required field: model"},{"path":["messages","0","content"],"message":"Invalid message content format"}]) Array items: - **path** (array (string)) (required): Path to the field that caused the validation error - **message** (string) (required): Error message describing the validation issue ### Example Usage ```bash curl -X GET "https://api.lavapayments.com/v1//customers?cursor=string&limit=10" ``` ```