POST
/
subscriptions
curl --request POST \
  --url https://api.nomos.energy/subscriptions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "plan": "pln_bh2yujg0qndvi7b5bcei7i30",
  "customer": {
    "first_name": "John",
    "last_name": "Doe",
    "email": "john.doe@example.com"
  },
  "address": {
    "street": "Torstraße",
    "house_number": "119",
    "zip": "10115",
    "city": "Berlin"
  },
  "meter": {
    "number": "1APA0195124010",
    "type": "smart",
    "estimated_usage": 2500
  },
  "payment_method": {
    "type": "sepa_debit",
    "sepa_debit": {
      "iban": "DE68500105178297336485",
      "account_holder": "John Doe"
    }
  },
  "previous_supplier": "mp_x921747iado5d4vel5vsslq5",
  "next_possible_start": true,
  "intended_start_date": "2024-01-01",
  "lead": "lead_g6pxk97j8lkg74kqcd04fe36"
}'
{
  "object": "subscription",
  "id": "sub_rocbrf1u5e48mm0reeqoag90",
  "plan": "pln_ctj3tjzc7dywznuw1dy80lb3",
  "customer": "cus_a8n8ol7yd4h0wohx824f0bui",
  "address": "adr_a7gurqkul8lzzsy1pf9p9388",
  "meter": "mtr_azk4zue2ijx4ff1dbjt14m5h",
  "payment_method": "pm_adc9utqqpcp7tx054l7vg56s2",
  "supplier": "mp_a0x6jm5h92wde6s5dnuvha4c",
  "status": "active",
  "created_at": "2024-03-14T12:00:00Z",
  "start_at": "2024-03-14T12:00:00Z",
  "terminated_at": "2024-03-14T12:00:00Z",
  "end_at": "2024-03-14T12:00:00Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
The subscription to create
plan
string
required

Plan ID

Example:

"pln_bh2yujg0qndvi7b5bcei7i30"

customer
object
required
address
object
required
meter
object
required
payment_method
object
required
next_possible_start
boolean
required

Next possible start date of the subscription

Example:

true

previous_supplier
string

ID of the previous supplier, possible to obtain via /suppliers

Example:

"mp_x921747iado5d4vel5vsslq5"

intended_start_date
string

Intended start date of the subscription

Example:

"2024-01-01"

lead
string

Lead to track attribution of the subscription

Example:

"lead_g6pxk97j8lkg74kqcd04fe36"

Response

200
application/json
The created subscription details
object
enum<string>
required

Type of the object, always 'subscription'

Available options:
subscription
id
string
required

Unique identifier for the subscription

Example:

"sub_rocbrf1u5e48mm0reeqoag90"

plan
string
required

ID of the plan

Example:

"pln_ctj3tjzc7dywznuw1dy80lb3"

customer
string
required

ID of the customer

Example:

"cus_a8n8ol7yd4h0wohx824f0bui"

address
string
required

ID of the address

Example:

"adr_a7gurqkul8lzzsy1pf9p9388"

meter
string
required

ID of the meter

Example:

"mtr_azk4zue2ijx4ff1dbjt14m5h"

payment_method
string
required

ID of the payment method

Example:

"pm_adc9utqqpcp7tx054l7vg56s2"

status
enum<string>
required

Status of the subscription

Available options:
pending,
active,
ended
Example:

"active"

created_at
required

Timestamp when the subscription was created

Example:

"2024-03-14T12:00:00Z"

start_at
required

Timestamp when delivery was started / will start

Example:

"2024-03-14T12:00:00Z"

terminated_at
required

Timestamp when delivery was terminated

Example:

"2024-03-14T12:00:00Z"

end_at
required

Timestamp when the subscription was ended / will end

Example:

"2024-03-14T12:00:00Z"

supplier
string

ID of the previous supplier

Example:

"mp_a0x6jm5h92wde6s5dnuvha4c"