API · Direct

Payment Methods

Tokenise a card, mobile wallet, or bank account once; reference the pm_ token on future charges. Sensitive PAN/CVC never reach your origin — they're posted directly from js.merashub.com to MerasPay's vault.

4 endpointspm_

Endpoints

POST/v1/payment_methods

Tokenise a card / mobile / bank payload into pm_.

GET/v1/payment_methods

List payment methods (filter by customer).

GET/v1/payment_methods/{id}

Retrieve a tokenised payment method.

POST/v1/payment_methods/{id}/detach

Remove the customer link.

Create

NameTypeDescription
type
required
enumcard · mobile_wallet · bank_account · agent_cash
customercus_Attach to a customer for re-use.
cardobjectFor type=card: { number, exp_month, exp_year, cvc, holder? }. Server-side only; for the browser flow, use Elements.
mobile_walletobjectFor type=mobile_wallet: { provider, msisdn }
bank_accountobjectFor type=bank_account: { provider, bank_name?, account_no, holder_name? }
billing_addressobjectAVS / 3DS2 enrichment fields.
metadatamapFree-form key/value.

Sample · tokenise a mobile wallet

bashbash
curl -X POST https://api.merashub.com/v1/payment_methods \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "type": "mobile_wallet",
    "customer": "cus_01HZ...",
    "mobile_wallet": { "provider": "waafi", "msisdn": "+25377xxxxxxx" }
  }'
201 Createdjson
{
  "id": "pm_01HZF...",
  "type": "mobile_wallet",
  "provider": "waafi",
  "msisdn": "+25377xxxxxxx",
  "customer_id": "cus_01HZ..."
}

Reference a pm_ on a future charge

POST /v1/payment_intents accepts payment_method: "pm_…" instead of inline fields. The provider, MSISDN/account, and customer are resolved from the token.

Card tokenisation is browser-side

Card fields must be tokenised via @meraspay/sdk-js Elements — server-side card creation is restricted to PCI-certified callers. See the Card integration guide.