Partners API
Overview of the Keep Partner API for integrators: authentication methods, the token lifecycle, best practices, and the error formats and rate limit partner endpoints return.
PayMe Book-keeping Partner API for integrators.
Overview
Authentication Methods
- Client Credentials - Server-to-server authentication
- Refresh Token - Token renewal
Token Lifecycle
- Obtain tokens via Client Credentials
- Use access_token for API requests
- When access_token expires (check expires_in)
- Use refresh_token to obtain new access_token
- When refresh_token expires, re-authenticate
Best Practices
- Store credentials securely - Never expose
client_secretin client-side code - Use HTTPS - All API requests must use HTTPS
- Implement token refresh - Proactively refresh tokens before expiration
- Handle errors gracefully - Implement retry logic with exponential backoff
Errors and rate limits
- Token endpoint errors return
erroranderror_description. A wrong client ID or secret returns HTTP 401unauthorized_client; a scope not granted to your client returns HTTP 401unauthorized_scope; an unknown refresh token returns HTTP 400invalid_request. - Guard and validation HTTP errors normally include
statusCodeandmessage, pluscorrelationIdandcategory. Some legacy endpoints addstatus; unhandled errors can omitmessage.messageis a list for validation errors. - A missing or expired access token returns HTTP 401. A token without the required scope returns HTTP 403.
/api/public/sellers,/api/public/expensesand/api/public/plansare rate limited per partner domain and return HTTP 429 when the limit is exceeded. The429body is plain text, not the JSON error shape; theRateLimit-Limit,RateLimit-RemainingandRateLimit-Resetheaders show the quota.- Every response carries an
X-Request-Idheader, and anX-Correlation-Idheader beside it. Quote them when contacting support. If you send your ownX-Request-Id, it is echoed back. - The document-failure webhook example uses
errorCodeTAX_AUTHORITY_REJECTED("Document rejected by tax authority - invalid VAT number").
Endpoints
- Obtain access token: POST /oauth2/token
- Create seller: POST /api/public/sellers/create
- Get seller: GET /api/public/sellers/{sellerId}
- Get available plans: GET /api/public/plans
- List expenses: GET /api/public/expenses
- Upload expense document: POST /api/public/expenses
- Update expense: PATCH /api/public/expenses/{expenseId}
- Update seller: PUT /api/public/sellers/{sellerId}/update
- Set seller billing plan: POST /api/public/plans/activate
- List income documents: GET /partner/api/documents/income
- Create manual income document: POST /partner/api/documents/income/manual
- Get financial checkpoints: GET /partner/api/statistic/checkpoints
- Get tax predictions: GET /partner/api/statistic/tax-predictions