Skip to content

Create a billing account

POST
/customers

Creates a billing account for the authenticated caller. The owning userId and tenantId are derived from the auth context (@CurrentUser, sourced from the forwarded x-karmo-* claim headers); only gatewayId is accepted in the request body because identity is still owned by the auth context. Callers without a tenantId (e.g. internal / admin tokens) are rejected with 403.

object
gatewayId
required

The payment gateway to register the customer against.

string format: uuid

Billing account created

object
id
required
string format: uuid
userId
required
string
tenantId
required
string
email
string | null format: email
paymentGatewayId
required
string format: uuid
gatewayCustomerRef
required
string
createdAt
required
string format: date-time
updatedAt
required
string format: date-time

Payment gateway not found

object
type
required
string format: uri
title
required
string
status
required
integer
detail
string
instance
string
karmoCode
required
string
/^[0-9]{8}$/
karmoErrors
Array<object>
object
detail
required
string
pointer
required
string
karmoMeta
object
key
additional properties
any

A billing account already exists for this caller

object
type
required
string format: uri
title
required
string
status
required
integer
detail
string
instance
string
karmoCode
required
string
/^[0-9]{8}$/
karmoErrors
Array<object>
object
detail
required
string
pointer
required
string
karmoMeta
object
key
additional properties
any