Skip to content

Order port

POST
/ports/order
curl --request POST \
--url https://api.ltesocks.io/v2/ports/order \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "plan": "5349b4ddd2781d08c09890f3", "tarification": { "time": 2592000, "traffic": 51200, "price": 14500 } }'

Legacy JSON and HTTP statuses are preserved, including error objects and HTTP 500 for insufficient balance and validation failures. Idempotency uses the configured TTL and lock timeout; server errors are not cached by default. Optional X-LTESocks-Order-State is not-created, created, or unknown. Only not-created proves that this attempt did not create an order. A missing response or unknown state must not be treated as a safe retry. X-LTESocks-Error-Code can be priceChanged, insufficientBalance, validationFailed, unauthorized, forbidden, portDetailsUnavailable, upstreamError, or idempotencyConflict. These headers are additive and do not change the handling of another POST.

Idempotency-Key
string format: uuid

Optional UUID that identifies one mutation request. Reuse it only when retrying the same request.

Plan parameters

Media typeapplication/json
object
plan

Plan ID

string
Example
5349b4ddd2781d08c09890f3
tarification
object
time

Plan duration time in seconds

integer
Example
2592000
traffic

Plan traffic amount in megabytes

integer
Example
51200
price

Plan price in cents

integer
Example
14500

Successful operation

Media typeapplication/json
object
port

Port number

string
ip

Port current IP address (0.0.0.0 if not available)

string
geoip
object
continentCode
string
continentName
string
countryCode2
string
countryCode3
string
stateProv
string
district
string
city
string
zipcode
string
latitude
string
longitude
string
isp
string
status

Port status

string
Allowed values: active reset suspended disconnected outoftraffic
currentStatus

Current status

string
Allowed values: active declined
resetToken

Port reset token

string
signature

Port signature

string
vpnAccess

Indicates whether port has access to the VPN server

boolean
autoResetInterval

Port auto reset interval in seconds, 0 means disabled

integer
tags

Port tags

Array<string>
<= 30 characters
plan
object
id

Plan ID

string
name

Plan title

string
countryCode

Plan country code

string
enabled

Indicates whether plan is active

boolean
autoRenew

Indicates whether plan auto renewal is active

boolean
activatedAt

Plan activation time

string format: date-time
expiresAt

Plan expiration time

string format: date-time
trafficRemains

Remaining traffic amount in megabytes

integer
tarification
object
time

Plan duration time in seconds

integer
traffic

Plan traffic amount in megabytes

integer
price

Plan price in cents

integer
credentials
object
ip
Array<string>
<= 20 characters
password
Array<object>
<= 20 characters
object
login
string
password
string
Example
{
"port": 10000,
"ip": "1.1.1.1",
"geoip": {
"continentCode": "NA",
"continentName": "North America",
"countryCode2": "US",
"countryCode3": "United States",
"latitude": "38.89037",
"longitude": "-77.03196",
"isp": "T-Mobile USA, Inc."
},
"status": "active",
"currentStatus": "active",
"resetToken": "6015510d206e4d7b023e5f978a56e3cf49d7e79bc26cf28c69b75314e098a61b",
"signature": "Windows",
"vpnAccess": true,
"plan": {
"id": "5349b4ddd2781d08c09890f3",
"name": "UK Three",
"countryCode": "UK",
"enabled": true,
"autoRenew": true,
"activatedAt": "2022-04-02T05:57:29.054Z",
"expiresAt": "2022-05-02T05:57:29.054Z",
"trafficRemains": 51200,
"tarification": {
"time": 2592000,
"traffic": 51200,
"price": 14500
}
},
"credentials": {
"ip": [
"2.2.2.2"
],
"password": [
{
"login": "login",
"password": "password"
}
]
}
}
X-LTESocks-Order-State
string
Allowed values: created

Unauthenticated (legacy error object).

Media typeapplication/json
object
error
required

Error text representation

string
code
required

Error code representation

integer
Example
{
"error": "example error",
"code": 400
}

Price changed; legacy error object without quote data. Reload plans before confirming again.

Media typeapplication/json
object
error
required

Error text representation

string
code
required

Error code representation

integer
Example
{
"error": "example error",
"code": 400
}
X-LTESocks-Error-Code
string
Allowed values: priceChanged
X-LTESocks-Order-State
string
Allowed values: not-created

Legacy error. Optional retry headers are preserved.

Media typeapplication/json
object
error
required

Error text representation

string
code
required

Error code representation

integer
Example
{
"error": "example error",
"code": 400
}
X-LTESocks-Order-State
string
Allowed values: not-created created unknown
X-LTESocks-Error-Code
string
Retry-After
string
Retry-At
string