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

CLI reference

Payment gateways commands

sendmock payments gateways create

Add a custom gateway.

sendmock payments gateways create [flags]
FlagTypeDescription
--name <name>requiredstring
The new gateway's name.Example: Upay
--key <key>requiredstring
Its key in the API and in /providers/<key>/... paths; lowercase, fixed after creation.Example: upay
--start-from <start-from>string
A gateway to copy (methods, redirect and notification), or null for blank.Example: bkash

Example

sendmock payments gateways create --name Upay --key upay --start-from bkash

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

API
POST/api/v1/payments/gateways
MCP tool
sendmock_payment_gateway_create
In the app
Payments > Gateways > Add gateway

sendmock payments gateways credential

Reveal one secret credential (asked for after a confirmation).

sendmock payments gateways credential <gatewayKey> <credentialName> --reveal
ArgumentTypeDescription
<gatewayKey>requiredstring
The payment gateway's key, e.g. stripe or sslcommerz.Example: stripe
<credentialName>requiredstring
The credential's name in the gateway or provider, e.g. secret_key or api_key.Example: secret_key
FlagTypeDescription
--revealboolean
Prints the secret in plain text instead of masked.

Example

sendmock payments gateways credential stripe secret_key --reveal

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

API
GET/api/v1/payments/gateways/{gatewayKey}/credentials/{credentialName}
In the app
Payments > Gateways > gateway > Merchant > Reveal

sendmock payments gateways delete

Delete a custom gateway; 409 while payments use it.

sendmock payments gateways delete <gatewayKey> [flags]
ArgumentTypeDescription
<gatewayKey>requiredstring
The payment gateway's key, e.g. stripe or sslcommerz.Example: stripe
FlagTypeDescription
--yesboolean
Confirms a destructive command; without it the command stops.

Example

sendmock payments gateways delete stripe --yes

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

API
DELETE/api/v1/payments/gateways/{gatewayKey}
MCP tool
sendmock_payment_gateway_delete
In the app
Payments > Gateways > gateway > Delete

sendmock payments gateways preview

Render a gateway's redirect and notification for a payment.

sendmock payments gateways preview <gatewayKey> [flags]
ArgumentTypeDescription
<gatewayKey>requiredstring
The payment gateway's key, e.g. stripe or sslcommerz.Example: stripe
FlagTypeDescription
--gateway <gateway>requiredPaymentGatewayInput (JSON)
The gateway settings to render, saved or not.
--payment-id <payment-id>string
The payment to render against; the newest one when left out.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
--event-type <event-type>requiredstring
The native event to render the notification for.One of: payment.created, payment.authorized, payment.succeeded, payment.failed, payment.canceled, payment.refunded, payment.partially_refunded, payment.dispute_opened, payment.dispute_updated, payment.dispute_closed, checkout.completed, checkout.expiredExample: payment.succeeded
--redirect-outcome <redirect-outcome>requiredstring
The redirect to render: success, fail or cancel.One of: success, fail, cancelExample: success

Example

sendmock payments gateways preview stripe --gateway '{"key":"upay","name":"Upay","accent":"#e2136e","is_enabled":true,"method_keys":["upay_wallet","card"],"credentials":[{"name":"webhook_secret","value":"whsec_test_123","is_secret":true}],"notification_endpoint_id":"01JB7T9Q2R5W8X3Y6Z1A4B7C9D","redirect_method":"POST","redirect_fields":[{"name":"session_id","template":"{{ payment.reference }}","send_on":"always"}],"notification_content_type":"json","event_names":{"payment.succeeded":"PAYMENT_SUCCESS","payment.failed":"PAYMENT_FAILED","payment.refunded":"","checkout.completed":"","checkout.expired":""},"notification_body":"{\"status\": \"{{ event.name }}\", \"txn_id\": \"{{ payment.reference }}\"}","notification_headers":[{"name":"stripe-signature","template":"{{ stripe_signature(merchant.webhook_secret) }}"}]}' --event-type payment.succeeded --redirect-outcome success

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

API
POST/api/v1/payments/gateways/{gatewayKey}/preview
MCP tool
sendmock_payment_gateway_preview
In the app
Payments > Gateways > gateway > Redirect, Notification preview

sendmock payments gateways reset

Put a built-in gateway back as shipped.

sendmock payments gateways reset <gatewayKey>
ArgumentTypeDescription
<gatewayKey>requiredstring
The payment gateway's key, e.g. stripe or sslcommerz.Example: stripe

Example

sendmock payments gateways reset stripe

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

API
POST/api/v1/payments/gateways/{gatewayKey}/reset
MCP tool
sendmock_payment_gateway_reset
In the app
Payments > Gateways > gateway > Reset to default

sendmock payments gateways show

One gateway definition; secret credentials masked.

sendmock payments gateways show <gatewayKey>
ArgumentTypeDescription
<gatewayKey>requiredstring
The payment gateway's key, e.g. stripe or sslcommerz.Example: stripe

Example

sendmock payments gateways show stripe

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

API
GET/api/v1/payments/gateways/{gatewayKey}
MCP tool
sendmock_payment_gateway_get
In the app
Payments > Gateways > Edit

sendmock payments gateways update

Change a gateway; secret credentials stay masked.

sendmock payments gateways update <gatewayKey> [flags]
ArgumentTypeDescription
<gatewayKey>requiredstring
The payment gateway's key, e.g. stripe or sslcommerz.Example: stripe
FlagTypeDescription
--key <key>requiredstring
The provider value in the API and in /providers/<key>/... paths.Example: upay
--name <name>requiredstring
The gateway's name, shown on checkout pages.Example: Upay
--accent <accent>requiredstring
#rrggbb, used on its checkout pages.Example: #e2136e
--enabledrequiredboolean
Off gateways reject new checkouts. --no-enabled sets it to false.
--method-key <method-key>requiredstring[] (repeat for more)
The methods its checkout offers, in order.Example: ["upay_wallet","card"]
--credentials <credentials>requiredGatewayCredential[] (JSON)
The merchant credentials your app is configured with.Example: [{"name":"webhook_secret","value":"whsec_test_123","is_secret":true}]
--notification-endpoint-id <notification-endpoint-id>string
The webhook endpoint its IPN or webhook deliveries go to.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
--redirect-method <redirect-method>requiredstring
How the browser returns to your app: GET (query string) or POST (form).One of: GET, POSTExample: POST
--redirect-fields <redirect-fields>requiredGatewayRedirectField[] (JSON)
The parameters sent to your app on redirect.Example: [{"name":"session_id","template":"{{ payment.reference }}","send_on":"always"}]
--notification-content-type <notification-content-type>requiredstring
How the IPN or webhook body is sent: json or form.One of: json, formExample: json
--event-names <event-names>requiredobject (JSON)
The gateway's name for each native event; blank sends nothing.
--notification-body <notification-body>requiredstring
The notification body, a template over the payment and the event.Example: {"status": "{{ event.name }}", "txn_id": "{{ payment.reference }}"}
--notification-headers <notification-headers>requiredGatewayHeaderTemplate[] (JSON)
Headers sent with each notification.Example: [{"name":"stripe-signature","template":"{{ stripe_signature(merchant.webhook_secret) }}"}]

Example

sendmock payments gateways update stripe --key upay --name Upay --accent '#e2136e' --enabled --method-key upay_wallet --method-key card --credentials '[{"name":"webhook_secret","value":"whsec_test_123","is_secret":true}]' --redirect-method POST --redirect-fields '[{"name":"session_id","template":"{{ payment.reference }}","send_on":"always"}]' --notification-content-type json --event-names '{"payment.succeeded":"PAYMENT_SUCCESS","payment.failed":"PAYMENT_FAILED","payment.refunded":"","checkout.completed":"","checkout.expired":""}' --notification-body '{"status": "{{ event.name }}", "txn_id": "{{ payment.reference }}"}' --notification-headers '[{"name":"stripe-signature","template":"{{ stripe_signature(merchant.webhook_secret) }}"}]'

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

API
PATCH/api/v1/payments/gateways/{gatewayKey}
MCP tool
sendmock_payment_gateway_update
In the app
Payments > Gateways > gateway > Save gateway