Preview: SendMock has no stable release yet. These docs follow develop.

MCP reference

Payments tools

sendmock_payment_create

Create a payment and pay it with a test card, as an app's server does without a checkout page.

Toolset payments.

    InputTypeDescription
    providerrequiredstring
    The gateway key, e.g. stripe or sslcommerz.Example: stripe
    amount_minorrequirednumber
    The amount in the currency's minor unit (cents, paisa; JPY has none); 1999 is 19.99.Example: 1999
    currencystring
    Three letters, stored in capitals; Settings > Payments' default currency when left out.Example: USD
    card_numberrequiredstring
    A test card of the card method; its outcome in the test card table decides the payment. A number the table does not list is refused and kept nowhere.Example: 4242424242424242
    customer_emailstring
    The customer's email.Example: [email protected]
    line_itemsobject[]
    What is being bought.Example: [{"name":"T-shirt","quantity":1,"unit_amount_minor":1999}]
    capture_methodstring
    manual authorizes the payment and waits for a capture or void; automatic when left out.One of: automatic, manualExample: automatic

    Example call

    {
      "name": "sendmock_payment_create",
      "arguments": {
        "provider": "stripe",
        "amount_minor": 1999,
        "card_number": "4242424242424242",
        "currency": "USD",
        "customer_email": "[email protected]"
      }
    }

    Result: PaymentDetail

    API
    POST/api/v1/payments
    CLI
    sendmock payments create
    In the app
    Payments > New payment

    sendmock_payment_create_checkout

    Start a hosted checkout on a gateway and get its payment page URL.

    Toolset payments.

      InputTypeDescription
      providerrequiredstring
      The gateway key, e.g. stripe or sslcommerz.Example: stripe
      amount_minorrequirednumber
      The amount in the currency's minor unit (cents, paisa); 1999 is 19.99.Example: 1999
      currencystring
      Settings > Payments' default currency when left out.Example: USD
      customer_emailstring
      The customer's email, shown on the checkout page.Example: [email protected]
      line_itemsobject[]
      What is being bought, shown on the checkout page.Example: [{"name":"T-shirt","quantity":1,"unit_amount_minor":1999}]
      capture_methodstring
      manual authorizes the payment and waits for a capture or void; automatic when left out.One of: automatic, manualExample: manual

      Example call

      {
        "name": "sendmock_payment_create_checkout",
        "arguments": {
          "provider": "stripe",
          "amount_minor": 1999,
          "currency": "USD",
          "customer_email": "[email protected]"
        }
      }

      Result: PaymentDetail

      API
      POST/api/v1/payments/checkout
      CLI
      sendmock payments checkout create
      In the app
      Payments > Gateways > gateway > Checkout > Open a test checkout

      sendmock_payment_get

      One payment with line items, timeline, redirects and notifications.

      Toolset payments.

      • Read only
      InputTypeDescription
      payment_idrequiredstring
      The payment's ID, from GET /api/v1/payments.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D

      Example call

      {
        "name": "sendmock_payment_get",
        "arguments": {
          "payment_id": "01JB7T9Q2R5W8X3Y6Z1A4B7C9D"
        }
      }

      Result: PaymentDetail

      API
      GET/api/v1/payments/{paymentId}
      CLI
      sendmock payments show <paymentId>
      In the app
      Payments > open payment

      sendmock_payment_list

      Test payments, newest first, with filters.

      Toolset payments.

      • Read only
      InputTypeDescription
      cursorstring
      The next_cursor of the previous page.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      limitinteger
      Items per page, 1 to 200 (default 50).Example: 50
      statusstring
      succeeded, pending, failed, refunded or disputed.Example: succeeded
      providerstring
      Gateway key.Example: stripe
      currencystring
      ISO 4217 code.Example: USD

      Example call

      {
        "name": "sendmock_payment_list",
        "arguments": {
          "cursor": "01JB7T9Q2R5W8X3Y6Z1A4B7C9D",
          "limit": 50
        }
      }

      Result: PageOf_PaymentSummary

      API
      GET/api/v1/payments
      CLI
      sendmock payments list
      In the app
      Payments

      sendmock_payment_notify

      Send the payment's notification (IPN or webhook) again.

      Toolset payments.

        InputTypeDescription
        payment_idrequiredstring
        The payment's ID, from GET /api/v1/payments.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D

        Example call

        {
          "name": "sendmock_payment_notify",
          "arguments": {
            "payment_id": "01JB7T9Q2R5W8X3Y6Z1A4B7C9D"
          }
        }

        Result: PaymentDetail

        API
        POST/api/v1/payments/{paymentId}/notify
        CLI
        sendmock payments notify <paymentId>
        In the app
        Payments > payment > Resend notification

        sendmock_payment_simulate

        Move the payment on: capture, refund, dispute, fail.

        Toolset payments.

          InputTypeDescription
          payment_idrequiredstring
          The payment's ID, from GET /api/v1/payments.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
          actionrequiredstring
          What happens to the payment: succeed, decline, refund, dispute, answer_dispute, resolve_dispute, expire, capture or void.One of: succeed, decline, refund, dispute, answer_dispute, resolve_dispute, expire, capture, voidExample: refund
          decline_reasonstring
          For decline: why the bank declined.One of: insufficient_funds, expired_card, incorrect_cvc, generic_decline, fraudulent, authentication_failedExample: insufficient_funds
          refund_amount_minornumber
          For refund: the amount in minor units; the full amount when left out.Example: 500
          dispute_outcomestring
          For resolve_dispute: won or lost.One of: won, lostExample: won
          dispute_evidencestring
          For answer_dispute: the evidence sent to the bank.Example: Signed delivery receipt attached.
          webhook_endpoint_idsstring[]
          Send this action's webhooks to exactly these endpoints (IDs from GET /api/v1/webhooks/endpoints) instead of the ones the rules pick; an empty list sends none. Leave it out to let the rules decide.Example: ["01JB7T9Q2RENDPOINT00000000"]
          webhook_requestsWebhookRequestEdit[]
          Payloads edited for this action, by endpoint: each body is sent as written instead of the rendered one and signed over those bytes. Leave it out to send the rendered payloads.Example: [{"endpoint_id":"01JB7T9Q2RENDPOINT00000000","event_type":"email.bounced","body":"{\"type\":\"email.bounced\",\"data\":{\"reason\":\"edited\"}}","headers":{"x-tenant":"acme"}}]

          Example call

          {
            "name": "sendmock_payment_simulate",
            "arguments": {
              "payment_id": "01JB7T9Q2R5W8X3Y6Z1A4B7C9D",
              "action": "refund",
              "decline_reason": "insufficient_funds",
              "refund_amount_minor": 500
            }
          }

          Result: PaymentDetail

          API
          POST/api/v1/payments/{paymentId}/simulate
          CLI
          sendmock payments simulate <paymentId> <action>
          In the app
          Payments > payment > Simulate

          sendmock_payment_test_cards

          The test values of every enabled payment method.

          Toolset payments.

          • Read only

          No inputs.

          Example call

          {
            "name": "sendmock_payment_test_cards",
            "arguments": {}
          }

          Result: PaymentMethodDefinition[]

          API
          GET/api/v1/payments/test-cards
          CLI
          sendmock payments test-cards
          In the app
          Settings > Payments > Test values

          sendmock_subscription_advance

          Move the subscription's clock to its next renewal and charge it.

          Toolset core.

            InputTypeDescription
            subscription_idrequiredstring
            The subscription's ID, from GET /api/v1/payments/subscriptions.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D

            Example call

            {
              "name": "sendmock_subscription_advance",
              "arguments": {
                "subscription_id": "01JB7T9Q2R5W8X3Y6Z1A4B7C9D"
              }
            }

            Result: PaymentSubscription

            API
            POST/api/v1/payments/subscriptions/{subscriptionId}/advance
            CLI
            sendmock payments subscriptions advance <subscriptionId>
            In the app
            Payments > Subscriptions > Advance to renewal

            sendmock_subscription_cancel

            Cancel the subscription now or at the end of its period.

            Toolset core.

              InputTypeDescription
              subscription_idrequiredstring
              The subscription's ID, from GET /api/v1/payments/subscriptions.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
              at_period_endboolean
              End at the next advance instead of now.Example: false

              Example call

              {
                "name": "sendmock_subscription_cancel",
                "arguments": {
                  "subscription_id": "01JB7T9Q2R5W8X3Y6Z1A4B7C9D",
                  "at_period_end": false
                }
              }

              Result: PaymentSubscription

              API
              POST/api/v1/payments/subscriptions/{subscriptionId}/cancel
              CLI
              sendmock payments subscriptions cancel <subscriptionId>
              In the app
              Payments > Subscriptions > Cancel

              sendmock_subscription_create

              Start a subscription on a gateway, with an optional trial.

              Toolset core.

                InputTypeDescription
                providerrequiredstring
                The gateway's key.Example: stripe
                customer_emailrequiredstring
                Who pays.Example: [email protected]
                plan_namerequiredstring
                The plan's name, shown on each renewal's payment.Example: Pro monthly
                amount_minorrequirednumber
                The amount of each renewal in minor units.Example: 1500
                currencystring
                ISO 4217 code; Settings > Payments' default currency when left out.Example: USD
                intervalrequiredstring
                How often it renews: day, week, month or year.One of: day, week, month, yearExample: month
                trial_daysnumber
                Days before the first charge; none charges at once.Example: 7
                card_numberstring
                The test card that pays each renewal; 4242424242424242 when left out.Example: 4000000000009995

                Example call

                {
                  "name": "sendmock_subscription_create",
                  "arguments": {
                    "provider": "stripe",
                    "customer_email": "[email protected]",
                    "plan_name": "Pro monthly",
                    "amount_minor": 1500,
                    "interval": "month",
                    "currency": "USD",
                    "trial_days": 7
                  }
                }

                Result: PaymentSubscription

                API
                POST/api/v1/payments/subscriptions
                CLI
                sendmock payments subscriptions create
                In the app
                Payments > Subscriptions > New subscription

                sendmock_subscription_get

                One subscription with its timeline and renewal payments.

                Toolset core.

                • Read only
                InputTypeDescription
                subscription_idrequiredstring
                The subscription's ID, from GET /api/v1/payments/subscriptions.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D

                Example call

                {
                  "name": "sendmock_subscription_get",
                  "arguments": {
                    "subscription_id": "01JB7T9Q2R5W8X3Y6Z1A4B7C9D"
                  }
                }

                Result: PaymentSubscription

                API
                GET/api/v1/payments/subscriptions/{subscriptionId}
                CLI
                sendmock payments subscriptions show <subscriptionId>
                In the app
                Payments > Subscriptions > open subscription