Plock.io
  • ๐Ÿ‘‹Welcome to Plock
  • Overview
    • ๐Ÿ’กOur promise
  • Guides
    • ๐Ÿช„Connect your data sources
      • ๐Ÿ”ŒDirect Connect
      • ๐Ÿ‘พDatabase Agent
      • โš™๏ธPlock API
      • Google BigQuery
    • โฑ๏ธAI powered data mapping
    • ๐Ÿ’™Customers
    • ๐Ÿ›’Products & Plans
      • ๐Ÿ“ฆProducts
      • ๐Ÿ’ฐPrice Plans
        • Revenue leakage
      • ๐Ÿ“ŠProduct Consumption
    • โ™ป๏ธSubscriptions
      • ๐ŸŒŸSetting up a subscription
      • Schedule Subscription Changes
    • ๐Ÿ“„Invoicing & Accounting
      • Pause Revenue Collection
    • ๐Ÿ“ˆReporting
    • ๐Ÿ”Security
      • ๐Ÿ‡ช๐Ÿ‡บGDPR
  • Use Cases
    • ๐Ÿ–ฅ๏ธFor Developers
      • API
        • Introduction
        • Authentication
        • Endpoints
Powered by GitBook
On this page
  1. Use Cases
  2. For Developers
  3. API

Endpoints

Browse endpoints available

PreviousAuthentication

Last updated 24 days ago

๐Ÿ–ฅ๏ธ

Get all accounts

get
Authorizations
Query parameters
Header parameters
Acceptstring ยท enumRequired

The client must specify an Accept header.

Possible values:
Responses
200
OK
application/vnd.api+json
401
Unauthorized
application/vnd.api+json
get
GET /api/c1/accounts HTTP/1.1
Host: api.plock.io
Authorization: Bearer JWT
Accept: application/vnd.api+json
{
  "meta": {
    "page": {
      "currentPage": 1,
      "from": 1,
      "lastPage": 1,
      "perPage": 1,
      "to": 1,
      "total": 1
    }
  },
  "jsonapi": {
    "version": "1.0"
  },
  "links": {
    "first": "text",
    "last": "text",
    "next": "text"
  },
  "data": [
    {
      "type": "accounts",
      "id": "2002",
      "attributes": {
        "primaryKey": "a443322",
        "name": "Some Company AB",
        "orgNumber": "554433-3344",
        "crmId": "hs321",
        "erpId": "fn432",
        "country": "Sweden",
        "parentAccountId": 1,
        "createdAt": "2025-05-23T15:45:51.058Z",
        "updatedAt": "2025-05-23T15:45:51.058Z",
        "isGroup": true,
        "belongsToGroup": true,
        "isArchived": true,
        "stats": {
          "mrr_committed_fees": [
            100.5,
            200.3,
            300.2
          ],
          "mrr_usage_fees": [
            0,
            0,
            0
          ],
          "mrr_one_time_fees": [
            0,
            0,
            200
          ],
          "billings_committed_fees": [
            0,
            0,
            601
          ],
          "billings_usage_fees": [
            0,
            0,
            0
          ],
          "billings_one_time_fees": [
            0,
            0,
            200
          ]
        }
      },
      "relationships": {
        "subscriptions": "text",
        "invoices": "text"
      },
      "links": {
        "self": "text"
      }
    }
  ]
}

Get specific account

get
Authorizations
Path parameters
accountIdintegerRequired

Plock account ID

Query parameters
Header parameters
Acceptstring ยท enumRequired

The client must specify an Accept header.

Possible values:
Responses
200
OK
application/vnd.api+json
401
Unauthorized
application/vnd.api+json
404
Not found
application/vnd.api+json
get
GET /api/c1/accounts/{accountId} HTTP/1.1
Host: api.plock.io
Authorization: Bearer JWT
Accept: application/vnd.api+json
{
  "jsonapi": {
    "version": "1.0"
  },
  "links": {
    "self": "text"
  },
  "data": {
    "type": "accounts",
    "id": "2002",
    "attributes": {
      "primaryKey": "a443322",
      "name": "Some Company AB",
      "orgNumber": "554433-3344",
      "crmId": "hs321",
      "erpId": "fn432",
      "country": "Sweden",
      "parentAccountId": 1,
      "createdAt": "2025-05-23T15:45:51.058Z",
      "updatedAt": "2025-05-23T15:45:51.058Z",
      "isGroup": true,
      "belongsToGroup": true,
      "isArchived": true,
      "stats": {
        "mrr_committed_fees": [
          100.5,
          200.3,
          300.2
        ],
        "mrr_usage_fees": [
          0,
          0,
          0
        ],
        "mrr_one_time_fees": [
          0,
          0,
          200
        ],
        "billings_committed_fees": [
          0,
          0,
          601
        ],
        "billings_usage_fees": [
          0,
          0,
          0
        ],
        "billings_one_time_fees": [
          0,
          0,
          200
        ]
      }
    },
    "relationships": {
      "subscriptions": "text",
      "invoices": "text"
    },
    "links": {
      "self": "text"
    }
  }
}

Get all subscriptions

get
Authorizations
Query parameters
Header parameters
Acceptstring ยท enumRequired

The client must specify an Accept header.

Possible values:
Responses
200
OK
application/vnd.api+json
401
Unauthorized
application/vnd.api+json
get
GET /api/c1/subscriptions HTTP/1.1
Host: api.plock.io
Authorization: Bearer JWT
Accept: application/vnd.api+json
{
  "meta": {
    "page": {
      "currentPage": 1,
      "from": 1,
      "lastPage": 1,
      "perPage": 1,
      "to": 1,
      "total": 1
    }
  },
  "jsonapi": {
    "version": "1.0"
  },
  "links": {
    "first": "text",
    "last": "text",
    "next": "text"
  },
  "data": [
    {
      "type": "subscriptions",
      "id": "2002",
      "attributes": {
        "accountId": "2002",
        "name": "My annual subscription",
        "billingInterval": "month",
        "billingIntervalName": "Monthly in arrears",
        "billingPractice": "in_arrears",
        "state": "Ended",
        "billingIntervalCount": 12,
        "isActive": true,
        "billingCycleAnchor": "2025-05-23T15:45:51.058Z",
        "renewalDate": "2025-06-30",
        "cancelEndDate": "2025-05-30",
        "rebateEndDate": "2024-07-01",
        "rebateAmount": 2000,
        "rebateType": "percent",
        "currency": "SEK",
        "minimumCommitment": 2000,
        "currentBillingPeriod": "2024-03-01 - 2024-03-31",
        "autoSendToAccounting": true,
        "endDate": "2024-07-01",
        "createdAt": "2025-05-23T15:45:51.058Z",
        "updatedAt": "2025-05-23T15:45:51.058Z"
      },
      "relationships": {
        "accounts": "text",
        "invoices": "text",
        "subscription-items": "text"
      },
      "links": {
        "self": "text"
      }
    }
  ]
}

Get specific subscription

get
Authorizations
Path parameters
subscriptionIdintegerRequired

Plock subscription ID

Query parameters
Header parameters
Acceptstring ยท enumRequired

The client must specify an Accept header.

Possible values:
Responses
200
OK
application/vnd.api+json
401
Unauthorized
application/vnd.api+json
404
Not found
application/vnd.api+json
get
GET /api/c1/subscriptions/{subscriptionId} HTTP/1.1
Host: api.plock.io
Authorization: Bearer JWT
Accept: application/vnd.api+json
{
  "jsonapi": {
    "version": "1.0"
  },
  "links": {
    "self": "text"
  },
  "data": {
    "type": "subscriptions",
    "id": "2002",
    "attributes": {
      "accountId": "2002",
      "name": "My annual subscription",
      "billingInterval": "month",
      "billingIntervalName": "Monthly in arrears",
      "billingPractice": "in_arrears",
      "state": "Ended",
      "billingIntervalCount": 12,
      "isActive": true,
      "billingCycleAnchor": "2025-05-23T15:45:51.058Z",
      "renewalDate": "2025-06-30",
      "cancelEndDate": "2025-05-30",
      "rebateEndDate": "2024-07-01",
      "rebateAmount": 2000,
      "rebateType": "percent",
      "currency": "SEK",
      "minimumCommitment": 2000,
      "currentBillingPeriod": "2024-03-01 - 2024-03-31",
      "autoSendToAccounting": true,
      "endDate": "2024-07-01",
      "createdAt": "2025-05-23T15:45:51.058Z",
      "updatedAt": "2025-05-23T15:45:51.058Z"
    },
    "relationships": {
      "accounts": "text",
      "invoices": "text",
      "subscription-items": "text"
    },
    "links": {
      "self": "text"
    }
  }
}

Get all subscription items

get
Authorizations
Query parameters
Header parameters
Acceptstring ยท enumRequired

The client must specify an Accept header.

Possible values:
Responses
200
OK
application/vnd.api+json
401
Unauthorized
application/vnd.api+json
get
GET /api/c1/subscription-items HTTP/1.1
Host: api.plock.io
Authorization: Bearer JWT
Accept: application/vnd.api+json
{
  "meta": {
    "page": {
      "currentPage": 1,
      "from": 1,
      "lastPage": 1,
      "perPage": 1,
      "to": 1,
      "total": 1
    }
  },
  "jsonapi": {
    "version": "1.0"
  },
  "links": {
    "first": "text",
    "last": "text",
    "next": "text"
  },
  "data": [
    {
      "type": "subscriptions",
      "id": "2002",
      "attributes": {
        "planName": "Annual price",
        "productName": "Send SMS",
        "quantity": 100,
        "rebateAmount": 10,
        "rebateType": "percent",
        "rebateEndDate": "2025-05-23T15:45:51.058Z",
        "createdAt": "2025-05-23T15:45:51.058Z",
        "updatedAt": "2025-05-23T15:45:51.058Z"
      },
      "relationships": {
        "subscriptions": "text"
      },
      "links": {
        "self": "text"
      }
    }
  ]
}

Get specific subscription item

get
Authorizations
Path parameters
subscriptionItemIdintegerRequired

Plock subscription item ID

Query parameters
Header parameters
Acceptstring ยท enumRequired

The client must specify an Accept header.

Possible values:
Responses
200
OK
application/vnd.api+json
401
Unauthorized
application/vnd.api+json
404
Not found
application/vnd.api+json
get
GET /api/c1/subscription-items/{subscriptionItemId} HTTP/1.1
Host: api.plock.io
Authorization: Bearer JWT
Accept: application/vnd.api+json
{
  "jsonapi": {
    "version": "1.0"
  },
  "links": {
    "self": "text"
  },
  "data": {
    "type": "subscriptions",
    "id": "2002",
    "attributes": {
      "planName": "Annual price",
      "productName": "Send SMS",
      "quantity": 100,
      "rebateAmount": 10,
      "rebateType": "percent",
      "rebateEndDate": "2025-05-23T15:45:51.058Z",
      "createdAt": "2025-05-23T15:45:51.058Z",
      "updatedAt": "2025-05-23T15:45:51.058Z"
    },
    "relationships": {
      "subscriptions": "text"
    },
    "links": {
      "self": "text"
    }
  }
}

Get all invoices

get
Authorizations
Query parameters
Header parameters
Acceptstring ยท enumRequired

The client must specify an Accept header.

Possible values:
Responses
200
OK
application/vnd.api+json
401
Unauthorized
application/vnd.api+json
get
GET /api/c1/invoices HTTP/1.1
Host: api.plock.io
Authorization: Bearer JWT
Accept: application/vnd.api+json
{
  "meta": {
    "page": {
      "currentPage": 1,
      "from": 1,
      "lastPage": 1,
      "perPage": 1,
      "to": 1,
      "total": 1
    }
  },
  "jsonapi": {
    "version": "1.0"
  },
  "links": {
    "first": "text",
    "last": "text",
    "next": "text"
  },
  "data": [
    {
      "type": "invoices",
      "id": "2002",
      "attributes": {
        "amount": "1000.00",
        "accountId": "5001",
        "erpId": "fn123",
        "subscriptionId": "4342",
        "currency": "EUR",
        "invoiceType": "In arrears",
        "periodStart": "2025-05-23",
        "periodEnd": "2025-05-23",
        "createdAt": "2025-05-23T15:45:51.058Z",
        "updatedAt": "2025-05-23T15:45:51.058Z",
        "dueAt": "2025-05-23T15:45:51.058Z",
        "paymentStatus": "Paid",
        "parentInvoiceId": 1001,
        "isParent": false
      },
      "relationships": {
        "subscriptions": "text",
        "accounts": "text"
      },
      "links": {
        "self": "text"
      }
    }
  ]
}

Get specific invoice

get
Authorizations
Path parameters
invoiceIdintegerRequired

Plock invoice ID

Query parameters
Header parameters
Acceptstring ยท enumRequired

The client must specify an Accept header.

Possible values:
Responses
200
OK
application/vnd.api+json
401
Unauthorized
application/vnd.api+json
404
Not found
application/vnd.api+json
get
GET /api/c1/invoices/{invoiceId} HTTP/1.1
Host: api.plock.io
Authorization: Bearer JWT
Accept: application/vnd.api+json
{
  "jsonapi": {
    "version": "1.0"
  },
  "links": {
    "self": "text"
  },
  "data": {
    "type": "invoices",
    "id": "2002",
    "attributes": {
      "amount": "1000.00",
      "accountId": "5001",
      "erpId": "fn123",
      "subscriptionId": "4342",
      "currency": "EUR",
      "invoiceType": "In arrears",
      "periodStart": "2025-05-23",
      "periodEnd": "2025-05-23",
      "createdAt": "2025-05-23T15:45:51.058Z",
      "updatedAt": "2025-05-23T15:45:51.058Z",
      "dueAt": "2025-05-23T15:45:51.058Z",
      "paymentStatus": "Paid",
      "parentInvoiceId": 1001,
      "isParent": false
    },
    "relationships": {
      "subscriptions": "text",
      "accounts": "text"
    },
    "links": {
      "self": "text"
    }
  }
}

Add product usage

post
Authorizations
Path parameters
tsintegerRequired

UNIX timestamp of value

valuefloatRequired

Value recorded at ts

crm_idstringRequired

CRM ID of the account

product_idintegerRequired

Product ID for the product

Responses
200
OK
application/json
401
Unauthorized
application/json
404
Not found
application/json
post
POST /api/c1/product-usage HTTP/1.1
Host: api.plock.io
Authorization: Bearer JWT
Accept: */*
{
  "success": true
}
  • GETGet all accounts
  • GETGet specific account
  • GETGet all subscriptions
  • GETGet specific subscription
  • GETGet all subscription items
  • GETGet specific subscription item
  • GETGet all invoices
  • GETGet specific invoice
  • POSTAdd product usage