Skip to main content
POST
Create a subscription

Amount unit

Send amount in major units by default: 4.01 for 4.01 USD/EUR. API clients that already send cents can set amount_unit: "MINOR" at the root of the JSON body, alongside amount and currency, rather than in metadata. Public responses return major units even when the request uses MINOR. See amounts and currencies.

Authorizations

x-sp-auth-token
string
header
required

Bearer token obtained with the client_id and client_secret of the application created in SoleasPay. Format: Bearer <access_token>.

Headers

X-Idempotency-Key
string

Optional idempotency key provided by the merchant.

Body

application/json
customer_email
string<email>
required
amount
number
required

Amount in major units by default: 4.01 for 4.01 USD/EUR. With root-level amount_unit MINOR, send integer cents (401).

currency
string
required
Example:

"XAF"

frequency
enum<string>
required
Available options:
DAILY,
WEEKLY,
MONTHLY,
QUARTERLY,
YEARLY
customer_phone_number
string
description
string
metadata
object
idempotency_key
string
amount_unit
enum<string>
default:MAJOR

Unit of request amounts. Optional, MAJOR by default. Put this field at the root of the JSON body, not in metadata. MINOR preserves amounts already expressed in the smallest unit.

Available options:
MAJOR,
MINOR
Example:

"MAJOR"

Response

Souscription retournee

code
integer
Example:

200

success
boolean
Example:

true

locale
string
Example:

"fr"

message
string
meta
object
data
object