### PayWithMoon API Reference Sections Source: https://docs.paywithmoon.com/reference/post_v1-api-gateway-card-card-id-assign-cardholder-1 Overview of key API functionalities and integration guides available in the PayWithMoon API reference. This includes sections on getting started, authentication, card management, transaction handling, and webhooks. ```APIDOC Getting Started: - Introduction - Authentication - Issuing Your First Card - Adding a Balance - Simulating Card Transactions - Fetching Card Transactions - Webhooks - Moon JIT API Integration Guide API Endpoint: - Assign a Cardholder to a Card (POST /v1/api/gateway/card/{card_id}/assign-cardholder) ``` -------------------------------- ### Related API Endpoints Source: https://docs.paywithmoon.com/reference/invoices-2 Links to other relevant API documentation sections, including guides for getting started, authentication, card management, and invoice generation. ```APIDOC Related API Endpoints: - Assign a cardholder to a card: https://docs.paywithmoon.com/reference/patch_cards-card-id-assign-cardholder - Generate an Invoice: https://docs.paywithmoon.com/reference/post_invoices-1 - Getting Started: https://docs.paywithmoon.com/reference/getting-started-with-your-api - Introduction: https://docs.paywithmoon.com/reference/introduction - Authentication: https://docs.paywithmoon.com/reference/authentication - Webhooks: https://docs.paywithmoon.com/reference/webhooks - Moon JIT API Integration Guide: https://docs.paywithmoon.com/reference/moon-jit-api-integration-guide - Moon Card Issuing API V1 (Gift Cards, Cards, etc.): https://docs.paywithmoon.com/reference/gift-cards, https://docs.paywithmoon.com/reference/cards-3 ``` -------------------------------- ### Related API Endpoints Source: https://docs.paywithmoon.com/reference/get_invoices-1 Links to other relevant API documentation sections, including guides for getting started, authentication, card management, and invoice generation. ```APIDOC Related API Endpoints: - Assign a cardholder to a card: https://docs.paywithmoon.com/reference/patch_cards-card-id-assign-cardholder - Generate an Invoice: https://docs.paywithmoon.com/reference/post_invoices-1 - Getting Started: https://docs.paywithmoon.com/reference/getting-started-with-your-api - Introduction: https://docs.paywithmoon.com/reference/introduction - Authentication: https://docs.paywithmoon.com/reference/authentication - Webhooks: https://docs.paywithmoon.com/reference/webhooks - Moon JIT API Integration Guide: https://docs.paywithmoon.com/reference/moon-jit-api-integration-guide - Moon Card Issuing API V1 (Gift Cards, Cards, etc.): https://docs.paywithmoon.com/reference/gift-cards, https://docs.paywithmoon.com/reference/cards-3 ``` -------------------------------- ### Fetch Gift Card Products cURL Example Source: https://docs.paywithmoon.com/reference/get_v1-api-gateway-gift-card-card-products Example cURL request to fetch gift card products. ```shell curl --request GET \ --url 'https://stagingapi.paywithmoon.com/v1/api-gateway/gift-card/card-products?perPage=10' \ --header 'accept: application/json' ``` -------------------------------- ### Fetch a Gift Card Example Source: https://docs.paywithmoon.com/reference/get_v1-api-gateway-gift-card-gift-card-id Provides a cURL command to fetch a specific gift card using its ID. This example demonstrates the GET request method, URL structure, and necessary headers for making the API call. ```curl curl --request GET \ --url https://stagingapi.paywithmoon.com/v1/api-gateway/gift-card/gift_card_id \ --header 'accept: application/json' ``` -------------------------------- ### Activate a Card Example Source: https://docs.paywithmoon.com/reference/post_v1-api-gateway-card-card-id-activate-1 Example of activating a card using the PayWithMoon API. This includes the HTTP method, URL, path parameters, and required headers. ```APIDOC Activate a Card: POST https://stagingapi.paywithmoon.com/v1/api-gateway/card/{card_id}/activate Description: Activates a card. Parameters: Path Params: - card_id (string, required): The unique identifier of the card to activate. Headers: - x-api-key (string, required): Your API key for authentication. ``` -------------------------------- ### PayWithMoon API Navigation Source: https://docs.paywithmoon.com/reference/getvelocitycontrolbyid-1 Links to various sections of the PayWithMoon API documentation, covering core functionalities like getting started, authentication, cards, webhooks, and invoices. ```APIDOC API Sections: Getting Started: - Introduction - Authentication - Issuing Your First Card - Adding a Balance - Simulating Card Transactions - Fetching Card Transactions - Webhooks - Moon JIT API Integration Guide Moon Card Issuing API V1: - Gift Cards (Purchase, Mark as Used/Unused, Fetch) - Cards (Assign Cardholder, Activate, Fetch Products, Simulate Transaction, Get Transactions, Freeze/Unfreeze, Add Balance, Fetch, Create, List, Update PIN, Get PIN) - Webhooks (Delete, Register) - Invoices (Simulate Payment, Generate, Get paginated on-chain invoices) - Moon Reserve (Fetch Moon Reserve Balance) ``` -------------------------------- ### Card Activation cURL Example Source: https://docs.paywithmoon.com/reference/post_v1-api-gateway-card-card-id-activate-1 Example cURL command to activate a card, demonstrating the POST request method, URL, and required headers. ```curl curl --request POST \ --url https://stagingapi.paywithmoon.com/v1/api-gateway/card/card_id/activate \ --header 'accept: application/json' ``` -------------------------------- ### Create Account Request Example Source: https://docs.paywithmoon.com/reference/post_accounts-1 Example cURL request for creating a new account via the API. Specifies the HTTP method, URL, and required headers. ```APIDOC POST /v2/api-gateway/accounts Request: Headers: accept: application/json content-type: application/json Example: curl --request POST \ --url http://localhost:3000/v2/api-gateway/accounts \ --header 'accept: application/json' \ --header 'content-type: application/json' ``` -------------------------------- ### Fetch a Card Example Source: https://docs.paywithmoon.com/reference/get_v1-api-gateway-card-card-id Example of how to fetch a card using its ID via the API. This includes the HTTP method, URL, and a description of the response. ```APIDOC GET https://stagingapi.paywithmoon.com/v1/api-gateway/card/{card_id} - Returns the card with the specified card ID. Path Params: card_id (string, required): The ID of the card to fetch. Headers: x-api-key (string, required): Your API key for authentication. ``` -------------------------------- ### Fetch Card Transactions cURL Example Source: https://docs.paywithmoon.com/reference/get_v1-api-gateway-card-card-id-transactions Example cURL command to fetch card transactions with pagination. ```shell curl --request GET \ --url 'https://stagingapi.paywithmoon.com/v1/api-gateway/card/card_id/transactions?perPage=10' \ --header 'accept: application/json' ``` -------------------------------- ### PayWithMoon API - Card Creation cURL Example Source: https://docs.paywithmoon.com/reference/post_cards-1 Example cURL request for creating a virtual card using the PayWithMoon API. ```curl curl --request POST \ --url http://localhost:3000/v2/api-gateway/cards \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --data '{ "card_type": "VIRTUAL" }' ``` -------------------------------- ### Create On-Chain Invoice (cURL Example) Source: https://docs.paywithmoon.com/reference/post_v1-api-gateway-onchain-invoice Example cURL request for creating or interacting with an on-chain invoice endpoint. Note: The request body is not provided in the example. ```curl curl --request POST \ --url https://stagingapi.paywithmoon.com/v1/api-gateway/onchain/invoice \ --header 'accept: application/json' \ --header 'content-type: application/json' ``` -------------------------------- ### Webhooks API Endpoint Example Source: https://docs.paywithmoon.com/reference/webhooks-3 Demonstrates how to make a POST request to the webhooks endpoint to register a webhook URL. This example uses cURL and specifies JSON content type and acceptance. ```shell curl --request POST \ --url http://localhost:3000/v2/api-gateway/webhooks \ --header 'accept: application/json' \ --header 'content-type: application/json' ``` -------------------------------- ### Webhooks API Endpoint Example Source: https://docs.paywithmoon.com/reference/post_webhooks-1 Demonstrates how to make a POST request to the webhooks endpoint to register a webhook URL. This example uses cURL and specifies JSON content type and acceptance. ```shell curl --request POST \ --url http://localhost:3000/v2/api-gateway/webhooks \ --header 'accept: application/json' \ --header 'content-type: application/json' ``` -------------------------------- ### Get All Gift Card Products Source: https://docs.paywithmoon.com/reference/get_v1-api-gateway-card-card-products Retrieves a list of available gift card products. Supports pagination via query parameters. ```curl curl --request GET \ --url 'https://stagingapi.paywithmoon.com/v1/api-gateway/card/card-products?perPage=10' \ --header 'accept: application/json' ``` -------------------------------- ### Moon JIT API Integration Guide Source: https://docs.paywithmoon.com/reference/moon-jit-api-integration-guide Guidance for integrating with the Moon JIT API, covering authorization, steps, best practices, and error handling. ```APIDOC Integration Guide: Moon JIT API Sections: - What is JIT Authorization? - Integration Steps - Best Practices - Troubleshooting - Error Handling - Card Validation Responsibilities - Additional Notes - Support Contact: support@paywithmoon.com for questions or issues with JIT integration. ``` -------------------------------- ### Fetch Available Card Products (cURL) Source: https://docs.paywithmoon.com/reference/getting-started-with-your-api Retrieves a paginated list of available card products that can be issued. This is a prerequisite step before issuing a card, allowing you to select a product based on its ID, name, and value limits. Requires an API key for authentication. ```curl curl --request GET \ --url 'https://stagingapi.paywithmoon.com/v1/api-gateway/card/card-products?perPage=10' \ --header 'accept: application/json' \ --header 'x-api-key: YOUR_API_KEY' ``` -------------------------------- ### Get Main Organization Example Source: https://docs.paywithmoon.com/reference/get_organizations-main-1 Example of how to retrieve the main organization for the API user. ```APIDOC GET http://localhost:3000/v2/api-gateway/organizations/main Description: Retrieves the primary organization associated with the current API user. Example Response (Conceptual): { "id": "org_12345", "name": "Main Organization", "createdAt": "2023-01-01T10:00:00Z" } ``` -------------------------------- ### cURL Request Example Source: https://docs.paywithmoon.com/reference/get_v1-api-gateway-controls-velocity-card-card-id-status-1 An example of how to make a GET request to the velocity control status endpoint using cURL. ```curl curl --request GET \ --url https://stagingapi.paywithmoon.com/v1/api-gateway/controls/velocity/card/card_id/status \ --header 'accept: application/json' ``` -------------------------------- ### Get Velocity Control Status Example Source: https://docs.paywithmoon.com/reference/get_v1-api-gateway-controls-velocity-id-status-1 Example of how to retrieve the current usage status for a specific velocity control. This endpoint checks the current usage against the defined limits for a given control. ```APIDOC GET https://stagingapi.paywithmoon.com/v1/api-gateway/controls/velocity/{id}/status Description: Retrieves the current usage under the limit for a velocity control. Path Parameters: - id (uuid, required): The ID of the velocity control. Example Usage: GET https://stagingapi.paywithmoon.com/v1/api-gateway/controls/velocity/a1b2c3d4-e5f6-7890-1234-567890abcdef/status Responses: - 200 OK: Returns the status of the velocity control. - 404 Not Found: If the velocity control ID does not exist. - 500 Internal Server Error: For server-side issues. ``` -------------------------------- ### cURL Request Example for Fetching Cards Source: https://docs.paywithmoon.com/reference/get_cardholders-id-cards-1 Example of how to make a GET request using cURL to retrieve a paginated list of cards for a cardholder, specifying query parameters for pagination and inclusion of inactive cards. ```curl curl --request GET \ --url 'http://localhost:3000/v2/api-gateway/cardholders/id/cards?page=1&per_page=10&include_inactive_cards=false' \ --header 'accept: application/json' ``` -------------------------------- ### Paywithmoon API Endpoints Overview Source: https://docs.paywithmoon.com/reference/getting-started-with-your-api A comprehensive list of available API endpoints for managing various aspects of the Paywithmoon platform, including cards, gift cards, invoices, and webhooks. Each entry details the HTTP method, endpoint path, and a brief description of its functionality. ```APIDOC Moon Card Issuing API V1: Cards: POST /v1/api-gateway/card/{card-product-id}: Create a Card - Issues a new card associated with a specific card product. GET /v1/api-gateway/card/{card-id}: Fetch a Card - Retrieves details for a specific card. GET /v1/api-gateway/card: Get a list of cards - Retrieves a list of all cards. POST /v1/api-gateway/card/{card-id}/assign-cardholder: Assign a Cardholder to a Card - Assigns a cardholder to an existing card. POST /v1/api-gateway/card/{card-id}/activate: Activate a Card - Activates a previously issued card. POST /v1/api-gateway/card/{card-id}/add-balance: Add balance to a Card - Adds funds to a card's balance. PATCH /v1/api-gateway/card/{card-id}/freeze: Freeze/Unfreeze a Card - Toggles the frozen status of a card. PUT /v1/api-gateway/card/{card-id}/pin: Update a Card PIN - Updates the Personal Identification Number (PIN) for a card. GET /v1/api-gateway/card/{card-id}/pin: Get a Card PIN - Retrieves the PIN for a card. Card Products: GET /v1/api-gateway/card-products: Fetch Card Products - Retrieves a list of available card products. Simulate Card Transactions: POST /v1/api-gateway/card/{card-id}/transactions: Simulate a Card Transaction - Simulates a transaction for a given card. Fetch Card Transactions: GET /v1/api-gateway/card/{card-id}/transactions: Get Card Transactions - Retrieves transaction history for a card. Gift Cards: PATCH /v1/api-gateway/gift-card/{gift-card-id}: Mark a Gift Card as Used/Unused - Updates the status of a gift card. GET /v1/api-gateway/gift-card/{gift-card-id}: Fetch a Gift Card - Retrieves details for a specific gift card. GET /v1/api-gateway/gift-card/card-products: Fetch Gift Card Products - Retrieves available gift card products. POST /v1/api-gateway/gift-card: Purchase a Gift Card - Initiates the purchase of a gift card. Webhooks: DELETE /v1/api-gateway/webhook: Delete a Webhook URL - Removes a registered webhook URL. POST /v1/api-gateway/webhook: Register a Webhook URL - Registers a new webhook URL for receiving event notifications. Invoices: POST /v1/api-gateway/onchain-invoice/{invoice-id}/simulate-payment: Simulate Payment of an Invoice (Sandbox Only) - Simulates payment for an invoice, typically used in sandbox environments. ``` -------------------------------- ### Get Velocity Control by ID Source: https://docs.paywithmoon.com/reference/getvelocitycontrolbyid-1 Retrieves a specific velocity control by its ID. Includes cURL request example and expected response structure. ```APIDOC GET /v2/api-gateway/controls/velocity/{id} Retrieves a specific velocity control. Base URL: http://localhost:3000 Request Example (cURL): ```bash curl --request GET \ --url http://localhost:3000/v2/api-gateway/controls/velocity/id \ --header 'accept: application/json' ``` Response Status: - 200 OK: Velocity control retrieved successfully. Related Endpoints: - [Get all velocity controls](https://docs.paywithmoon.com/reference/getvelocitycontrols-1) - [Update a velocity control](https://docs.paywithmoon.com/reference/updatevelocitycontrol-1) ``` -------------------------------- ### Fetch Paginated Cardholders Source: https://docs.paywithmoon.com/reference/get_cardholders-1 Example cURL request to retrieve a paginated list of cardholders from the PayWithMoon API. Specifies GET method, URL, and accept header. ```curl curl --request GET \ --url 'http://localhost:3000/v2/api-gateway/cardholders?page=1&per_page=10' \ --header 'accept: application/json' ``` -------------------------------- ### Accounts API Source: https://docs.paywithmoon.com/reference/getting-started-with-your-api Endpoints for managing accounts, including retrieval of cards, accounts, and creation. ```APIDOC GET /accounts/{id}/cards Description: Get paginated list of cards for an account. URL: https://docs.paywithmoon.com/reference/get_accounts-id-cards-1 GET /accounts/{id} Description: Get account by ID. URL: https://docs.paywithmoon.com/reference/get_accounts-id-1 POST /accounts Description: Create a new account. URL: https://docs.paywithmoon.com/reference/post_accounts-1 GET /accounts Description: Get paginated list of accounts. URL: https://docs.paywithmoon.com/reference/get_accounts-1 ``` -------------------------------- ### Moon JIT API Integration Guide - Authorization Source: https://docs.paywithmoon.com/reference/moon-jit-api-integration-guide Explains the Just-In-Time (JIT) authorization process for card transactions. Moon sends webhooks with transaction details, and your system must respond with an approval or decline decision within 1 second to avoid automatic decline. ```APIDOC JIT Authorization: Purpose: Enables external systems to make real-time decisions on card transaction authorization. Process: Moon sends transaction details via webhook. Your system responds with an approval or decline decision. Timeout: If your API does not respond within 1 second, the transaction will be declined. Note: This section describes the concept and process, not specific API endpoints or code examples. ``` -------------------------------- ### Get Velocity Controls Source: https://docs.paywithmoon.com/reference/get_v1-api-gateway-controls-velocity-1 Example cURL request to fetch a list of velocity controls. This endpoint retrieves all configured velocity controls associated with the account, including pagination details. ```shell curl --request GET \ --url https://stagingapi.paywithmoon.com/v1/api-gateway/controls/velocity \ --header 'accept: application/json' ``` -------------------------------- ### Velocity Controls API Endpoints Source: https://docs.paywithmoon.com/reference/velocitycontrols-2 Endpoints for managing velocity controls, including getting status by card ID, getting status by ID, deleting controls, updating controls, getting specific controls, and getting all controls. ```APIDOC Velocity Controls: GET /controls/velocity/card/{card-id}/status Description: Get velocity control status by card ID. Parameters: - card-id (string): The ID of the card. Returns: Velocity control status for the card. GET /controls/velocity/{id}/status Description: Get velocity control status by its ID. Parameters: - id (string): The ID of the velocity control. Returns: Velocity control status. DELETE /controls/velocity/{id} Description: Delete a velocity control. Parameters: - id (string): The ID of the velocity control to delete. Returns: Confirmation of deletion. PATCH /controls/velocity/{id} Description: Update an existing velocity control. Parameters: - id (string): The ID of the velocity control to update. - (Request Body): Velocity control update payload. Returns: Updated velocity control details. GET /controls/velocity/{id} Description: Get a specific velocity control by its ID. Parameters: - id (string): The ID of the velocity control. Returns: Velocity control details. GET /controls/velocity Description: Get all velocity controls. Returns: List of all velocity controls. POST /controls/velocity Description: Create a new velocity control. Parameters: - (Request Body): Velocity control creation payload. Returns: Details of the newly created velocity control. ``` -------------------------------- ### Velocity Controls API Endpoints Source: https://docs.paywithmoon.com/reference/post_invoices-1 Endpoints for managing velocity controls, including getting status by card ID, getting status by ID, deleting controls, updating controls, getting specific controls, and getting all controls. ```APIDOC Velocity Controls: GET /controls/velocity/card/{card-id}/status Description: Get velocity control status by card ID. Parameters: - card-id (string): The ID of the card. Returns: Velocity control status for the card. GET /controls/velocity/{id}/status Description: Get velocity control status by its ID. Parameters: - id (string): The ID of the velocity control. Returns: Velocity control status. DELETE /controls/velocity/{id} Description: Delete a velocity control. Parameters: - id (string): The ID of the velocity control to delete. Returns: Confirmation of deletion. PATCH /controls/velocity/{id} Description: Update an existing velocity control. Parameters: - id (string): The ID of the velocity control to update. - (Request Body): Velocity control update payload. Returns: Updated velocity control details. GET /controls/velocity/{id} Description: Get a specific velocity control by its ID. Parameters: - id (string): The ID of the velocity control. Returns: Velocity control details. GET /controls/velocity Description: Get all velocity controls. Returns: List of all velocity controls. POST /controls/velocity Description: Create a new velocity control. Parameters: - (Request Body): Velocity control creation payload. Returns: Details of the newly created velocity control. ``` -------------------------------- ### Accounts API Source: https://docs.paywithmoon.com/reference/moon-jit-api-integration-guide Manage financial accounts. This includes creating new accounts, retrieving account details, and listing associated cards. ```APIDOC GET /reference/accounts-1 Description: Accounts overview. GET /accounts/{id}/cards Description: Get paginated list of cards for an account. Parameters: - id: The ID of the account. - query parameters for pagination. Returns: - A paginated list of card objects associated with the account. GET /accounts/{id} Description: Get account by ID. Parameters: - id: The unique identifier of the account. Returns: - The account object. POST /accounts Description: Create a new account. Parameters: - request body: Contains the details for the new account. Returns: - The newly created account object. GET /accounts Description: Get paginated list of accounts. Parameters: - query parameters for pagination and filtering. Returns: - A paginated list of account objects. ``` -------------------------------- ### Velocity Controls API Endpoints Source: https://docs.paywithmoon.com/reference/get_cardholders-1 Endpoints for managing velocity controls, including getting status by card ID, getting status by ID, deleting controls, updating controls, getting specific controls, and getting all controls. ```APIDOC Velocity Controls: GET /controls/velocity/card/{card-id}/status Description: Get velocity control status by card ID. Parameters: - card-id (string): The ID of the card. Returns: Velocity control status for the card. GET /controls/velocity/{id}/status Description: Get velocity control status by its ID. Parameters: - id (string): The ID of the velocity control. Returns: Velocity control status. DELETE /controls/velocity/{id} Description: Delete a velocity control. Parameters: - id (string): The ID of the velocity control to delete. Returns: Confirmation of deletion. PATCH /controls/velocity/{id} Description: Update an existing velocity control. Parameters: - id (string): The ID of the velocity control to update. - (Request Body): Velocity control update payload. Returns: Updated velocity control details. GET /controls/velocity/{id} Description: Get a specific velocity control by its ID. Parameters: - id (string): The ID of the velocity control. Returns: Velocity control details. GET /controls/velocity Description: Get all velocity controls. Returns: List of all velocity controls. POST /controls/velocity Description: Create a new velocity control. Parameters: - (Request Body): Velocity control creation payload. Returns: Details of the newly created velocity control. ``` -------------------------------- ### Invoice Management API Operations Source: https://docs.paywithmoon.com/reference/getting-started-with-your-api Manage on-chain invoices, including generating new invoices, retrieving paginated lists, and simulating payments for sandbox environments. ```APIDOC Get paginated on-chain invoices (GET) Endpoint: /v1/api-gateway/onchain-invoice Description: Retrieves a paginated list of on-chain invoices. Parameters: (Details not provided in source text) Returns: (Details not provided in source text) Example: (Details not provided in source text) ``` ```APIDOC Generate an Invoice (POST) Endpoint: /v1/api-gateway/onchain-invoice Description: Creates a new on-chain invoice. Parameters: (Details not provided in source text) Returns: (Details not provided in source text) Example: (Details not provided in source text) ``` ```APIDOC Simulate Payment of an Invoice (Sandbox Only) (POST) Endpoint: /v1/api-gateway/onchain-invoice/{invoice-id}/simulate-payment Description: Simulates the payment of an invoice, only available in sandbox environments. Parameters: - invoice-id: The unique identifier for the invoice. Returns: (Details not provided in source text) Example: (Details not provided in source text) ``` -------------------------------- ### Velocity Controls API Endpoints Source: https://docs.paywithmoon.com/reference/createvelocitycontrol-1 Endpoints for managing velocity controls, including getting status by card ID, getting status by ID, deleting controls, updating controls, getting specific controls, and getting all controls. ```APIDOC Velocity Controls: GET /controls/velocity/card/{card-id}/status Description: Get velocity control status by card ID. Parameters: - card-id (string): The ID of the card. Returns: Velocity control status for the card. GET /controls/velocity/{id}/status Description: Get velocity control status by its ID. Parameters: - id (string): The ID of the velocity control. Returns: Velocity control status. DELETE /controls/velocity/{id} Description: Delete a velocity control. Parameters: - id (string): The ID of the velocity control to delete. Returns: Confirmation of deletion. PATCH /controls/velocity/{id} Description: Update an existing velocity control. Parameters: - id (string): The ID of the velocity control to update. - (Request Body): Velocity control update payload. Returns: Updated velocity control details. GET /controls/velocity/{id} Description: Get a specific velocity control by its ID. Parameters: - id (string): The ID of the velocity control. Returns: Velocity control details. GET /controls/velocity Description: Get all velocity controls. Returns: List of all velocity controls. POST /controls/velocity Description: Create a new velocity control. Parameters: - (Request Body): Velocity control creation payload. Returns: Details of the newly created velocity control. ``` -------------------------------- ### Moon Reserve API Source: https://docs.paywithmoon.com/reference/getting-started-with-your-api Endpoints for managing Moon Reserve, including fetching balance information. ```APIDOC GET /v1/api/gateway/moon-reserve Description: Fetch Moon Reserve Balance. URL: https://docs.paywithmoon.com/reference/get_v1-api-gateway-moon-reserve ``` -------------------------------- ### Accounts API Source: https://docs.paywithmoon.com/reference/getting-started-with-your-api Endpoints for managing accounts. This includes retrieving paginated lists of accounts, creating new accounts, fetching accounts by ID, and listing cards associated with a specific account. ```APIDOC Accounts: GET /accounts - Retrieves a paginated list of accounts. - Parameters: - query parameters for pagination (e.g., page, perPage) - Returns: List of account objects. POST /accounts - Creates a new account. - Request Body: - Account creation payload (details not specified). - Returns: The newly created account object. GET /accounts/{id} - Retrieves a specific account by its unique ID. - Parameters: - id: The unique identifier of the account. - Returns: The account object. GET /accounts/{id}/cards - Retrieves a paginated list of cards associated with a specific account. - Parameters: - id: The unique identifier of the account. - Returns: List of card objects associated with the account. ``` -------------------------------- ### Gift Card API Operations Source: https://docs.paywithmoon.com/reference/getting-started-with-your-api Manage gift card products and individual gift cards. This includes purchasing, fetching products and specific cards, and marking cards as used or unused. ```APIDOC Purchase a Gift Card (POST) Endpoint: /v1/api-gateway/gift-card Description: Initiates the purchase of a gift card. Parameters: (Details not provided in source text) Returns: (Details not provided in source text) Example: (Details not provided in source text) ``` ```APIDOC Fetch Gift Card Products (GET) Endpoint: /v1/api-gateway/gift-card/card-products Description: Retrieves a list of available gift card products. Parameters: (Details not provided in source text) Returns: (Details not provided in source text) Example: (Details not provided in source text) ``` ```APIDOC Fetch a Gift Card (GET) Endpoint: /v1/api-gateway/gift-card/{gift-card-id} Description: Retrieves details for a specific gift card. Parameters: - gift-card-id: The unique identifier for the gift card. Returns: (Details not provided in source text) Example: (Details not provided in source text) ``` ```APIDOC Mark a Gift Card as Used/Unused (PATCH) Endpoint: /v1/api-gateway/gift-card/{gift-card-id} Description: Updates the status of a gift card to used or unused. Parameters: - gift-card-id: The unique identifier for the gift card. - status: The new status (e.g., 'used', 'unused'). Returns: (Details not provided in source text) Example: (Details not provided in source text) ``` -------------------------------- ### Simulate Card Transaction cURL Example Source: https://docs.paywithmoon.com/reference/post_v1-api-gateway-card-card-id-transactions Example cURL request for simulating a card transaction via the PayWithMoon API. ```shell curl --request POST \ --url https://stagingapi.paywithmoon.com/v1/api-gateway/card/card_id/transactions \ --header 'accept: application/json' \ --header 'content-type: application/json' ``` -------------------------------- ### Webhooks API Source: https://docs.paywithmoon.com/reference/getting-started-with-your-api Endpoints for managing transaction webhooks, including creation and deletion. ```APIDOC DELETE /webhooks Description: Delete a transaction webhook. URL: https://docs.paywithmoon.com/reference/delete_webhooks-1 POST /webhooks Description: Create a transaction webhook. URL: https://docs.paywithmoon.com/reference/post_webhooks-1 ``` -------------------------------- ### Invoices API Source: https://docs.paywithmoon.com/reference/getting-started-with-your-api Endpoints for managing invoices, including generation and retrieval of paginated lists. ```APIDOC POST /invoices Description: Generate an Invoice. URL: https://docs.paywithmoon.com/reference/post_invoices-1 GET /invoices Description: Get paginated on-chain invoices. URL: https://docs.paywithmoon.com/reference/get_invoices-1 ``` -------------------------------- ### Update Velocity Control (cURL Example) Source: https://docs.paywithmoon.com/reference/patch_v1-api-gateway-controls-velocity-id-1 Example cURL command to update a velocity control, setting the type and velocity window. ```shell curl --request PATCH \ --url https://stagingapi.paywithmoon.com/v1/api-gateway/controls/velocity/id \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --data '{ "type": "SPEND", "velocity_window": "MONTH" }' ``` -------------------------------- ### Cards API Source: https://docs.paywithmoon.com/reference/getting-started-with-your-api Endpoints for managing virtual cards. This includes creating new cards, retrieving lists of cards, fetching individual card details, freezing/unfreezing cards, viewing card transactions, and assigning cardholders to cards. ```APIDOC Cards: POST /cards - Creates a new virtual card. - Request Body: - Card creation payload, likely including card product ID, cardholder details, etc. - Returns: The newly created card object. GET /cards - Retrieves a paginated list of all cards associated with the account. - Parameters: - query parameters for pagination (e.g., page, perPage) - Returns: List of card objects. GET /cards/{card_id} - Fetches the details of a specific card using its ID. - Parameters: - card_id: The unique identifier of the card. - Returns: The card object. PATCH /cards/{card_id} - Freezes or unfreezes a specific card. - Parameters: - card_id: The unique identifier of the card. - Request Body: - Payload to specify the freeze/unfreeze action (e.g., {"status": "frozen"}). - Returns: The updated card object. GET /cards/{card_id}/transactions - Retrieves a paginated list of transactions for a specific card. - Parameters: - card_id: The unique identifier of the card. - Returns: List of transaction objects. PATCH /cards/{card_id}/assign-cardholder - Assigns a cardholder to a specific card. - Parameters: - card_id: The unique identifier of the card. - Request Body: - Payload containing the cardholder ID to assign. - Returns: The updated card object. ``` -------------------------------- ### Cards API Source: https://docs.paywithmoon.com/reference/getting-started-with-your-api Endpoints for managing cards, including assignment, transactions, freezing/unfreezing, fetching, and creation. ```APIDOC PATCH /cards/{card_id}/assign-cardholder Description: Assign a cardholder to a card. URL: https://docs.paywithmoon.com/reference/patch_cards-card-id-assign-cardholder GET /cards/{card_id}/transactions Description: Get Card Transactions. URL: https://docs.paywithmoon.com/reference/get_cards-card-id-transactions-1 PATCH /cards/{card_id} Description: Freeze/Unfreeze a Card. URL: https://docs.paywithmoon.com/reference/patch_cards-card-id-1 GET /cards/{card_id} Description: Fetch a Card. URL: https://docs.paywithmoon.com/reference/get_cards-card-id-1 GET /cards Description: Get a list of cards. URL: https://docs.paywithmoon.com/reference/get_cards-1 POST /cards Description: Create a new card. URL: https://docs.paywithmoon.com/reference/post_cards-1 ``` -------------------------------- ### Webhook Payload Example: Transaction Confirmation Count Update Source: https://docs.paywithmoon.com/reference/webhooks An example JSON payload for a webhook event indicating an update to the transaction confirmation count for a payment. ```json { "data": { "payment_id": 1, "address": "0x5c45bCe992cd41Ec68F05D0E592Ab39FcA45F28c", "transaction_hash": "098f6bcd4621d373cade4e832627b4f6", "confirmation_count": 10, "amount": "0.01", "currency": "USDC", "blockchain": "POLYGON", "broadcast_time": "2025-01-02 23:56:45", "invoice_id": "12c58693-8094-4a2e-982e-a2183ea40dd7" }, "type": "TRANSACTION_CONFIRMATION_COUNT_UPDATED" } ``` -------------------------------- ### On-Chain Invoices API Source: https://docs.paywithmoon.com/reference/getting-started-with-your-api Endpoints for managing on-chain invoices, including generation and retrieval of paginated lists. ```APIDOC POST /v1/api/gateway/onchain/invoice Description: Generate an Invoice. URL: https://docs.paywithmoon.com/reference/post_v1-api-gateway-onchain-invoice GET /v1/api/gateway/onchain/invoice Description: Get paginated on-chain invoices. URL: https://docs.paywithmoon.com/reference/get_v1-api-gateway-onchain-invoice ``` -------------------------------- ### Create Card Source: https://docs.paywithmoon.com/reference/post_v1-api-gateway-card-card-product-id Creates a new card for a given card product. Requires specifying the card type and currency. The response includes the details of the newly created card. ```APIDOC POST /v1/api-gateway/card/{card_product_id} Request Body: card_type: string (e.g., "VIRTUAL") card_currency: string (e.g., "USD") Response Body: card: object (See Card Object Schema for details) Error Responses: - Rate limit exceeded ``` ```curl curl --request POST \ --url https://stagingapi.paywithmoon.com/v1/api-gateway/card/card_product_id \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --data '{ "card_type": "VIRTUAL", "card_currency": "USD" }' ``` -------------------------------- ### Invoice API Endpoints Source: https://docs.paywithmoon.com/reference/moon-jit-api-integration-guide Endpoints for generating and managing invoices, including simulating payments for sandbox environments. ```APIDOC POST /v1/api/gateway/onchain-invoice Description: Generate a new invoice. Request Body: Invoice details. Returns: Information about the generated invoice. POST /v1/api/gateway/onchain-invoice/{invoice-id}/simulate-payment Description: Simulate payment of an invoice (Sandbox Only). Parameters: invoice-id: The ID of the invoice. Returns: Result of the simulated payment. ``` -------------------------------- ### Update Velocity Control (cURL Example) Source: https://docs.paywithmoon.com/reference/updatevelocitycontrol-1 Example of how to update a velocity control using a cURL command. This demonstrates the HTTP method, URL, headers, and the JSON payload required for the request. ```shell curl --request PATCH \ --url http://localhost:3000/v2/api-gateway/controls/velocity/id \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --data '{ "type": "SPEND", "velocity_window": "MONTH" }' ``` -------------------------------- ### Moon Reserve API Source: https://docs.paywithmoon.com/reference/moon-jit-api-integration-guide Access and manage Moon Reserve functionalities, including fetching balance information. ```APIDOC GET /reference/moon-reserve Description: Moon Reserve overview. GET /v1/api-gateway/moon-reserve Description: Fetch Moon Reserve Balance. Returns: - Current Moon Reserve balance. ``` -------------------------------- ### Account Management Source: https://docs.paywithmoon.com/reference/get_v1-api-gateway-card-card-products Endpoints for managing accounts, including creation, retrieval, and listing associated cards. ```APIDOC GET /accounts/{id}/cards Description: Retrieves a paginated list of cards associated with a specific account. Parameters: - id (path): The ID of the account. Returns: - A list of cards for the account. GET /accounts/{id} Description: Retrieves an account by its ID. Parameters: - id (path): The ID of the account. Returns: - Account details. POST /accounts Description: Creates a new account. Parameters: - Request Body: Account creation details. Returns: - Information about the newly created account. GET /accounts Description: Retrieves a paginated list of all accounts. Parameters: - page (query, optional): Page number. - limit (query, optional): Items per page. Returns: - A list of accounts. ```