# Create charge for a customer via mobile `POST https://api.leapa.co/v2/charges/mobile` Charge a mobile money wallet directly, without an invoice behind it. Send the payer a code first with Send a one-time code, then call this with that code in otp. Until a valid code arrives the endpoint answers 428 Precondition Required. Send your API key as a bearer token in the `Authorization` header. ## Request body Required. `application/json`. - `amount` · _integer_ · **required** — Amount to charge, in the smallest unit the currency uses. BIF has no minor unit, so 45000 is 45,000 francs. - `currency` · _string_ · **required** — Currency of the charge. It has to match the currency account your API key was issued for. Allowed values: `BIF`, `USD`, `KES`, `XAF` - `description` · _string_ · **required** — What the payment is for. Shown in your Leapa dashboard and on the payer’s statement. Must be: 5 to 100 characters - `customer` · _CustomerRequestMobile_ — A new customer to create and charge in one call. Send this or customer_id, not both. - `email` · _string_ — Customer's email address. Constraints: Not null, Valid email format - `address` · _AddressRequestGeneric_ - `city` · _string_ · **required** — City. Constraints: Not null, Size(min=3, max=90) Must be: 3 to 90 characters - `state` · _string_ — State. Constraints: Size(min=1, max=90) Must be: 1 to 90 characters - `type` · _string_ · **required** — The type of address. Constraints: Not null Allowed values: `personal`, `business` - `country` · _string_ · **required** — 2 letter ISO Country Code. Constraints: Not null, Size(min=2, max=3) Allowed values: `AD`, `AND`, `AE`, `ARE`, `AF`, `AFG`, `AG`, `ATG`, `AI`, `AIA`, `AL`, `ALB`, `AM`, `ARM`, `AN`, `ANT`, `AO`, `AGO`, `AQ`, `ATA`, `AR`, `ARG`, `AS`, `ASM`, `AT`, `AUT`, `AU`, `AUS`, `AW`, `ABW`, `AX`, `ALA`, `AZ`, `AZE`, `BA`, `BIH`, `BB`, `BRB`, `BD`, `BGD`, `BE`, `BEL`, `BF`, `BFA`, `BG`, `BGR`, `BH`, `BHR`, `BI`, `BDI`, `BJ`, `BEN`, `BL`, `BLM`, `BM`, `BMU`, `BN`, `BRN`, `BO`, `BOL`, `BQ`, `BES`, `BR`, `BRA`, `BS`, `BHS`, `BT`, `BTN`, `BV`, `BVT`, `BW`, `BWA`, `BY`, `BLR`, `BZ`, `BLZ`, `CA`, `CAN`, `CC`, `CCK`, `CD`, `COD`, `CF`, `CAF`, `CG`, `COG`, `CH`, `CHE`, `CI`, `CIV`, `CK`, `COK`, `CL`, `CHL`, `CM`, `CMR`, `CN`, `CHN`, `CO`, `COL`, `CR`, `CRI`, `CU`, `CUB`, `CV`, `CPV`, `CW`, `CUW`, `CX`, `CXR`, `CY`, `CYP`, `CZ`, `CZE`, `DE`, `DEU`, `DJ`, `DJI`, `DK`, `DNK`, `DM`, `DMA`, `DO`, `DOM`, `DZ`, `DZA`, `EC`, `ECU`, `EE`, `EST`, `EG`, `EGY`, `EH`, `ESH`, `ER`, `ERI`, `ES`, `ESP`, `ET`, `ETH`, `FI`, `FIN`, `FJ`, `FJI`, `FK`, `FLK`, `FM`, `FSM`, `FO`, `FRO`, `FR`, `FRA`, `GA`, `GAB`, `GB`, `GBR`, `GD`, `GRD`, `GE`, `GEO`, `GF`, `GUF`, `GG`, `GGY`, `GH`, `GHA`, `GI`, `GIB`, `GL`, `GRL`, `GM`, `GMB`, `GN`, `GIN`, `GP`, `GLP`, `GQ`, `GNQ`, `GR`, `GRC`, `GS`, `SGS`, `GT`, `GTM`, `GU`, `GUM`, `GW`, `GNB`, `GY`, `GUY`, `HK`, `HKG`, `HM`, `HMD`, `HN`, `HND`, `HR`, `HRV`, `HT`, `HTI`, `HU`, `HUN`, `ID`, `IDN`, `IE`, `IRL`, `IL`, `ISR`, `IM`, `IMN`, `IN`, `IND`, `IO`, `IOT`, `IQ`, `IRQ`, `IR`, `IRN`, `IS`, `ISL`, `IT`, `ITA`, `JE`, `JEY`, `JM`, `JAM`, `JO`, `JOR`, `JP`, `JPN`, `KE`, `KEN`, `KG`, `KGZ`, `KH`, `KHM`, `KI`, `KIR`, `KM`, `COM`, `KN`, `KNA`, `KP`, `PRK`, `KR`, `KOR`, `KW`, `KWT`, `KY`, `CYM`, `KZ`, `KAZ`, `LA`, `LAO`, `LB`, `LBN`, `LC`, `LCA`, `LI`, `LIE`, `LK`, `LKA`, `LR`, `LBR`, `LS`, `LSO`, `LT`, `LTU`, `LU`, `LUX`, `LV`, `LVA`, `LY`, `LBY`, `MA`, `MAR`, `MC`, `MCO`, `MD`, `MDA`, `ME`, `MNE`, `MF`, `MAF`, `MG`, `MDG`, `MH`, `MHL`, `MK`, `MKD`, `ML`, `MLI`, `MM`, `MMR`, `MN`, `MNG`, `MO`, `MAC`, `MP`, `MNP`, `MQ`, `MTQ`, `MR`, `MRT`, `MS`, `MSR`, `MT`, `MLT`, `MU`, `MUS`, `MV`, `MDV`, `MW`, `MWI`, `MX`, `MEX`, `MY`, `MYS`, `MZ`, `MOZ`, `NA`, `NAM`, `NC`, `NCL`, `NE`, `NER`, `NF`, `NFK`, `NG`, `NGA`, `NI`, `NIC`, `NL`, `NLD`, `NO`, `NOR`, `NP`, `NPL`, `NR`, `NRU`, `NU`, `NIU`, `NZ`, `NZL`, `OM`, `OMN`, `PA`, `PAN`, `PE`, `PER`, `PF`, `PYF`, `PG`, `PNG`, `PH`, `PHL`, `PK`, `PAK`, `PL`, `POL`, `PM`, `SPM`, `PN`, `PCN`, `PR`, `PRI`, `PS`, `PSE`, `PT`, `PRT`, `PW`, `PLW`, `PY`, `PRY`, `QA`, `QAT`, `RE`, `REU`, `RO`, `ROU`, `RS`, `SRB`, `RU`, `RUS`, `RW`, `RWA`, `SA`, `SAU`, `SB`, `SLB`, `SC`, `SYC`, `SD`, `SDN`, `SE`, `SWE`, `SG`, `SGP`, `SH`, `SHN`, `SI`, `SVN`, `SJ`, `SJM`, `SK`, `SVK`, `SL`, `SLE`, `SM`, `SMR`, `SN`, `SEN`, `SO`, `SOM`, `SR`, `SUR`, `SS`, `SSD`, `ST`, `STP`, `SV`, `SLV`, `SX`, `SXM`, `SY`, `SYR`, `SZ`, `SWZ`, `TC`, `TCA`, `TD`, `TCD`, `TF`, `ATF`, `TG`, `TGO`, `TH`, `THA`, `TJ`, `TJK`, `TK`, `TKL`, `TL`, `TLS`, `TM`, `TKM`, `TN`, `TUN`, `TO`, `TON`, `TR`, `TUR`, `TT`, `TTO`, `TV`, `TUV`, `TW`, `TWN`, `TZ`, `TZA`, `UA`, `UKR`, `UG`, `UGA`, `UM`, `UMI`, `US`, `USA`, `UY`, `URY`, `UZ`, `UZB`, `VA`, `VAT`, `VC`, `VCT`, `VE`, `VEN`, `VG`, `VGB`, `VI`, `VIR`, `VN`, `VNM`, `VU`, `VUT`, `WF`, `WLF`, `WS`, `WSM`, `YE`, `YEM`, `YT`, `MYT`, `ZA`, `ZAF`, `ZM`, `ZMB`, `ZW`, `ZWE` - `zip` · _string_ — Zip. Constraints: Size(min=1, max=15) Must be: 1 to 15 characters - `line1` · _string_ · **required** — Line 1. Constraints:Not null, Size(min=1, max=90) Must be: 1 to 90 characters - `line2` · _string_ · **required** — Line 2. Constraints: Size(min=1, max=90) Must be: 1 to 90 characters - `first_name` · _string_ — Customer's firstname. Constraints: Size(min=3, max=30) Must be: at most 30 characters - `last_name` · _string_ — Customer's lastName. Constraints: Size(min=3, max=30) Must be: at most 30 characters - `birth_date` · _string_ — Customer's birthdate. Constraints: format(YYYY-MM-DD) Must be: matches ^\d{4}-\d{2}-\d{2}$ - `phone_number` · _string_ — Customer's phone number. Constraints: only digit 0-9 and Size(min=1, max=15) Must be: matches ^\+?(?:[0-9] ?){6,14}[0-9]$ - `source` · _MobileRequest_ — The mobile money wallet to charge. Send this or source_id, not both. - `brand` · _string_ · **required** — Customer mobile money brand) Allowed values: `ecocash`, `enoti`, `ibb+`, `pesaflash`, `brb`, `bcb`, `bancobu`, `bbci`, `ibb`, `bgf`, `finbank`, `ecobank`, `dtbb`, `kcb`, `crdb`, `bcab`, `bije`, `bhb`, `bidf`, `rnp`, `bfb`, `bll`, `codem`, `cecf`, `corilac`, `difo`, `dukuze`, `eden`, `elite`, `fadeco`, `guilgal`, `hfm`, `hpf`, `ihela`, `inyeryeri`, `inyishu`, `ishaka`, `isoko`, `kaze`, `kazoza`, `champions`, `microbu`, `mutec`, `receca`, `sofepac`, `sopec`, `tujane`, `turame`, `twikangure`, `twitezimbere`, `umubano`, `umuco`, `umurezi`, `wise`, `access`, `baomi`, `cafo`, `cecm`, `cecco`, `cecadm`, `cecd`, `cdec`, `cospec`, `fenacobu`, `fscj`, `fsts`, `fste`, `isigi`, `mupad`, `cecabu`, `meci`, `pivot`, `mec-alpha`, `micropol`, `urunani`, `socade`, `sumaco`, `sepac`, `ucode`, `mani`, `imuhira`, `agrinova`, `lumicash`, `cashtel`, `leapa`, `other` - `currency` · _string_ · **required** — Currency code Allowed values: `BIF`, `USD`, `KES`, `XAF` - `number` · _string_ · **required** — Customer mobile money number) - `country_code` · _string_ · **required** — Customer mobile money country code) Allowed values: `BI` - `default` · _boolean_ · **required** — Indicating whether this payment method is the default sources of payment. Constraints: Not null - `source_id` · _string_ — A wallet already saved on the customer. Send this or source. - `customer_id` · _string_ — An existing customer to charge. Send this or customer. - `captured` · _boolean_ · **required** — Whether to immediately capture the charge or not. - `invoice_reference_id` · _string_ — Your own id for the bill this charge settles, echoed back on the charge. It does not create or settle a Leapa invoice. - `customer_reference_id` · _string_ — Your own id for the customer, echoed back on the charge so you can match it to your records. - `otp` · _string_ — The six-digit code the payer received from Send a one-time code. The charge answers 428 until you send a valid one. Must be: 6 to 6 characters ```json { "amount": 45000, "currency": "BIF", "description": "Room 204, two nights", "customer": { "email": "jeanne@example.com", "address": { "city": "string", "state": "string", "type": "personal", "country": "AD", "zip": "string", "line1": "string", "line2": "string" }, "first_name": "Jeanne", "last_name": "Ndayishimiye", "birth_date": "2026-01-31", "phone_number": "+25779123456" }, "source": { "brand": "ecocash", "currency": "BIF", "number": "string", "country_code": "BI", "default": false }, "source_id": "src_0e7b3c95af", "customer_id": "cus_3d8e51fa20", "captured": false, "invoice_reference_id": "string", "customer_reference_id": "string", "otp": "string" } ``` ## Response 201 - `id` · _string_ - `object` · _string_ - `amount` · _integer_ - `currency` · _string_ Allowed values: `BIF`, `USD`, `KES`, `XAF` - `description` · _string_ - `status` · _string_ Allowed values: `succeeded`, `paid`, `pending`, `failed` - `source` · _SourceObject_ - `id` · _string_ — Source id - `brand` · _string_ — Payment Method Brand Name: Either Mastercard, Visa or Ecocash(Mobile Money) Allowed values: `ecocash`, `lumicash`, `mastercard`, `visa` - `funding` · _string_ — Card funding type. Either credit, debit, prepaid, or unknown Allowed values: `credit`, `debit`, `prepaid`, `unknown` - `last4` · _string_ — Last Four ditgits of the card - `email` · _string_ — Email of the card Owner. - `fingerprint` · _string_ — Unique identifier of the card number as returned by the CyberSource TMS API - `token` · _string_ — Unique identifier of the card data as returned by the CyberSource TMS API - `language` · _string_ — Prefered Language of the Customer. Used for Mobile Money. - `number` · _string_ — The mobile money number. - `cvc_check` · _string_ — Card Verification Code check result Allowed values: `pass`, `fail`, `unavailable`, `unchecked` - `exp_month` · _string_ — Two digit number representing the expiration number - `exp_year` · _string_ — Four digit number representing the expiration date - `statement_descriptor` · _string_ — Provides information about the charge that customers see on their statements. Maximum 22 characters. - `country_code` · _string_ — Country Code, needed when the Payment Method is Mobile Money. - `affiliate` · _string_ Allowed values: `dwelinn` - `amount_refunded` · _integer_ - `available_date` · _integer_ - `captured` · _boolean_ - `created_date` · _integer_ - `disputed` · _boolean_ - `failure_code` · _string_ - `failure_message` · _string_ - `invoice_id` · _string_ - `live` · _boolean_ - `modified_date` · _integer_ - `refunded` · _boolean_ - `customer_id` · _string_ - `processing_id` · _string_ - `quittance_number` · _string_ ```json { "id": "obj_5f21c8a40b", "object": "string", "amount": 45000, "currency": "BIF", "description": "Room 204, two nights", "status": "succeeded", "source": { "id": "obj_5f21c8a40b", "brand": "ecocash", "funding": "credit", "last4": "string", "email": "jeanne@example.com", "fingerprint": "string", "token": "string", "language": "string", "number": "string", "cvc_check": "pass", "exp_month": "string", "exp_year": "string", "statement_descriptor": "string", "country_code": "string" }, "affiliate": "dwelinn", "amount_refunded": 45000, "available_date": 0, "captured": false, "created_date": 0, "disputed": false, "failure_code": "string", "failure_message": "string", "invoice_id": "inv_7c1f9a2b48", "live": false, "modified_date": 0, "refunded": false, "customer_id": "cus_3d8e51fa20", "processing_id": "string", "quittance_number": "string" } ``` ## Status codes - `201` Created - `400` Bad request - `401` Unauthorized - `402` Payment required - `403` Forbidden - `404` Not found - `428` Precondition required - `500` Server error ## Example ```bash curl -X POST "https://api.leapa.co/v2/charges/mobile" \ -H "Authorization: Bearer $LEAPA_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "amount": 45000, "currency": "BIF", "description": "Room 204, two nights", "customer": { "email": "jeanne@example.com", "address": { "city": "string", "state": "string", "type": "personal", "country": "AD", "zip": "string", "line1": "string", "line2": "string" }, "first_name": "Jeanne", "last_name": "Ndayishimiye", "birth_date": "2026-01-31", "phone_number": "+25779123456" }, "source": { "brand": "ecocash", "currency": "BIF", "number": "string", "country_code": "BI", "default": false }, "source_id": "src_0e7b3c95af", "customer_id": "cus_3d8e51fa20", "captured": false, "invoice_reference_id": "string", "customer_reference_id": "string", "otp": "string" }' ``` --- _Generated from the Leapa documentation at leapa.co/docs._