API

REST API · v1

TrustService API v1

Connect your application to TrustService: list services, create an order, receive its SMS, cancel it and check your balance. Send your API key in a request header.

Your key

JSON responses · up to 60 requests per minute per account.

X-API-Key: YOUR_API_KEY
Authorization: Bearer YOUR_API_KEY
GET/api/v1/services

List services

The country parameter is optional. Each result contains an ID, country, name, customer price and currency.

https://trustservice.io/api/v1/services?country=US
POST/api/v1/orders

Create an order

Create an order with a service ID. TrustService returns the order ID; use it to check the status and read the SMS.

Content-Type: application/json

{"service_id": 123}
GET/api/v1/orders/{id}

Order status and SMS

Possible statuses are waiting, completed and closed. After an SMS arrives, the message field contains its text.

https://trustservice.io/api/v1/orders/{order_id}
POST/api/v1/orders/{id}/cancel

Cancel an order

https://trustservice.io/api/v1/orders/{order_id}/cancel
GET/api/v1/balance

Balance

https://trustservice.io/api/v1/balance
HTTP4xx / 5xx

Errors

The API uses standard HTTP codes: 401 invalid or disabled key, 402 insufficient balance, 404 order not found, 409 order or cancellation failed, 422 invalid service, and 429 rate limit exceeded.