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

CLI reference

Payments commands

sendmock payments checkout create

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

sendmock payments checkout create [flags]
FlagTypeDescription
--provider <provider>requiredstring
The gateway key, e.g. stripe or sslcommerz.Example: stripe
--amount-minor <amount-minor>requirednumber
The amount in the currency's minor unit (cents, paisa); 1999 is 19.99.Example: 1999
--currency <currency>string
Settings > Payments' default currency when left out.Example: USD
--customer-email <customer-email>string
The customer's email, shown on the checkout page.Example: [email protected]
--line-items <line-items>object[] (JSON)
What is being bought, shown on the checkout page.Example: [{"name":"T-shirt","quantity":1,"unit_amount_minor":1999}]
--capture-method <capture-method>string
manual authorizes the payment and waits for a capture or void; automatic when left out.One of: automatic, manualExample: manual

Example

sendmock payments checkout create --provider stripe --amount-minor 1999 --currency USD --customer-email [email protected]

Output with --json: PaymentDetail. Exit codes: 0, 1, 2.

API
POST/api/v1/payments/checkout
MCP tool
sendmock_payment_create_checkout
In the app
Payments > Gateways > gateway > Checkout > Open a test checkout

sendmock payments create

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

sendmock payments create [flags]
FlagTypeDescription
--provider <provider>requiredstring
The gateway key, e.g. stripe or sslcommerz.Example: stripe
--amount-minor <amount-minor>requirednumber
The amount in the currency's minor unit (cents, paisa; JPY has none); 1999 is 19.99.Example: 1999
--currency <currency>string
Three letters, stored in capitals; Settings > Payments' default currency when left out.Example: USD
--card-number <card-number>requiredstring
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-email <customer-email>string
The customer's email.Example: [email protected]
--line-items <line-items>object[] (JSON)
What is being bought.Example: [{"name":"T-shirt","quantity":1,"unit_amount_minor":1999}]
--capture-method <capture-method>string
manual authorizes the payment and waits for a capture or void; automatic when left out.One of: automatic, manualExample: automatic

Example

sendmock payments create --provider stripe --amount-minor 1999 --card-number 4242424242424242 --currency USD --customer-email [email protected]

Output with --json: PaymentDetail. Exit codes: 0, 1, 2, 3.

API
POST/api/v1/payments
MCP tool
sendmock_payment_create
In the app
Payments > New payment

sendmock payments list

Test payments, newest first, with filters.

sendmock payments list [flags]
FlagTypeDescription
--cursor <cursor>string
The next_cursor of the previous page.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
--limit <limit>integer
Items per page, 1 to 200 (default 50).Example: 50
--status <status>string
succeeded, pending, failed, refunded or disputed.Example: succeeded
--provider <provider>string
Gateway key.Example: stripe
--currency <currency>string
ISO 4217 code.Example: USD

Example

sendmock payments list --cursor 01JB7T9Q2R5W8X3Y6Z1A4B7C9D --limit 50

Output with --json: PageOf_PaymentSummary. Exit codes: 0, 1, 2.

API
GET/api/v1/payments
MCP tool
sendmock_payment_list
In the app
Payments

sendmock payments notify

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

sendmock payments notify <paymentId>
ArgumentTypeDescription
<paymentId>requiredstring
The payment's ID, from GET /api/v1/payments.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D

Example

sendmock payments notify 01JB7T9Q2R5W8X3Y6Z1A4B7C9D

Output with --json: PaymentDetail. Exit codes: 0, 1, 2, 3.

API
POST/api/v1/payments/{paymentId}/notify
MCP tool
sendmock_payment_notify
In the app
Payments > payment > Resend notification

sendmock payments show

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

sendmock payments show <paymentId>
ArgumentTypeDescription
<paymentId>requiredstring
The payment's ID, from GET /api/v1/payments.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D

Example

sendmock payments show 01JB7T9Q2R5W8X3Y6Z1A4B7C9D

Output with --json: PaymentDetail. Exit codes: 0, 1, 2, 3.

API
GET/api/v1/payments/{paymentId}
MCP tool
sendmock_payment_get
In the app
Payments > open payment

sendmock payments simulate

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

sendmock payments simulate <paymentId> <action> [flags]
ArgumentTypeDescription
<paymentId>requiredstring
The payment's ID, from GET /api/v1/payments.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
<action>requiredstring
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
FlagTypeDescription
--decline-reason <decline-reason>string
For decline: why the bank declined.One of: insufficient_funds, expired_card, incorrect_cvc, generic_decline, fraudulent, authentication_failedExample: insufficient_funds
--refund-amount-minor <refund-amount-minor>number
For refund: the amount in minor units; the full amount when left out.Example: 500
--dispute-outcome <dispute-outcome>string
For resolve_dispute: won or lost.One of: won, lostExample: won
--dispute-evidence <dispute-evidence>string
For answer_dispute: the evidence sent to the bank.Example: Signed delivery receipt attached.
--webhook <webhook>string[] (repeat for more)
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-requests <webhook-requests>WebhookRequestEdit[] (JSON)
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

sendmock payments simulate 01JB7T9Q2R5W8X3Y6Z1A4B7C9D refund --decline-reason insufficient_funds --refund-amount-minor 500

Output with --json: PaymentDetail. Exit codes: 0, 1, 2, 3.

API
POST/api/v1/payments/{paymentId}/simulate
MCP tool
sendmock_payment_simulate
In the app
Payments > payment > Simulate

sendmock payments subscriptions advance

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

sendmock payments subscriptions advance <subscriptionId>
ArgumentTypeDescription
<subscriptionId>requiredstring
The subscription's ID, from GET /api/v1/payments/subscriptions.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D

Example

sendmock payments subscriptions advance 01JB7T9Q2R5W8X3Y6Z1A4B7C9D

Output with --json: PaymentSubscription. Exit codes: 0, 1, 2, 3.

API
POST/api/v1/payments/subscriptions/{subscriptionId}/advance
MCP tool
sendmock_subscription_advance
In the app
Payments > Subscriptions > Advance to renewal

sendmock payments subscriptions cancel

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

sendmock payments subscriptions cancel <subscriptionId> [flags]
ArgumentTypeDescription
<subscriptionId>requiredstring
The subscription's ID, from GET /api/v1/payments/subscriptions.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
FlagTypeDescription
--at-period-endboolean
End at the next advance instead of now. --no-at-period-end sets it to false.

Example

sendmock payments subscriptions cancel 01JB7T9Q2R5W8X3Y6Z1A4B7C9D --no-at-period-end

Output with --json: PaymentSubscription. Exit codes: 0, 1, 2, 3.

API
POST/api/v1/payments/subscriptions/{subscriptionId}/cancel
MCP tool
sendmock_subscription_cancel
In the app
Payments > Subscriptions > Cancel

sendmock payments subscriptions create

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

sendmock payments subscriptions create [flags]
FlagTypeDescription
--provider <provider>requiredstring
The gateway's key.Example: stripe
--customer-email <customer-email>requiredstring
Who pays.Example: [email protected]
--plan-name <plan-name>requiredstring
The plan's name, shown on each renewal's payment.Example: Pro monthly
--amount-minor <amount-minor>requirednumber
The amount of each renewal in minor units.Example: 1500
--currency <currency>string
ISO 4217 code; Settings > Payments' default currency when left out.Example: USD
--interval <interval>requiredstring
How often it renews: day, week, month or year.One of: day, week, month, yearExample: month
--trial-days <trial-days>number
Days before the first charge; none charges at once.Example: 7
--card-number <card-number>string
The test card that pays each renewal; 4242424242424242 when left out.Example: 4000000000009995

Example

sendmock payments subscriptions create --provider stripe --customer-email [email protected] --plan-name 'Pro monthly' --amount-minor 1500 --interval month --currency USD --trial-days 7

Output with --json: PaymentSubscription. Exit codes: 0, 1, 2, 3.

API
POST/api/v1/payments/subscriptions
MCP tool
sendmock_subscription_create
In the app
Payments > Subscriptions > New subscription

sendmock payments subscriptions show

One subscription with its timeline and renewal payments.

sendmock payments subscriptions show <subscriptionId>
ArgumentTypeDescription
<subscriptionId>requiredstring
The subscription's ID, from GET /api/v1/payments/subscriptions.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D

Example

sendmock payments subscriptions show 01JB7T9Q2R5W8X3Y6Z1A4B7C9D

Output with --json: PaymentSubscription. Exit codes: 0, 1, 2, 3.

API
GET/api/v1/payments/subscriptions/{subscriptionId}
MCP tool
sendmock_subscription_get
In the app
Payments > Subscriptions > open subscription