Skip to main content
POST
/
subscriptions
/
plans
Create a subscription plan
curl --request POST \
  --url https://api.orafi.app/v1/subscriptions/plans \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "name": "<string>",
  "amount": 9.99,
  "currency": "USDC",
  "trialDays": 5
}
'
{
  "success": true,
  "message": "Subscription plan created",
  "data": {
    "id": "plan_abc123",
    "name": "Basic Monthly",
    "amount": 9.99,
    "currency": "USDC",
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z"
  }
}
Create a new subscription plan for your business.

Authorizations

x-api-key
string
header
required

API key for merchant authentication required for most endpoints

Body

application/json
name
string
required
duration
enum<string>
required
Available options:
WEEKLY,
MONTHLY,
SIX_MONTHS,
YEARLY
amount
number
required

Plan amount

Example:

9.99

currency
string
required

Currency code (3-letter) for the plan

Example:

"USDC"

trialDays
integer

Number of days to offer as trial before first payment

Example:

5

Response

Subscription plan created

success
boolean
Example:

true

message
string
Example:

"Subscription plan created"

data
object