Skip to content

Pay as a known customer

Charge a customer by its id, and what a known customer changes on the checkout page.

Once you hold an id, from the customer object of an earlier payment or from POST /customers, pass it and skip the contact fields entirely. The customer field accepts the id as a plain string, and customer_id accepts the same value; they are two spellings of one thing.

curl https://api.wajub.com/payments \
  -H "Authorization: sk_test.xxxxxxxxxxxxxxxx…" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 5000,
    "currency": "XAF",
    "customer": "cus_test_sAaim5apjocIgtlhzJY3wQ8s",
    "reference": "order-4173"
  }'

The identifier does not have to be an id. If the value you pass matches no customer id, Wajub tries it as a phone number, then as an email address. So "customer": "amina@example.com" and "customer": "+237670000000" both resolve, which is convenient when your own database stores the email and not the Wajub id.

What a customer changes on the checkout page

This is the part that pays for the extra call. A payment attached to a known customer renders a different page.

What the customer carriesWhat the checkout does with it
Past cards and Mobile Money numbersOffers them as one-tap saved methods, default first, ten at most
preferred_languageSets the page locale, unless the team or branding setting overrides it
currencyBecomes the pre-selected currency when auto-convert is enabled

Saved methods are the real win for returning payers: the number is already there, masked, and they confirm on the handset without typing it again.

Saving a method is the payer's decision

A card or Mobile Money number is only kept when the payer ticks the box on the checkout page. It is never inferred and never defaulted on, so a customer record with no saved methods is the normal state until someone opts in. Only cards and Mobile Money are reusable; wallets and bank transfers are not stored.

What did you think of this content?