Plans
What you sell and how often you charge.
https://sandbox-api.mysubbyapp.com/v1
POST
/plansCreate a plan
Metered on successful live writesplans:write
Request example
curl --request POST \
--url 'https://sandbox-api.mysubbyapp.com/v1/plans' \
--header 'Authorization: Bearer sk_test_YOUR_SECRET_KEY'Add a JSON body matching the request schema below and a Content-Type: application/json header.
Parameters
Idempotency-Keyheader · string Makes retries safe. Replays return the original response and are not metered.
Request body schema
{
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"name",
"amount",
"currency",
"billing_cycle"
],
"properties": {
"name": {
"type": "string",
"maxLength": 120
},
"description": {
"type": "string",
"maxLength": 500
},
"amount": {
"type": "integer",
"minimum": 100,
"description": "Kobo."
},
"currency": {
"type": "string",
"enum": [
"NGN"
]
},
"billing_cycle": {
"type": "string",
"enum": [
"daily",
"weekly",
"monthly",
"quarterly",
"per_delivery"
]
},
"trial_days": {
"type": "integer",
"minimum": 0,
"maximum": 365,
"default": 0
},
"pause_enabled": {
"type": "boolean",
"default": false
},
"pro_rate": {
"type": "boolean",
"default": true
},
"overage_per_unit": {
"type": [
"integer",
"null"
],
"description": "Kobo per unit reported with unit records."
},
"category": {
"type": "string",
"description": "Vertical key, e.g. waste_management, diesel_supply, gym_fitness."
},
"service_config": {
"type": "object",
"additionalProperties": true
},
"retry_logic": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"default": true
},
"max_attempts": {
"type": "integer",
"minimum": 0,
"maximum": 8,
"default": 3
},
"retry_intervals_days": {
"type": "array",
"items": {
"type": "integer",
"minimum": 1,
"maximum": 30
},
"default": [
1,
3,
7
]
},
"escalation_on_failure": {
"type": "string",
"enum": [
"pause_service",
"restrict_access",
"hold_delivery",
"none"
],
"default": "pause_service"
},
"cancel_after_days_unpaid": {
"type": [
"integer",
"null"
],
"minimum": 1,
"maximum": 180,
"default": 30
}
}
},
"reminders": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"default": true
},
"channels": {
"type": "array",
"items": {
"type": "string",
"enum": [
"whatsapp",
"sms",
"email"
]
},
"default": [
"whatsapp",
"sms",
"email"
]
},
"pre_due_days": {
"type": "array",
"items": {
"type": "integer",
"minimum": 1,
"maximum": 30
},
"default": [
3
]
},
"post_due_days": {
"type": "array",
"items": {
"type": "integer",
"minimum": 1,
"maximum": 60
},
"default": [
1,
3
]
}
}
},
"metadata": {
"type": "object",
"maxProperties": 20,
"propertyNames": {
"maxLength": 40
},
"additionalProperties": {
"type": "string",
"maxLength": 500
}
}
}
},
"example": {
"name": "Pro Monthly",
"amount": 500000,
"currency": "NGN",
"billing_cycle": "monthly",
"retry_logic": {
"enabled": true,
"max_attempts": 3,
"retry_intervals_days": [
1,
3,
7
],
"escalation_on_failure": "pause_service",
"cancel_after_days_unpaid": 30
},
"reminders": {
"enabled": true,
"channels": [
"whatsapp",
"sms",
"email"
],
"pre_due_days": [
3
],
"post_due_days": [
1,
3
]
}
}
}
}
}Responses
201 The created plan.
{
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"const": true
},
"data": {
"allOf": [
{
"type": "object",
"required": [
"name",
"amount",
"currency",
"billing_cycle"
],
"properties": {
"name": {
"type": "string",
"maxLength": 120
},
"description": {
"type": "string",
"maxLength": 500
},
"amount": {
"type": "integer",
"minimum": 100,
"description": "Kobo."
},
"currency": {
"type": "string",
"enum": [
"NGN"
]
},
"billing_cycle": {
"type": "string",
"enum": [
"daily",
"weekly",
"monthly",
"quarterly",
"per_delivery"
]
},
"trial_days": {
"type": "integer",
"minimum": 0,
"maximum": 365,
"default": 0
},
"pause_enabled": {
"type": "boolean",
"default": false
},
"pro_rate": {
"type": "boolean",
"default": true
},
"overage_per_unit": {
"type": [
"integer",
"null"
],
"description": "Kobo per unit reported with unit records."
},
"category": {
"type": "string",
"description": "Vertical key, e.g. waste_management, diesel_supply, gym_fitness."
},
"service_config": {
"type": "object",
"additionalProperties": true
},
"retry_logic": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"default": true
},
"max_attempts": {
"type": "integer",
"minimum": 0,
"maximum": 8,
"default": 3
},
"retry_intervals_days": {
"type": "array",
"items": {
"type": "integer",
"minimum": 1,
"maximum": 30
},
"default": [
1,
3,
7
]
},
"escalation_on_failure": {
"type": "string",
"enum": [
"pause_service",
"restrict_access",
"hold_delivery",
"none"
],
"default": "pause_service"
},
"cancel_after_days_unpaid": {
"type": [
"integer",
"null"
],
"minimum": 1,
"maximum": 180,
"default": 30
}
}
},
"reminders": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"default": true
},
"channels": {
"type": "array",
"items": {
"type": "string",
"enum": [
"whatsapp",
"sms",
"email"
]
},
"default": [
"whatsapp",
"sms",
"email"
]
},
"pre_due_days": {
"type": "array",
"items": {
"type": "integer",
"minimum": 1,
"maximum": 30
},
"default": [
3
]
},
"post_due_days": {
"type": "array",
"items": {
"type": "integer",
"minimum": 1,
"maximum": 60
},
"default": [
1,
3
]
}
}
},
"metadata": {
"type": "object",
"maxProperties": 20,
"propertyNames": {
"maxLength": 40
},
"additionalProperties": {
"type": "string",
"maxLength": 500
}
}
}
},
{
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "plan_8ZpR1v"
},
"object": {
"const": "plan"
},
"status": {
"type": "string",
"enum": [
"active",
"archived"
]
},
"livemode": {
"type": "boolean"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"updated_at": {
"type": "string",
"format": "date-time"
}
}
}
]
}
}
}
}
}400 Invalid request.
{
"application/json": {
"schema": {
"type": "object",
"required": [
"success",
"error"
],
"properties": {
"success": {
"const": false
},
"error": {
"type": "object",
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"enum": [
"authentication_error",
"permission_error",
"invalid_request_error",
"state_error",
"idempotency_error",
"rate_limit_error",
"api_error"
]
},
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"param": {
"type": [
"string",
"null"
]
},
"request_id": {
"type": "string"
},
"doc_url": {
"type": "string",
"format": "uri"
}
}
}
}
}
}
}401 Missing, invalid, revoked or wrong-environment key.
{
"application/json": {
"schema": {
"type": "object",
"required": [
"success",
"error"
],
"properties": {
"success": {
"const": false
},
"error": {
"type": "object",
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"enum": [
"authentication_error",
"permission_error",
"invalid_request_error",
"state_error",
"idempotency_error",
"rate_limit_error",
"api_error"
]
},
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"param": {
"type": [
"string",
"null"
]
},
"request_id": {
"type": "string"
},
"doc_url": {
"type": "string",
"format": "uri"
}
}
}
}
}
}
}403 Insufficient scope, or live access not enabled.
{
"application/json": {
"schema": {
"type": "object",
"required": [
"success",
"error"
],
"properties": {
"success": {
"const": false
},
"error": {
"type": "object",
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"enum": [
"authentication_error",
"permission_error",
"invalid_request_error",
"state_error",
"idempotency_error",
"rate_limit_error",
"api_error"
]
},
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"param": {
"type": [
"string",
"null"
]
},
"request_id": {
"type": "string"
},
"doc_url": {
"type": "string",
"format": "uri"
}
}
}
}
}
}
}409 Idempotency conflict.
{
"application/json": {
"schema": {
"type": "object",
"required": [
"success",
"error"
],
"properties": {
"success": {
"const": false
},
"error": {
"type": "object",
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"enum": [
"authentication_error",
"permission_error",
"invalid_request_error",
"state_error",
"idempotency_error",
"rate_limit_error",
"api_error"
]
},
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"param": {
"type": [
"string",
"null"
]
},
"request_id": {
"type": "string"
},
"doc_url": {
"type": "string",
"format": "uri"
}
}
}
}
}
}
}429 Too many requests.
{
"application/json": {
"schema": {
"type": "object",
"required": [
"success",
"error"
],
"properties": {
"success": {
"const": false
},
"error": {
"type": "object",
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"enum": [
"authentication_error",
"permission_error",
"invalid_request_error",
"state_error",
"idempotency_error",
"rate_limit_error",
"api_error"
]
},
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"param": {
"type": [
"string",
"null"
]
},
"request_id": {
"type": "string"
},
"doc_url": {
"type": "string",
"format": "uri"
}
}
}
}
}
}
}GET
/plansList plans
Not meteredplans:read
Request example
curl --request GET \
--url 'https://sandbox-api.mysubbyapp.com/v1/plans' \
--header 'Authorization: Bearer sk_test_YOUR_SECRET_KEY'Parameters
limitquery · integer starting_afterquery · string ending_beforequery · string statusquery · string Responses
200 Plans, newest first.
{
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"const": true
},
"data": {
"type": "array",
"items": {
"allOf": [
{
"type": "object",
"required": [
"name",
"amount",
"currency",
"billing_cycle"
],
"properties": {
"name": {
"type": "string",
"maxLength": 120
},
"description": {
"type": "string",
"maxLength": 500
},
"amount": {
"type": "integer",
"minimum": 100,
"description": "Kobo."
},
"currency": {
"type": "string",
"enum": [
"NGN"
]
},
"billing_cycle": {
"type": "string",
"enum": [
"daily",
"weekly",
"monthly",
"quarterly",
"per_delivery"
]
},
"trial_days": {
"type": "integer",
"minimum": 0,
"maximum": 365,
"default": 0
},
"pause_enabled": {
"type": "boolean",
"default": false
},
"pro_rate": {
"type": "boolean",
"default": true
},
"overage_per_unit": {
"type": [
"integer",
"null"
],
"description": "Kobo per unit reported with unit records."
},
"category": {
"type": "string",
"description": "Vertical key, e.g. waste_management, diesel_supply, gym_fitness."
},
"service_config": {
"type": "object",
"additionalProperties": true
},
"retry_logic": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"default": true
},
"max_attempts": {
"type": "integer",
"minimum": 0,
"maximum": 8,
"default": 3
},
"retry_intervals_days": {
"type": "array",
"items": {
"type": "integer",
"minimum": 1,
"maximum": 30
},
"default": [
1,
3,
7
]
},
"escalation_on_failure": {
"type": "string",
"enum": [
"pause_service",
"restrict_access",
"hold_delivery",
"none"
],
"default": "pause_service"
},
"cancel_after_days_unpaid": {
"type": [
"integer",
"null"
],
"minimum": 1,
"maximum": 180,
"default": 30
}
}
},
"reminders": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"default": true
},
"channels": {
"type": "array",
"items": {
"type": "string",
"enum": [
"whatsapp",
"sms",
"email"
]
},
"default": [
"whatsapp",
"sms",
"email"
]
},
"pre_due_days": {
"type": "array",
"items": {
"type": "integer",
"minimum": 1,
"maximum": 30
},
"default": [
3
]
},
"post_due_days": {
"type": "array",
"items": {
"type": "integer",
"minimum": 1,
"maximum": 60
},
"default": [
1,
3
]
}
}
},
"metadata": {
"type": "object",
"maxProperties": 20,
"propertyNames": {
"maxLength": 40
},
"additionalProperties": {
"type": "string",
"maxLength": 500
}
}
}
},
{
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "plan_8ZpR1v"
},
"object": {
"const": "plan"
},
"status": {
"type": "string",
"enum": [
"active",
"archived"
]
},
"livemode": {
"type": "boolean"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"updated_at": {
"type": "string",
"format": "date-time"
}
}
}
]
}
},
"meta": {
"type": "object",
"required": [
"has_more",
"limit"
],
"properties": {
"has_more": {
"type": "boolean"
},
"next_cursor": {
"type": [
"string",
"null"
]
},
"limit": {
"type": "integer"
}
}
}
}
}
}
}401 Missing, invalid, revoked or wrong-environment key.
{
"application/json": {
"schema": {
"type": "object",
"required": [
"success",
"error"
],
"properties": {
"success": {
"const": false
},
"error": {
"type": "object",
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"enum": [
"authentication_error",
"permission_error",
"invalid_request_error",
"state_error",
"idempotency_error",
"rate_limit_error",
"api_error"
]
},
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"param": {
"type": [
"string",
"null"
]
},
"request_id": {
"type": "string"
},
"doc_url": {
"type": "string",
"format": "uri"
}
}
}
}
}
}
}GET
/plans/{id}Retrieve a plan
Not meteredplans:read
Request example
curl --request GET \
--url 'https://sandbox-api.mysubbyapp.com/v1/plans/{id}' \
--header 'Authorization: Bearer sk_test_YOUR_SECRET_KEY'Parameters
idpath · string · requiredResponses
200 The plan.
{
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"const": true
},
"data": {
"allOf": [
{
"type": "object",
"required": [
"name",
"amount",
"currency",
"billing_cycle"
],
"properties": {
"name": {
"type": "string",
"maxLength": 120
},
"description": {
"type": "string",
"maxLength": 500
},
"amount": {
"type": "integer",
"minimum": 100,
"description": "Kobo."
},
"currency": {
"type": "string",
"enum": [
"NGN"
]
},
"billing_cycle": {
"type": "string",
"enum": [
"daily",
"weekly",
"monthly",
"quarterly",
"per_delivery"
]
},
"trial_days": {
"type": "integer",
"minimum": 0,
"maximum": 365,
"default": 0
},
"pause_enabled": {
"type": "boolean",
"default": false
},
"pro_rate": {
"type": "boolean",
"default": true
},
"overage_per_unit": {
"type": [
"integer",
"null"
],
"description": "Kobo per unit reported with unit records."
},
"category": {
"type": "string",
"description": "Vertical key, e.g. waste_management, diesel_supply, gym_fitness."
},
"service_config": {
"type": "object",
"additionalProperties": true
},
"retry_logic": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"default": true
},
"max_attempts": {
"type": "integer",
"minimum": 0,
"maximum": 8,
"default": 3
},
"retry_intervals_days": {
"type": "array",
"items": {
"type": "integer",
"minimum": 1,
"maximum": 30
},
"default": [
1,
3,
7
]
},
"escalation_on_failure": {
"type": "string",
"enum": [
"pause_service",
"restrict_access",
"hold_delivery",
"none"
],
"default": "pause_service"
},
"cancel_after_days_unpaid": {
"type": [
"integer",
"null"
],
"minimum": 1,
"maximum": 180,
"default": 30
}
}
},
"reminders": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"default": true
},
"channels": {
"type": "array",
"items": {
"type": "string",
"enum": [
"whatsapp",
"sms",
"email"
]
},
"default": [
"whatsapp",
"sms",
"email"
]
},
"pre_due_days": {
"type": "array",
"items": {
"type": "integer",
"minimum": 1,
"maximum": 30
},
"default": [
3
]
},
"post_due_days": {
"type": "array",
"items": {
"type": "integer",
"minimum": 1,
"maximum": 60
},
"default": [
1,
3
]
}
}
},
"metadata": {
"type": "object",
"maxProperties": 20,
"propertyNames": {
"maxLength": 40
},
"additionalProperties": {
"type": "string",
"maxLength": 500
}
}
}
},
{
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "plan_8ZpR1v"
},
"object": {
"const": "plan"
},
"status": {
"type": "string",
"enum": [
"active",
"archived"
]
},
"livemode": {
"type": "boolean"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"updated_at": {
"type": "string",
"format": "date-time"
}
}
}
]
}
}
}
}
}404 Object or route not found in this environment.
{
"application/json": {
"schema": {
"type": "object",
"required": [
"success",
"error"
],
"properties": {
"success": {
"const": false
},
"error": {
"type": "object",
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"enum": [
"authentication_error",
"permission_error",
"invalid_request_error",
"state_error",
"idempotency_error",
"rate_limit_error",
"api_error"
]
},
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"param": {
"type": [
"string",
"null"
]
},
"request_id": {
"type": "string"
},
"doc_url": {
"type": "string",
"format": "uri"
}
}
}
}
}
}
}PATCH
/plans/{id}Update a plan
Changing `amount` affects new subscriptions only. Existing subscriptions keep their price.
Metered on successful live writesplans:write
Request example
curl --request PATCH \
--url 'https://sandbox-api.mysubbyapp.com/v1/plans/{id}' \
--header 'Authorization: Bearer sk_test_YOUR_SECRET_KEY'Add a JSON body matching the request schema below and a Content-Type: application/json header.
Parameters
idpath · string · requiredRequest body schema
{
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"amount": {
"type": "integer",
"minimum": 100
},
"trial_days": {
"type": "integer"
},
"pause_enabled": {
"type": "boolean"
},
"pro_rate": {
"type": "boolean"
},
"overage_per_unit": {
"type": [
"integer",
"null"
]
},
"service_config": {
"type": "object",
"additionalProperties": true
},
"retry_logic": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"default": true
},
"max_attempts": {
"type": "integer",
"minimum": 0,
"maximum": 8,
"default": 3
},
"retry_intervals_days": {
"type": "array",
"items": {
"type": "integer",
"minimum": 1,
"maximum": 30
},
"default": [
1,
3,
7
]
},
"escalation_on_failure": {
"type": "string",
"enum": [
"pause_service",
"restrict_access",
"hold_delivery",
"none"
],
"default": "pause_service"
},
"cancel_after_days_unpaid": {
"type": [
"integer",
"null"
],
"minimum": 1,
"maximum": 180,
"default": 30
}
}
},
"reminders": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"default": true
},
"channels": {
"type": "array",
"items": {
"type": "string",
"enum": [
"whatsapp",
"sms",
"email"
]
},
"default": [
"whatsapp",
"sms",
"email"
]
},
"pre_due_days": {
"type": "array",
"items": {
"type": "integer",
"minimum": 1,
"maximum": 30
},
"default": [
3
]
},
"post_due_days": {
"type": "array",
"items": {
"type": "integer",
"minimum": 1,
"maximum": 60
},
"default": [
1,
3
]
}
}
},
"metadata": {
"type": "object",
"maxProperties": 20,
"propertyNames": {
"maxLength": 40
},
"additionalProperties": {
"type": "string",
"maxLength": 500
}
}
}
}
}
}
}Responses
200 The updated plan.
{
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"const": true
},
"data": {
"allOf": [
{
"type": "object",
"required": [
"name",
"amount",
"currency",
"billing_cycle"
],
"properties": {
"name": {
"type": "string",
"maxLength": 120
},
"description": {
"type": "string",
"maxLength": 500
},
"amount": {
"type": "integer",
"minimum": 100,
"description": "Kobo."
},
"currency": {
"type": "string",
"enum": [
"NGN"
]
},
"billing_cycle": {
"type": "string",
"enum": [
"daily",
"weekly",
"monthly",
"quarterly",
"per_delivery"
]
},
"trial_days": {
"type": "integer",
"minimum": 0,
"maximum": 365,
"default": 0
},
"pause_enabled": {
"type": "boolean",
"default": false
},
"pro_rate": {
"type": "boolean",
"default": true
},
"overage_per_unit": {
"type": [
"integer",
"null"
],
"description": "Kobo per unit reported with unit records."
},
"category": {
"type": "string",
"description": "Vertical key, e.g. waste_management, diesel_supply, gym_fitness."
},
"service_config": {
"type": "object",
"additionalProperties": true
},
"retry_logic": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"default": true
},
"max_attempts": {
"type": "integer",
"minimum": 0,
"maximum": 8,
"default": 3
},
"retry_intervals_days": {
"type": "array",
"items": {
"type": "integer",
"minimum": 1,
"maximum": 30
},
"default": [
1,
3,
7
]
},
"escalation_on_failure": {
"type": "string",
"enum": [
"pause_service",
"restrict_access",
"hold_delivery",
"none"
],
"default": "pause_service"
},
"cancel_after_days_unpaid": {
"type": [
"integer",
"null"
],
"minimum": 1,
"maximum": 180,
"default": 30
}
}
},
"reminders": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"default": true
},
"channels": {
"type": "array",
"items": {
"type": "string",
"enum": [
"whatsapp",
"sms",
"email"
]
},
"default": [
"whatsapp",
"sms",
"email"
]
},
"pre_due_days": {
"type": "array",
"items": {
"type": "integer",
"minimum": 1,
"maximum": 30
},
"default": [
3
]
},
"post_due_days": {
"type": "array",
"items": {
"type": "integer",
"minimum": 1,
"maximum": 60
},
"default": [
1,
3
]
}
}
},
"metadata": {
"type": "object",
"maxProperties": 20,
"propertyNames": {
"maxLength": 40
},
"additionalProperties": {
"type": "string",
"maxLength": 500
}
}
}
},
{
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "plan_8ZpR1v"
},
"object": {
"const": "plan"
},
"status": {
"type": "string",
"enum": [
"active",
"archived"
]
},
"livemode": {
"type": "boolean"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"updated_at": {
"type": "string",
"format": "date-time"
}
}
}
]
}
}
}
}
}400 Invalid request.
{
"application/json": {
"schema": {
"type": "object",
"required": [
"success",
"error"
],
"properties": {
"success": {
"const": false
},
"error": {
"type": "object",
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"enum": [
"authentication_error",
"permission_error",
"invalid_request_error",
"state_error",
"idempotency_error",
"rate_limit_error",
"api_error"
]
},
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"param": {
"type": [
"string",
"null"
]
},
"request_id": {
"type": "string"
},
"doc_url": {
"type": "string",
"format": "uri"
}
}
}
}
}
}
}404 Object or route not found in this environment.
{
"application/json": {
"schema": {
"type": "object",
"required": [
"success",
"error"
],
"properties": {
"success": {
"const": false
},
"error": {
"type": "object",
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"enum": [
"authentication_error",
"permission_error",
"invalid_request_error",
"state_error",
"idempotency_error",
"rate_limit_error",
"api_error"
]
},
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"param": {
"type": [
"string",
"null"
]
},
"request_id": {
"type": "string"
},
"doc_url": {
"type": "string",
"format": "uri"
}
}
}
}
}
}
}DELETE
/plans/{id}Archive a plan
Archived plans can't be used for new subscriptions. Existing subscriptions continue.
Metered on successful live writesplans:write
Request example
curl --request DELETE \
--url 'https://sandbox-api.mysubbyapp.com/v1/plans/{id}' \
--header 'Authorization: Bearer sk_test_YOUR_SECRET_KEY'Parameters
idpath · string · requiredResponses
200 The archived plan.
{
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"const": true
},
"data": {
"allOf": [
{
"type": "object",
"required": [
"name",
"amount",
"currency",
"billing_cycle"
],
"properties": {
"name": {
"type": "string",
"maxLength": 120
},
"description": {
"type": "string",
"maxLength": 500
},
"amount": {
"type": "integer",
"minimum": 100,
"description": "Kobo."
},
"currency": {
"type": "string",
"enum": [
"NGN"
]
},
"billing_cycle": {
"type": "string",
"enum": [
"daily",
"weekly",
"monthly",
"quarterly",
"per_delivery"
]
},
"trial_days": {
"type": "integer",
"minimum": 0,
"maximum": 365,
"default": 0
},
"pause_enabled": {
"type": "boolean",
"default": false
},
"pro_rate": {
"type": "boolean",
"default": true
},
"overage_per_unit": {
"type": [
"integer",
"null"
],
"description": "Kobo per unit reported with unit records."
},
"category": {
"type": "string",
"description": "Vertical key, e.g. waste_management, diesel_supply, gym_fitness."
},
"service_config": {
"type": "object",
"additionalProperties": true
},
"retry_logic": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"default": true
},
"max_attempts": {
"type": "integer",
"minimum": 0,
"maximum": 8,
"default": 3
},
"retry_intervals_days": {
"type": "array",
"items": {
"type": "integer",
"minimum": 1,
"maximum": 30
},
"default": [
1,
3,
7
]
},
"escalation_on_failure": {
"type": "string",
"enum": [
"pause_service",
"restrict_access",
"hold_delivery",
"none"
],
"default": "pause_service"
},
"cancel_after_days_unpaid": {
"type": [
"integer",
"null"
],
"minimum": 1,
"maximum": 180,
"default": 30
}
}
},
"reminders": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"default": true
},
"channels": {
"type": "array",
"items": {
"type": "string",
"enum": [
"whatsapp",
"sms",
"email"
]
},
"default": [
"whatsapp",
"sms",
"email"
]
},
"pre_due_days": {
"type": "array",
"items": {
"type": "integer",
"minimum": 1,
"maximum": 30
},
"default": [
3
]
},
"post_due_days": {
"type": "array",
"items": {
"type": "integer",
"minimum": 1,
"maximum": 60
},
"default": [
1,
3
]
}
}
},
"metadata": {
"type": "object",
"maxProperties": 20,
"propertyNames": {
"maxLength": 40
},
"additionalProperties": {
"type": "string",
"maxLength": 500
}
}
}
},
{
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "plan_8ZpR1v"
},
"object": {
"const": "plan"
},
"status": {
"type": "string",
"enum": [
"active",
"archived"
]
},
"livemode": {
"type": "boolean"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"updated_at": {
"type": "string",
"format": "date-time"
}
}
}
]
}
}
}
}
}404 Object or route not found in this environment.
{
"application/json": {
"schema": {
"type": "object",
"required": [
"success",
"error"
],
"properties": {
"success": {
"const": false
},
"error": {
"type": "object",
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"enum": [
"authentication_error",
"permission_error",
"invalid_request_error",
"state_error",
"idempotency_error",
"rate_limit_error",
"api_error"
]
},
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"param": {
"type": [
"string",
"null"
]
},
"request_id": {
"type": "string"
},
"doc_url": {
"type": "string",
"format": "uri"
}
}
}
}
}
}
}