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

API reference

Payment methods

POST/api/v1/payments/methods

Add a custom method.

CLI
sendmock payments methods create
MCP tool
sendmock_payment_method_create
In the app
Payments > Methods > Add method

Request body (application/json)

PaymentMethodInput : Body of POST and PATCH /api/v1/payments/methods; key and flow are fixed after creation.

FieldTypeDescription
keystring
The method's key; fixed after creation.Example: upay_wallet
namestring
The method's name on checkout pages.Example: Upay wallet
flowstring
The key of the flow its checkout runs.Example: wallet
accentstring
#rrggbb, used on checkout pages.Example: #e2136e
is_enabledboolean
Off methods are hidden on checkout pages.Example: true
test_cardsTestCardValue[]
Read by a card form step.
test_numbersTestNumberValue[]
Read by an account number or voucher code step.
otpstring
Read by an OTP step.Example: 123456
pinstring
Read by a PIN step.Example: 12121
default_outcome"succeed" | "decline"
The outcome when the flow has no deciding step.One of: succeed, declineExample: succeed
test_accountstring
Read by a signed-in account step.Example: [email protected]

Answer

201 PaymentMethodDefinition

Errors: 400, as { error: { code, message } }

Try it in Demo mode

PATCH/api/v1/payments/methods/{methodKey}

Change a method.

CLI
sendmock payments methods update <methodKey>
MCP tool
sendmock_payment_method_update
In the app
Payments > Methods > method > Save method, enabled switch

Request body (application/json)

PaymentMethodInput : Body of POST and PATCH /api/v1/payments/methods; key and flow are fixed after creation.

FieldTypeDescription
keystring
The method's key; fixed after creation.Example: upay_wallet
namestring
The method's name on checkout pages.Example: Upay wallet
flowstring
The key of the flow its checkout runs.Example: wallet
accentstring
#rrggbb, used on checkout pages.Example: #e2136e
is_enabledboolean
Off methods are hidden on checkout pages.Example: true
test_cardsTestCardValue[]
Read by a card form step.
test_numbersTestNumberValue[]
Read by an account number or voucher code step.
otpstring
Read by an OTP step.Example: 123456
pinstring
Read by a PIN step.Example: 12121
default_outcome"succeed" | "decline"
The outcome when the flow has no deciding step.One of: succeed, declineExample: succeed
test_accountstring
Read by a signed-in account step.Example: [email protected]

Answer

200 PaymentMethodDefinition

Errors: 400, 404, as { error: { code, message } }

Try it in Demo mode