Skip to main content
POST
/
subscriptions
Create a subscription for a customer
curl --request POST \
  --url https://api.orafi.app/v1/subscriptions \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "customerId": "<string>",
  "planId": "<string>",
  "network": "SUI"
}
'
{
  "success": true,
  "message": "Subscription created",
  "data": {
    "checkoutUrl": "<string>",
    "subscription": {
      "id": "sub_abc123",
      "customerId": "<string>",
      "planId": "<string>",
      "network": "SUI",
      "startsAt": "2023-11-07T05:31:56Z",
      "endsAt": "2023-11-07T05:31:56Z",
      "canceledAt": "2023-11-07T05:31:56Z",
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z",
      "plan": {
        "id": "plan_abc123",
        "name": "Basic Monthly",
        "amount": 9.99,
        "currency": "USDC",
        "createdAt": "2023-11-07T05:31:56Z",
        "updatedAt": "2023-11-07T05:31:56Z"
      }
    }
  }
}
Creates a subscription for an existing customer based on a plan. The initial subscription creation generates a payment transaction which the customer completes to activate the subscription.

Authorizations

x-api-key
string
header
required

API key for merchant authentication required for most endpoints

Body

application/json
customerId
string
required
planId
string
required
network
enum<string>
required

Network for subscription payments

Available options:
SUI

Response

Subscription created

success
boolean
Example:

true

message
string
Example:

"Subscription created"

data
object