Skip to content

Commit

Permalink
deploy: 55583fd
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegPhenomenon committed Nov 19, 2024
0 parents commit 72d48ae
Show file tree
Hide file tree
Showing 7 changed files with 5,150 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
dist/
*.log
Empty file added .nojekyll
Empty file.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Business Registry API Documentation

This repository contains the OpenAPI specification and documentation for the Business Registry API.

## Viewing the Documentation

You can view the live documentation at [https://internetee.github.io/domain-reservation-api-docs/](https://internetee.github.io/domain-reservation-api-docs/)

## Development

To run the documentation locally:

1. Clone this repository
2. Run `npm install`
3. Run `npm start`

To build the static documentation:

1. Run `npm run build`
2,280 changes: 2,280 additions & 0 deletions index.html

Large diffs are not rendered by default.

364 changes: 364 additions & 0 deletions openapi/openapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,364 @@
openapi: 3.0.0
info:
title: Business Registry API
version: 1.0.0
description: |
API for managing domain name registration and reservation in the business registry.
Key features:
- Domain name reservation (with and without payment)
- Long-term domain reservation
- Payment processing and status tracking
- Registration code retrieval
- Multiple domain handling
Process Overview:
1. Domain Name Suggestions:
Use the '/business_registry/domain_names' endpoint to receive suggestions for available domain names.
2. Domain Reservation Options:
- Standard Reservation: Use '/business_registry/reserve_domains' for immediate reservation without payment
- Long-term Reservation: Use '/business_registry/long_reserve_domains' for paid long-term reservation
3. Payment and Status Tracking:
- For long-term reservations, use '/business_registry/long_reserve_domains_status' to track payment status
4. Registration Code Retrieval:
Use '/business_registry/registration_code' to get the registration code after successful payment.
Important Notes:
- Maximum limit of domains per request applies (MAX_DOMAIN_NAME_PER_REQUEST)
- All endpoints require either IP authentication or token authentication
- CORS headers are included in all responses
- Payment processing includes success and failure callback URLs
servers:
- url: https://api.example.com/v1
description: Main API server

paths:
/business_registry/domain_names:
get:
summary: Get available domain name variants
description: |
Generates and returns a list of available domain name variants based on the organization name.
Requires IP authentication.
parameters:
- in: query
name: organization_name
required: true
schema:
type: string
description: Organization name to generate domain name variants
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: object
properties:
variants:
type: array
items:
type: string

/business_registry/long_reserve_domains:
post:
summary: Reserve domains for long-term with payment
security:
- CustomTokenAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
domain_names:
type: array
items:
type: string
success_url:
type: string
description: Callback URL for successful payment
failed_url:
type: string
description: Callback URL for failed payment
required:
- domain_names
responses:
'201':
description: Domains successfully reserved
content:
application/json:
schema:
type: object
properties:
payment_link:
type: string
reserved_domains:
type: array
items:
type: object

/business_registry/long_reserve_domains_status:
get:
summary: Get status of long-term reserved domains
security:
- CustomTokenAuth: []
parameters:
- in: query
name: invoice_number
schema:
type: string
- in: query
name: user_unique_id
schema:
type: string
responses:
'200':
description: Status retrieved successfully
content:
application/json:
schema:
type: object
properties:
status:
type: string
invoice_details:
type: object

/business_registry/reserve_domains:
post:
summary: Reserve domains without payment
security:
- CustomTokenAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
domain_names:
type: array
items:
type: string
description: Array of domain names to reserve (limited by MAX_DOMAIN_NAME_PER_REQUEST)
required:
- domain_names
responses:
'201':
description: Domains successfully reserved
content:
application/json:
schema:
type: object
properties:
message:
type: string
reserved_domains:
type: array
items:
type: object

/business_registry/refresh_token:
patch:
summary: Refresh access token
description: |
Refreshes an existing access token.
The current token must be provided in the X-Auth-Token header.
No request body is required.
Returns a new unique token to replace the current one.
Note: The initial token is issued when a domain is reserved.
security:
- CustomTokenAuth: []
responses:
'200':
description: Token successfully refreshed
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: "Token refreshed successfully"
token:
type: string
example: "new_unique_token_123xyz"
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'

/business_registry/registration_code:
get:
summary: Get registration code for reserved domain
description: |
Returns the registration code (password) for a reserved domain.
This code is crucial for the domain registration process with registrars.
The registrar will require this code to verify and complete the registration of the reserved domain.
Note: Keep this code confidential and provide it only to your chosen registrar when initiating the domain registration process.
security:
- CustomTokenAuth: []
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: object
properties:
name:
type: string
description: The name of the reserved domain
example: "example-company.ee"
registration_code:
type: string
description: The registration code (password) to be used when registering the domain with a registrar
example: "secure_registration_code_123xyz"
'401':
$ref: '#/components/responses/Unauthorized'
'404':
description: Reserved domain not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'

/business_registry/release:
delete:
summary: Release reserved domain
description: Releases a previously reserved domain
security:
- CustomTokenAuth: []
responses:
'200':
description: Domain successfully released
content:
application/json:
schema:
type: object
properties:
message:
type: string
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
'422':
$ref: '#/components/responses/UnprocessableEntity'

/business_registry/reserve:
post:
summary: Reserve a domain
description: Reserves the specified domain
security:
- CustomTokenAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
domain_name:
type: string
required:
- domain_name
responses:
'201':
description: Domain successfully reserved
content:
application/json:
schema:
type: object
properties:
message:
type: string
token:
type: string
linkpay:
type: string
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'422':
$ref: '#/components/responses/UnprocessableEntity'

/business_registry/status:
get:
summary: Get reserved domain status
description: Returns the current status of a reserved domain
security:
- CustomTokenAuth: []
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: object
properties:
invoice_status:
type: string
reserved_domain:
type: string
password:
type: string
'401':
$ref: '#/components/responses/Unauthorized'
'422':
$ref: '#/components/responses/UnprocessableEntity'

components:
securitySchemes:
CustomTokenAuth:
type: apiKey
in: header
name: X-Auth-Token
description: |
Custom token for identifying specific database records.
This token is required for all endpoints except /business_registry/domain_names.
The initial token is issued when a domain is reserved and can be refreshed using the /business_registry/refresh_token endpoint.
Note that IP restriction applies to all endpoints regardless of token requirement.
schemas:
Error:
type: object
properties:
error:
type: string
required:
- error

responses:
BadRequest:
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
Unauthorized:
description: Unauthorized access
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
UnprocessableEntity:
description: Unprocessable entity
content:
application/json:
schema:
type: object
properties:
error:
type: string
details:
type: array
items:
type: string
Loading

0 comments on commit 72d48ae

Please sign in to comment.