Version 2026-01-01 · Base URL https://pay.marthaia.com/v1 · OpenAPI document
REST API of the billing platform. Authenticate with `Authorization: Bearer sk_test_…` (the key selects the environment). Amounts are integer minor units with an ISO 4217 currency. Send an `Idempotency-Key` on every POST.
New here? Start with the getting started tutorial. Every operation below lists the key scope it needs and shows a curl command and the matching JavaScript SDK call.
kind ("mobile_money"), gwc_… (every kind of a connection) or gwc_…:kind. Pinned connections skip their own country rule.
cancel_url
string
currency
string
metadata
map
Up to 50 string key/value pairs for your own use.
name
string
price
string
price_… of the catalogue (create only). Give price or price_data.
price_data
object
Custom amount: a hidden product and price are created for it (new price on every change, so paid invoices keep their amount). Fields: amount, currency, description, interval, interval_count, name, type.
kind ("mobile_money"), gwc_… (every kind of a connection) or gwc_…:kind. Pinned connections skip their own country rule.
cancel_url
string
currency
string
metadata
map
Up to 50 string key/value pairs for your own use.
name
string
price
string
price_… of the catalogue (create only). Give price or price_data.
price_data
object
Custom amount: a hidden product and price are created for it (new price on every change, so paid invoices keep their amount). Fields: amount, currency, description, interval, interval_count, name, type.
Provider-managed only. One of: create_prorations, none, always_invoice.
CheckoutCustomer
Customer to create or match (by external_id) for the session.
id
string
Existing cus_…
billing_address
Address
country
string
email
string
external_id
string
Your user id; creates or matches the customer.
locale
string
name
string
phone
string
CheckoutSession
A hosted checkout page for one customer.
idalways
string
cs_…
modealways
string
One of: payment, subscription, setup.
objectalways
string
One of: checkout.session.
statusalways
string
One of: open, complete, expired.
allowed_methods
string[]
amount_total
integer
Minor units.
cancel_url
string
client_reference_id
string
completed_at
timestamp | null
created
integer
Creation time (Unix seconds)
currency
string | null
customer
string | null
cus_…
eligible_methods
string[]
Kinds the customer can use (creation only).
expires_at
timestamp
invoice
string | null
inv_…
items
LineItem[]
locale
string
metadata
map
Up to 50 string key/value pairs for your own use.
setup_payment_method
string | null
pm_…
subscription
string | null
sub_…
success_url
string
url
string
Hosted page; only returned on creation.
CheckoutSessionInput
modealways
string
payment = one-off, subscription = recurring prices, setup = save a method without charging. One of: payment, subscription, setup.
success_urlalways
string
Absolute URL; {SESSION_ID} is replaced.
allowed_methods
string[]
Restrict the offer: kinds ("mobile_money"), connections (gwc_…) or one method (gwc_…:card). Pinned connections skip their own country rule.
cancel_url
string
client_reference_id
string
currency
string
Defaults to the customer’s, then the project’s.
customer
CheckoutCustomer
customer_id
string
Alternative to customer: an existing cus_….
expires_in
integer
Seconds, default from settings (24 h).
items
LineItem[]
Required unless mode is setup.
locale
string
fr or en.
metadata
map
Up to 50 string key/value pairs for your own use.
ConfirmInput
reasonalways
string
confirm
boolean
false to reject; default true.
CurrencyOption
Amount of a price in one currency.
amountalways
integer
Minor units (5000 XAF, 900 = 9.00 USD).
currencyalways
string
ISO 4217.
Customer
A person or company that pays you.
idalways
string
cus_…
objectalways
string
One of: customer.
anonymized
boolean
True once personal data was erased.
billing_address
Address
country
string | null
ISO alpha-2.
created
integer
Creation time (Unix seconds)
currency
string | null
Preferred currency.
default_payment_method
string | null
pm_…
email
string
external_id
string
Your own user id; unique per environment.
locale
string
fr or en.
metadata
map
Up to 50 string key/value pairs for your own use.
name
string
phone
string
E.164.
CustomerInput
Fields to create or update a customer.
billing_address
Address
country
string
ISO alpha-2.
currency
string
ISO 4217.
email
string
external_id
string
Your user id.
locale
string
metadata
map
Up to 50 string key/value pairs for your own use.
name
string
phone
string
Deleted
id
string
deleted
boolean
object
string
EligibleMethod
A payment method the customer can use.
assurance
string
One of: signed, unsigned, no_status_endpoint.
flows
string[]
gateway
string
gateway_connection
string
gwc_…
kind
string
label
string
needs_phone
boolean
operators
Operator[]
Entitlement
Access decision for one product.
entitledalways
boolean
Whether to grant access now.
product_idalways
string
prod_…
entitled_until
timestamp | null
features
map
group_key
string | null
metadata
map
Up to 50 string key/value pairs for your own use.
product_name
string
reason
string
active, grace_period, …
status
string
Subscription status.
subscription_id
string
sub_…
Error
Error envelope returned with every non-2xx response.
erroralways
object
Fields: code, message, type, param, request_id.
Event
Something that happened; also the webhook payload.
idalways
string
evt_…
objectalways
string
One of: event.
typealways
string
e.g. subscription.activated, invoice.paid.
api_version
string
created
integer
Creation time (Unix seconds)
data
object
Fields: object.
Invoice
What a customer owes. The only object that can be paid.
idalways
string
inv_…
objectalways
string
One of: invoice.
statusalways
string
One of: draft, open, paid, void, uncollectible.
amount_due
integer
amount_paid
integer
amount_refunded
integer
attempt_count
integer
billing_reason
string
One of: subscription_create, subscription_cycle, subscription_update, manual, checkout.
checkout_session
string | null
cs_…
collection_method
string
One of: automatic, send_invoice.
created
integer
Creation time (Unix seconds)
currency
string
customer
string
cus_…
customer_snapshot
map
description
string
due_at
timestamp | null
finalized_at
timestamp | null
lines
InvoiceLine[]
metadata
map
Up to 50 string key/value pairs for your own use.
next_attempt_at
timestamp | null
number
string | null
Gap-free number, assigned at finalisation.
paid_at
timestamp | null
period
object
Period this invoice grants (subscription invoices). Fields: end, start.
provider_hosted_url
string | null
provider_invoice_id
string | null
provider_pdf_url
string | null
source
string
subscription
string | null
sub_…
subtotal
integer
tax_total
integer
total
integer
voided_at
timestamp | null
InvoiceInput
Manual invoice.
customeralways
string
cus_…
itemsalways
object[]
auto_finalize
boolean
collection_method
string
One of: automatic, send_invoice.
currency
string
days_until_due
integer
description
string
metadata
map
Up to 50 string key/value pairs for your own use.
InvoiceLine
id
string
il_…
amount
integer
description
string
period
object
Fields: end, start.
price
string | null
price_…
quantity
integer
tax_amount
integer
tax_rate_bp
integer
Basis points.
unit_amount
integer
LineItem
pricealways
string
price_…
quantity
integer
Default 1.
NextAction
What the customer must do next.
typealways
string
One of: redirect, widget, client_secret, ussd_prompt, otp_required, social_links, crypto_address.
address
string
client_secret
string
links
map
social_links: whatsapp, telegram, dikalo, sms.
message
string
otp_length
integer
publishable_key
string
redirect_url
string
OTPInput
codealways
string
Code typed by the customer; never stored.
Operator
A mobile money operator.
id
string
gwo_…
code
string
collection_fee_bp
integer
country
string
enabled
boolean
kind
string
name
string
requires_browser
boolean
requires_otp
boolean
Payment
One attempt to collect an invoice through one gateway.
idalways
string
pay_…
objectalways
string
One of: payment.
statusalways
string
One of: created, requires_action, processing, succeeded, failed, canceled, expired.
amount
integer
country
string | null
created
integer
Creation time (Unix seconds)
currency
string
expires_at
timestamp | null
failure_code
string | null
failure_message
string | null
flow
string
gateway
string
stripe, notchpay, …
gateway_connection
string
gwc_…
initiated_by
string
invoice
string
inv_…
method_kind
string
needs_manual_review
boolean
next_action
NextAction
operator
string | null
otp_attempts_remaining
integer
payer_phone
string | null
Masked.
payment_method
string | null
pm_…
provider_amount
integer | null
provider_currency
string | null
provider_ref
string | null
retryable
boolean
review_reason
string
settled_at
timestamp | null
PaymentLink
A reusable public URL for a price; every visit opens a fresh checkout.
idalways
string
plink_…
objectalways
string
One of: payment_link.
urlalways
string
Share this URL.
active
boolean
allowed_methods
string[]
Pinned methods (kind, gwc_… or gwc_…:kind). Empty = chosen by the buyer’s country and currency.
cancel_url
string
checkouts_completed
integer
checkouts_opened
integer
created
integer
Creation time (Unix seconds)
currency
string
Empty = customer / project default.
items
LineItem[]
metadata
map
Up to 50 string key/value pairs for your own use.
name
string
success_url
string
PaymentLinkInput
active
boolean
Update only.
allowed_methods
string[]
kind ("mobile_money"), gwc_… (every kind of a connection) or gwc_…:kind. Pinned connections skip their own country rule.
cancel_url
string
currency
string
metadata
map
Up to 50 string key/value pairs for your own use.
name
string
price
string
price_… of the catalogue (create only). Give price or price_data.
price_data
object
Custom amount: a hidden product and price are created for it (new price on every change, so paid invoices keep their amount). Fields: amount, currency, description, interval, interval_count, name, type.