moat developer docs

Build payment integrations on moat's API. Accept cards, ACH, and digital wallets — with built-in surcharge support.

Get started in five minutes

Three steps to your first live transaction:

  1. Grab your API keys from Settings → API Keys in your Control Panel.
  2. Send a test charge against the sandbox using the /api/transaction endpoint.
  3. Handle the response and move to production when you're ready.

Read the full Quickstart →

You will have two keys

A public key (pub_...) for client-side tokenization, and a secret API key (api_...) for server-side calls. Public keys can ship in browser code; secret keys never should.

What are you building?

Pick the integration path that matches your use case:

If you want to...Start here
Accept one-time payments on a websiteTokenizer — hosted payment fields
Save cards for repeat customersCustomer Vault
Set up subscriptions or recurring billingRecurring API
Send a payment linkSimple Payments
Add Apple Pay or Google PayWalletJS
Integrate with WooCommerceWooCommerce plugin
Recover card processing feesFee Programs

Core APIs

Transactions

Process payments, capture authorizations, issue refunds, and query history.

EndpointDescription
Sale / AuthCharge cards, ACH, or stored payment methods
CaptureCapture a previously authorized amount
RefundRefund a settled transaction in full or part
VoidCancel a transaction before settlement
SearchQuery transaction history with filters

Customer & recurring

Store payment credentials and bill customers on a schedule.

EndpointDescription
Customer VaultCreate, update, and charge stored customers
RecurringSubscription plans and scheduled payments

Other endpoints

EndpointDescription
InvoicesCreate and send payment requests
BatchUpload transaction files for processing
BIN LookupCard metadata and surchargeability by BIN
Settlement BatchesDaily settlement records
TerminalsPhysical terminal integrations
Custom FieldsAttach custom data to transactions
CartShopping cart management

Services & tools

ServiceWhat it doesBest for
TokenizerHosted payment form delivered in an iframeKeeping your site out of PCI scope
Simple PaymentsHosted "Pay Now" checkout pageQuick setup without custom code
WebhooksReal-time event notificationsAutomating downstream workflows
Fraud ProtectionRisk scoring and decision rulesReducing chargebacks and fraud losses
WalletJSApple Pay and Google Pay buttonsMobile-friendly checkout

Integration workflows

Step-by-step guides for common patterns:

WorkflowDescription
Tokenizer → Customer → PaymentCollect a card, save it to the vault, charge it later
Invoice PaymentCreate an invoice, send the link, collect payment
Duplicate DetectionPrevent accidental double charges with idempotency keys
Fee ProgramsSurcharge, cash discount, and dual pricing

E-commerce plugins

Pre-built integrations for popular platforms:

PlatformStatus
WooCommerceWordPress e-commerce
MagentoEnterprise e-commerce
Gravity FormsWordPress forms

Testing

Sandbox environment

All development runs against the sandbox. It accepts the same requests as production but never moves real money. Use the test card numbers on the Test Data page to simulate approvals, declines, partial auths, and other scenarios.

A few test cards to start with

Card numberResult
4111111111111111Approved
4000000000000002Declined
4000000000009995Insufficient funds
4000000000000051Partial approval (half the amount)

View the full test data reference →

Quick reference

Authentication

Every API request carries your secret key in the Authorization header:

-H "Authorization: YOUR_API_KEY"

Request format

  • Content-Type: application/json
  • Method: POST for create operations, GET for reads
  • Amounts: always in cents — 1000 means $10.00

Response format

{
  "status": "success",
  "msg": "success",
  "data": { }
}

Common response codes

CodeMeaning
100Approved
200Declined
201Declined — call issuer
300Gateway error

Full request & response documentation →

Need help?

  • API errors: check the msg field on the response — it explains what went wrong.
  • Integration questions: walk through the Workflows for the common patterns.
  • Testing problems: confirm you're pointing at sandbox and using the documented test data.
  • Account issues: reach support through your Control Panel.