Skip to Content

Create a plan

A price and a period for recurring invoices, on the key's app. Each period every active subscription to it gets an invoice: a payment the customer pays on its checkout page (no auto-debit).

Authorization

apiKey
headerAuthorizationBearer <token>

lbp_test_... or lbp_live_...

Header Parameters

Idempotency-Key*string
Lengthlength <= 255

Request Body

application/json
  1. body
name*string
Length1 <= length <= 100
amount*integer

Whole rupiah per period: 1,000 to 50,000,000 (QRIS up to 10,000,000; a VA from 10,000).

interval*
method?string

How each invoice is paid: any (the customer picks among the app's methods), qris, or va with va_bank.

Default"any"
Value in"any""qris""va"
va_bank?string
Value in"mandiri""bri""bni""bsi""cimb""permata""maybank""danamon"
expires_in?integer

Seconds each invoice stays payable.

Range3600 <= value <= 2592000
Default604800
metadata?

Response Body

The plan

application/json
  1. response
id*string
object*"plan"
Value in"plan"
app_id*string
mode*string
Value in"test""live"
name*string
amount*integer
interval*
method*string
Value in"any""qris""va"
va_bank*string|null
expires_in*integer
active*boolean
metadata*
created_at*string
Formatdate-time
Example Request
curl -X POST 'https://pay.piti.id/v1/billing/plans' \  -H 'Idempotency-Key: string' \  -H 'Content-Type: application/json' \  -d '{  "name": "Internet 20 Mbps",  "amount": 150000,  "interval": {    "unit": "month",    "count": 1  }}'
Example Response
{  "id": "string",  "object": "plan",  "app_id": "string",  "mode": "test",  "name": "string",  "amount": 0,  "interval": {    "unit": "day",    "count": 0  },  "method": "any",  "va_bank": "string",  "expires_in": 0,  "active": true,  "metadata": {},  "created_at": "2019-08-24T14:15:22Z"}