TrustService API

REST API · v1

TrustService API v1

Use the API to list services, create an order, check for an SMS, cancel a waiting order and read your balance. Enable API access in your account and send the key in a request header, not in the URL.

Uw API-sleutel

API v1 returns JSON and allows up to 60 requests per minute for each user.

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

TrustService kiest automatisch het beste beschikbare nummer voor je aanvraag. Als de eerste optie niet beschikbaar is, controleert het systeem direct de volgende tegen dezelfde getoonde prijs. Je hoeft de bestelling niet opnieuw te plaatsen.

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.