Skip to main content
POST
/
api
/
v1
/
subscription
/
subscribe
Subscribe to a plan
curl --request POST \
  --url https://payments.oaknetwork.org/api/v1/subscription/subscribe \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "plan_id": "<string>",
  "source_customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "destination_customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "payment_method_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "payment_method_type": "CARD",
  "payment_method_provider": "<string>",
  "fee_bearer": "connected_account"
}
'
{
  "msg": "Subscription created successfully",
  "data": {
    "id": "<string>",
    "status": "pending_activation",
    "sub_status": "payment_init"
  }
}

Authorizations

Authorization
string
header
required

Merchant authentication token. Obtained via POST /api/v1/merchant/token/grant. Pass as: Authorization: Bearer

Body

application/json
plan_id
string
required

Plan hash ID

source_customer_id
string<uuid>
required
destination_customer_id
string<uuid>
required
payment_method_id
string<uuid>
required
payment_method_type
enum<string>
required
Available options:
CARD
payment_method_provider
string
required
fee_bearer
enum<string>
required
Available options:
connected_account

Response

Subscription created

msg
string
required

Human-readable message describing the result

Example:

"Subscription created successfully"

data
object
required

Response payload (null on error)