Temp-Number Backend API (by Platfone) (1.0.0)

Download OpenAPI specification:

Overview

The Temp-Number Backend API (aka Temp-Number API) is an API layer provided by the Temp-Number Backend. This backend is an open-source solution for mobile and web applications, enabling seamless integration for selling temporary virtual phone numbers used in SMS activations and OTP verification. Built on Node.js, it efficiently manages customer accounts, balances, and activation workflows.

This API uses Firebase Authentication to authenticate app users but can be replaced with any other authentication system. Authenticated users are synced with Platfone customers while removing all personally identifiable information. The backend handles payments and balance adjustments, syncing with Temp-Number’s backend system. Through this integration, your app gains access to Temp-Number’s pool of temporary phone numbers, ensuring high SMS verification success rates.

Key Features

  • User Authentication: Uses Firebase Authentication to authenticate app users and associate with Platfone customers.
  • Temporary Phone Numbers: Provides temporary virtual phone numbers for SMS activations and OTP verification.
  • Activation Management: API for managing customer activations, balances, and transaction history.
  • Profit Margin Control: Define a markup that applies to every activation.
  • Example Apps: Open-source iOS, Android, and web apps demonstrating API integration.

Getting Started

  1. Register: Sign up at Platfone.
  2. Sandbox Mode: Test without charges; use a test balance for trial transactions.
  3. Install Backend: Follow the installation guide.
  4. Explore Example Apps: Check our sample iOS and Android apps.
  5. Support: Contact us via contact us form or email.

Application Flow

  1. User Registration: Register users with Firebase Authentication.
  2. Balance Management: Users top up in your app, creating a linked customer in Platfone.
  3. Service Selection: Users choose a service and country using getServices and getCountries.
  4. Display Prices: Retrieve pricing with getPriceByService, getPriceByCountry, and getPricesForServiceInCountry.
  5. Activation: Initiate an activation with createActivation.
  6. SMS Handling: Poll for SMS updates every 10 seconds using getActivation or getActiveActivations.
  7. Balance Check: Retrieve the user's balance with getBalance.

API Summary

API Endpoints

Application Endpoints (User-facing)

  • app-createActivation – Initiate a new activation.
  • app-getActiveActivations – List active activations.
  • app-getActivation – Get activation details.
  • app-retryActivation – Request an SMS resend.
  • app-cancelActivation – Cancel an activation.
  • app-getActivationHistory – Retrieve activation history.
  • app-getBalance – Check customer balance.
  • app-getTransactions – View transaction history.
  • app-getActivationReportReasons – List reasons for reporting activations.
  • app-reportActivation – Report an activation.
  • app-getReport, app-getReports – View reports with pagination.

Catalog & Pricing Endpoints

  • app-getCountries – Retrieve available activation countries.
  • app-getServices – Get services eligible for activations.
  • app-getPricesByService, app-getPricesByCountry, app-getPricesForServiceInCountry – Retrieve pricing data.

Payment Endpoints

  • stripe-getPaymentIntent – Create a Stripe payment intent.
  • appstore-createTransaction – Handle App Store transactions.
  • googleplay-createTransaction – Handle Google Play transactions.
  • googleplay-handleWebhookEvents – Process Google Play webhook events.
  • appstore-handleWebhookEvents – Process App Store webhook events.

Management Endpoints (Admin-only)

  • manage-createCustomer – Create a customer profile.
  • manage-changeCustomer – Update customer status.
  • manage-createCustomerTransaction – Adjust customer balance.
  • manage-getCustomers – List all customers and balances.
  • manage-getCustomersActivationHistory – View activation history.
  • manage-getCustomersTransactions – View transaction history.

Activation Workflow

  1. Request Number: Select a service and country, receiving an activation id and phone.
  2. Prompt SMS: The user sends an SMS to the provided phone.
  3. Poll for Status: Check the SMS status using getActivation every 10 seconds until smsReceived or expire_at.

Rate Limits

  • Success Rate Requirement: Maintain at least a 7% success rate for SMS reception after 10 ordered numbers; otherwise, a 24-hour block is enforced.
  • Activation Limit: A maximum of 20 active activations per user. Exceeding this limit results in a 429 error. Free up space by canceling an activation or contacting support.
  • API Rate Limits: Refer to the API documentation for detailed rate limits.

Application essentials

This section includes endpoints used by your application to operate on a single customer. Examples include creating and managing activation for a customer, retrieving his balance, transactions, etc. Endpoints have the prefix app-.

Order number for activation

Returns a mobile phone number for service activation and activation ID. Bills customers amount specified by you. Send an SMS to the provided phone number and use the activation ID to check the SMS with app-getActivation.

Basics

  • Specify service_id and country_id to order a number. Retrieve these IDs via app-getServices and app-getCountries.
  • For services not listed in catalog, use the special other service.
  • is_retriable field in response suggests, if the activation can receive multiple SMS messages.

Price Considerations

Billing for SMS Activation

  • Only Successful Activations are Billed: You and customer are charged only for activations where an SMS is successfully received. It's important to note that within each activation, only the first received SMS incurs a charge, ensuring you pay only for successful service activation.
  • Both Developer and Customer are Billed: The developer is billed for the activation cost, while customer billed by adding markup to price. This ensures you can pass on the cost to the customer while still covering your own expenses.

Customer billing

You set CUSTOMER_MARKUP during NodeJS-App Backend installation. CUSTOMER_MARKUP applies to base prices (check them in https://platfone.com). In getPricesByCountry, getPricesByCountry and getPricesForServiceInCountry you get prices with CUSTOMER_MARKUP already applied and ready to be shown to the customer.


🔄 Handling Price Changes

The market for temporary numbers is highly dynamic — prices may change every minute.

To prevent overcharging the customer, you MUST set the customer_max_price parameter when creating an activation. This value represents the maximum amount (in USD cents) your customer is willing to pay. Practically, you should set customer_max_price to the price you display in your app or UI, ensuring consistency and trust in your pricing.

🚧 What Happens If the Price Increases?

If no phone number is available at or below your specified customer_max_price, the request will fail with a:

409 MaxPriceExceededException

This means:

  • Your price cap was too low for current availability
  • But a number just above your limit is available

The response includes:

  • suggestedPrice: the updated lowest price available
  • order_id: a unique continuation token to retry the activation attempt

🔁 How to Retry the Same Activation Attempt

To continue smoothly:

  1. Show the suggestedPrice to your customer, if needed
  2. Retry the request using:
  • The same order_id
  • An updated customer_max_price (e.g., equal to suggestedPrice or higher)

This allows the system to continue the original activation attempt, avoiding full reprocessing and improving the success rate.

✅ Best Practice

  • Set customer_max_price to the price you actually show the customer
  • On MaxPriceExceededException, use the order_id together with the new customer_max_price to retry seamlessly without starting from scratch

Quality Considerations

We constantly monitor the quality of our phone number suppliers. Since higher quality numbers have a better chance of successfully receiving SMS messages, we recommend taking quality into account when ordering numbers.

Quality Factor: The quality_factor parameter allows you to balance quality against price. This parameter is an integer ranging from 0 to 100, with a default value of 50.

  • A value of 0 means you prioritize price, essentially disregarding quality in the number selection process.
  • A value of 50 indicates you value price and quality equally, offering a balanced approach in your selection.
  • A value of 100 indicates a preference for quality, making it the primary criterion for number selection, regardless of price.
Authorizations:
firebase_auth
Request Body schema: application/json
service_id
required
string [ 1 .. 30 ] characters

ID of Service being verified. Can be retrieved using app-getServices

country_id
required
string [ 2 .. 9 ] characters

ID of phone number Country. Can be retrieved using app-getCountries

customer_max_price
required
integer [ 1 .. 10000 ]

Maximum price in USD cents your customer is willing to pay for activation. This safeguards against price changes. Practically, you should set customer_max_price to the price you show to the customer. If the actual price exceeds this limit, a 409 error MaxPriceExceededException is returned along with the new suggested price.

order_id
string

Optional continuation token for an activation attempt that failed due to pricing limits.

When you receive a 409 MaxPriceExceededException, it means no phone numbers were available within your specified customer_max_price, but alternatives are available just above your limit.

In that case, the response includes a suggestedPrice and an order_id. To retry the same activation attempt at the suggested price (or higher), send a new request using the same order_id and a higher customer_max_price.

This ensures the system can continue the previous attempt with the same selection context, potentially increasing the success rate and reducing redundant attempts.

Recommended Usage:

  • Store the order_id when handling a 409 MaxPriceExceededException.
  • Use it to continue the activation attempt once you've decided to raise the customer_max_price.
quality_factor
number [ 0 .. 100 ]

Quality factor for the number. The quality factor is a number between 0 and 100. The default value is 50. 0 - means prefer price over quality. 100 - means prefer quality over price.

Responses

Request samples

Content type
application/json
{
  • "service_id": "7eleven",
  • "country_id": "us",
  • "customer_max_price": 90,
  • "order_id": "682b17b958bf608ceae5ec3c",
  • "quality_factor": 10
}

Response samples

Content type
application/json
{
  • "activation_id": "64a1c0e8d2a1f9b7e45d3b8e",
  • "customer_id": "yHZpQ8lf89aLt8uR6hNyJH7gk0y5",
  • "customer_price": 80,
  • "price": 20,
  • "phone": "14155552671",
  • "country_id": "us",
  • "service_id": "netflix",
  • "sms_status": "smsRequested",
  • "activation_status": "active",
  • "billing_status": "reserved",
  • "report_status": null,
  • "sms_code": null,
  • "sms_text": null,
  • "expire_at": 1729088539,
  • "updated_at": 1729087939,
  • "created_at": 1729087339,
  • "is_retriable": false,
  • "cancelable_after": null,
  • "formatted": "+1 415 555-2671"
}

Get active activations

Fetches active activations IDs. Optionally include activation data.

Authorizations:
firebase_auth
query Parameters
with_data
boolean
Default: false
Example: with_data=true

Include activation data

Responses

Response samples

Content type
application/json
Example
[
  • "64a1c0e8d2a1f9b7e45d3b8e",
  • "63f4d0dab040a865d80da08d",
  • "63f4d0dab040a865d80da08a"
]

Get activation state

Retrieve the activation state, including activation status, sms status, billing status, expiration, SMS code and text message, etc.
Typically, this endpoint is polled either until the SMS is received or the activation expires.

Statuses

There are several statuses that an activation can have, each representing a different state of the activation process. The following are the possible statuses:

💬 sms_status

  • Description: Represents the current state of the SMS interaction within the activation process.
  • Possible Values:
    • "smsRequested": The initial state when an SMS is requested but not yet received.
    • "smsReceived": The SMS has been received.
    • "retryRequested": The user has requested another SMS.
    • "retryReceived": The user has received a another SMS.

🔁 activation_status

  • Description: Represents the overall state of the activation.
  • Possible Values:
    • "active": The activation is currently active and can proceed.
    • "finalized": The user has confirmed the activation, and no further changes are possible.
    • "expired": The activation has expired based on the expire_at timestamp.
    • "canceled": The activation was canceled before any SMS was received.

💳 billing_status

  • Description: Indicates the billing state of the activation.
  • Possible Values:
    • "reserved": Funds are reserved from the user's available balance upon activation creation.
    • "released": No SMS was received, and reserved funds were returned to the available balance.
    • "billed": An SMS was received, and the reserved funds have been charged.
    • "refunded": A refund was issued after a user report, and the amount was returned to the available balance.

📝 report_status

  • Description: Represents the status of report filed by the user regarding the activation (e.g., reporting a wrong SMS).
  • Possible Values:
    • null: No report has been made.
    • "inReview": The report is under review.
    • "declined": The report was reviewed, and no refund was granted.
    • "approved": The report was reviewed, and a refund was issued.

Expiration

Each activation has a limited lifetime. The expiration time of an activation can be determined by the expire_at attribute. If the activation is not completed within this timeframe, it will expire, and no further SMS retrievals will be possible.

Usage Notes

  • Expiration Handling: Developers should validate the expire_at field to ensure the activation is still valid. If the current time is past expire_at, consider the activation expired, even if the activation_status field has not yet been updated to "expired".
  • Finalization: The activation_status field includes "finalized" to indicate that the activation has been confirmed by the user, and no further changes are allowed. Finalized activations should be removed from the active activations list.
  • Reporting: Use the report_status field to track the outcome of any user reports regarding issues with the activation. This field is closely related to the billing_status if a refund is issued.
  • Cancellation: The cancelable_after field indicates when an activation can be canceled. If this field is null, the activation does not support cancellation. If the current time is past the cancelable_after timestamp, the activation can be canceled using cancel operation.
  • Retry Handling: The is_retriable field indicates whether the user can request another SMS. If true, the user can request a retry SMS using the retry operation. Retry possible after first sms recieved and while activation_status is active.
  • Billing: The price field indicates the cost of the activation in USD cents. The amount is reserved from the user's available balance when the activation is created. The billing_status field indicates the current billing state of the activation.
Authorizations:
firebase_auth
query Parameters
activation_id
required
string
Example: activation_id=63f4d0dab040a865d80da08a

Activation id

Responses

Response samples

Content type
application/json
Example
{
  • "activation_id": "64a1c0e8d2a1f9b7e45d3b8e",
  • "customer_id": "yHZpQ8lf89aLt8uR6hNyJH7gk0y5",
  • "customer_price": 80,
  • "price": 20,
  • "phone": "14155552671",
  • "country_id": "us",
  • "service_id": "netflix",
  • "sms_status": "smsRequested",
  • "activation_status": "active",
  • "billing_status": "reserved",
  • "report_status": null,
  • "sms_code": null,
  • "sms_text": null,
  • "expire_at": 1729088539,
  • "updated_at": 1729087939,
  • "created_at": 1729087339,
  • "is_retriable": false,
  • "cancelable_after": null,
  • "formatted": "+1 415 555-2671"
}

Retry activation

Instructs the server to overwrite the previous SMS with the first one arriving. Both "code" and "text" fields will be updated. This operation is free of charge, as billing occurs upon receipt of the first SMS.

This operation is only possible if:

  • sms_status of the activation is either smsReceived or retryReceived.
  • activation_status = active.
  • Activation attribute is_retriable = true.
Authorizations:
firebase_auth
Request Body schema: application/json
activation_id
required
string

Activation ID

Responses

Request samples

Content type
application/json
{
  • "activation_id": "63f4d0dab040a865d80da08a"
}

Response samples

Content type
application/json
{
  • "result": "success"
}

Cancel activation

Typically, you can cancel an active activation as long as no SMS has been received.
The cancelable_after field indicates when an activation can be canceled:

  • If this field is null, the activation does not support cancellation.
  • If the current time is past the cancelable_after timestamp, the activation can be canceled using cancel operation.

Cancellation is only possible if:

  • activation_status = active.
  • sms_status = smsRequested.
  • cancelable_after allows cancelation.
Authorizations:
firebase_auth
Request Body schema: application/json
activation_id
required
string

Activation ID

Responses

Request samples

Content type
application/json
{
  • "activation_id": "63f4d0dab040a865d80da08a"
}

Response samples

Content type
application/json
{
  • "result": "success"
}

Finalize activation

Finalize an activation to prevent further SMS messages from being sent to the phone number and to reduce the number of active numbers.

Finalize is only possible if:

  • sms_status of the activation is either of smsReceived, retryRequested or retryReceived.
  • activation_status = active
  • billing_status = billed
Authorizations:
firebase_auth
Request Body schema: application/json
activation_id
required
string

Activation ID

Responses

Request samples

Content type
application/json
{
  • "activation_id": "63f4d0dab040a865d80da08a"
}

Response samples

Content type
application/json
{
  • "result": "success"
}

Get activations history

Fetches a history of activations, offering a comprehensive overview of past activation records. Each record includes details such as the activation ID, phone number, country ID, service ID, statuses, SMS code, SMS text, and timestamps for expiration and last update. The response is organized in a paginated format, allowing for efficient navigation through the activation records.

Authorizations:
firebase_auth
query Parameters
exclude_reported
boolean
Default: false
Example: exclude_reported=true

If true, only activations where report_status is null will be returned. If set exclude_active and only_expired are ignored.

exclude_active
boolean
Default: false
Example: exclude_active=true

If true, only activations where activation_status is not active will be returned. If set only_expired is ignored.

only_expired
boolean
Default: false
Example: only_expired=true

If true, only activations where activation_status is expired will be returned.

page
integer
Default: 1
Example: page=3

Selected page number

limit
integer [ 1 .. 100 ]
Default: 10
Example: limit=10

Items limit per page

Responses

Response samples

Content type
application/json
{
  • "activations": [
    ],
  • "page": 1,
  • "limit": 10,
  • "pages": 5,
  • "total": 48
}

Get balance

Retrieves the current balance of customer, which is provided in USD cents. Note that there may be a slight delay in the balance update.

  • Total: The total available balance, in USD cents.
  • Reserved: The portion of the balance reserved for activations that have not yet been completed, also in USD cents.
Authorizations:
firebase_auth

Responses

Response samples

Content type
application/json
{
  • "total": 2301,
  • "reserved": 210
}

Get transactions

Get transactions list of customer. Filter by creation date.

Authorizations:
firebase_auth
query Parameters
created_from_timestamp
integer
Example: created_from_timestamp=1632400000

Unix timestamp in seconds. If provided, only transactions created after this timestamp will be returned.

created_to_timestamp
integer
Example: created_to_timestamp=1632486400

Unix timestamp in seconds. If provided, only transactions created before this timestamp will be returned.

page
integer >= 1
Default: 1
Example: page=3

Selected page number. Default is 1.

limit
integer [ 1 .. 100 ]
Default: 10
Example: limit=10

Maximum number of transactions to return. Default is 100. If not provided, 100 customers will be returned.

Responses

Response samples

Content type
application/json
{
  • "transactions": [
    ],
  • "page": 1,
  • "limit": 10,
  • "pages": 5,
  • "total": 48
}

Get customer info

Retrieve information about a customer

Authorizations:
firebase_auth

Responses

Response samples

Content type
application/json
{
  • "accountOnHold": false
}

Request customer deletion

Request to delete a customer. The customer is marked for deletion and all operations are restricted.

Authorizations:
firebase_auth

Responses

Response samples

Content type
application/json
{
  • "result": "success"
}

Get notifications settings

Get notifications settings of customer.

Authorizations:
firebase_auth

Responses

Response samples

Content type
application/json
{
  • "email_enabled": true,
  • "push_enabled": true
}

Set notifications settings

Set notifications settings of customer.

Authorizations:
firebase_auth
Request Body schema: application/json
email_enabled
boolean

If true, the user will receive email notifications. If false, the user will not receive email notifications.

push_enabled
boolean

If true, the user will receive push notifications. If false, the user will not receive push notifications.

fb_token
string

The Firebase notification token of the user. if present than renew last time access of token or add new. Max 5 tokens per user, if more than 5 tokens than remove the oldest token.

Responses

Request samples

Content type
application/json
{
  • "email_enabled": true,
  • "push_enabled": true,
  • "fb_token": "1234567890"
}

Response samples

Content type
application/json
{
  • "result": "success"
}

Set contact us email

Set contact us email

Authorizations:
firebase_auth
Request Body schema: application/json
email
required
string

The email address of the user who is sending the email. This email address will be used as the reply-to address.

subject
required
string

The subject of the email.

message
required
string

The body of the email.

recaptcha_token
required
string

The reCAPTCHA token generated by the reCAPTCHA Enterprise. This token is used to verify that the user is not a bot. reCaptch action: "contact_us"

platform
required
string
Enum: "web" "android" "ios"

The platform from which the email is being sent. This can be either 'web' or 'android' or 'ios'.

Responses

Request samples

Content type
application/json
{
  • "email": "[email protected]",
  • "subject": "I have a question",
  • "message": "I have a question about the product.",
  • "recaptcha_token": "03AGdBq27b8Jkdsjfklsjdkgljsdkfgjslkfjgklsdjfg;sdgf",
  • "platform": "web"
}

Response samples

Content type
application/json
{
  • "result": "success"
}

Prices

The section includes endpoints for obtaining prices for activation. Various services have different activation costs, which also depend on the country of the mobile number being ordered. All prices are listed in USD cents. In addition to the price, you also retrieve the number of available phone numbers for sale.

All prices already have CUSTOMER_MARKUP applied. Meaning this prices meant to be displayed to your customers. The CUSTOMER_MARKUP is set by you during Platfone Firebase Backend installation.

Formula for price calculation is: customer_price = service_price * ( 1 + CUSTOMER_MARKUP/100) , where service_price is the price from the API response.

We have multiple offerings on our side therefore we provide minimum, maximum, and suggested prices per service and country. Min and Max price represents whole price range. If you don't have special price consideration, suggested can be a good choice. Use max_price to set your price limit.

You can check prices at Platfone price section or through API

Price for a Service in a Country

Retrieve the price and availability for a specific service in a specific country. Use service_id and country_id to specify the service and country, respectively. These identifiers can be found via the app-getServices and app-getCountries operations.

query Parameters
service_id
required
string <^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-_]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-_]*[A-Za-z0-9])$> [ 1 .. 30 ] characters
Example: service_id=7eleven

Service ID, as returned by getServices operation.

country_id
required
string [ 2 .. 9 ] characters ^[a-zA-Z0-9]+([-_]*[a-zA-Z0-9]+)*$
Example: country_id=uk

Country ID, as returned by the getCountries operation.

Responses

Response samples

Content type
application/json
{
  • "price": {
    },
  • "quality": {
    },
  • "count": 143
}

Price list organized by country

Retrieve a comprehensive price list, organized by country. This endpoint returns a list of countries, each accompanied by an array of services available within that country, their respective prices, and the amount of available numbers for sale.

Use optional country_id query parameter to get prices in a specific country.

query Parameters
country_id
string [ 2 .. 9 ] characters ^[a-zA-Z0-9]+([-_]*[a-zA-Z0-9]+)*$
Example: country_id=uk

Country ID, as returned by the getCountries operation.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Price list organized by service

Retrieve a comprehensive price list, organized by service. This endpoint returns a list of services, each accompanied by an array of countries available for that service, their respective prices, and the amount of available numbers for sale.

Use optional service_id request parameter to get prices for a specific service.

query Parameters
service_id
string <^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$> [ 1 .. 30 ] characters
Example: service_id=7eleven

Service ID, as returned by getServices operation.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Catalog

The catalog includes endpoints used to retrieve lists of countries and services available for activation. The list of services is regularly updated, with new services added to the catalog as they become available. These lists contain the IDs of the countries and services, which are utilized in the activation process. Before ordering a number, you should first verify the availability of the service and country through the price endpoints.

You get icons for services and countries in the catalog by calling:

  • https://temp-number.sfo3.cdn.digitaloceanspaces.com/retail/png/countries/<country_id>.png
  • https://temp-number.sfo3.cdn.digitaloceanspaces.com/retail/png/services/<service_id>.png

For "any other" service use this icon.

Get countries

Returns a list of countries, including each country's unique identifier and name. Use the country_id to specify the country when creating an activation. Countries that has suffix _v in their country_id are countries that contains only virtual mobile phone numbers. E.g. us_v is United States (Virtual) containing virtual mobile phone numbers in USA.

header Parameters
If-None-Match
string
Example: 2a7d00a6580048cdc81c1ac65bab7be9820e4465

Optional header for cache validation based on X-ETag.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get services

Returns a list of services, including each service unique identifier and name. Use the service_id to specify the service when creating an activation.

Service with ID other is special service that must be used when you want to get number for service activation that is not listed in the services list. Please note that using the other service for activating services that are listed may result in account suspension.

header Parameters
If-None-Match
string
Example: 2a7d00a6580048cdc81c1ac65bab7be9820e4465

Optional header for cache validation based on X-ETag.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get popular services

Returns a list of popular services. It may be used to show the most popular services to the user to simplify the selection process.

Service with ID other is special service that must be used when you want to get number for service activation that is not listed in the services list. Please note that using the other service for activating services that are listed may result in account suspension.

Descriptions and warning texts can be fetched in different languages from: https://temp-number.sfo3.cdn.digitaloceanspaces.com/service_descriptions_and_warnings.json

header Parameters
If-None-Match
string
Example: 2a7d00a6580048cdc81c1ac65bab7be9820e4465

Optional header for cache validation based on X-ETag.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get public keys

Returns a list of public keys

Responses

Response samples

Content type
application/json
{
  • "stripePublishableKey": "sdfgsdfJGJOHsldfghsfdghsd",
  • "paypalClientId": "aksdjfhJhfgksdhfgh",
  • "cryptomusMerchantId": "39568ce08-bfc5-....-215fc3714658"
}

Reports

The section includes endpoints for reporting activations. If you have any issues with the activation process, you can report them using the app-reportActivation endpoint. The report includes a reason for the issue, that can be retrieved using getActivationReportReasons, message and evidence. The report is then reviewed by our team, and you will receive feedback on the issue, which can be viewed using the app-getReport endpoint. The report is used to improve the activation process and ensure the quality of the service.

Get available report reasons for activation

Returns a list of available report reasons IDs with name and evidence requirements for activation. Reasons list depends on current activation state.

Workflow:

  1. Get Available Report Reasons: Before creating a report, you must first retrieve the available report reasons for the specific activation using the getActivationReportReasons endpoint. Along with the list of valid report reason IDs, you will also get if evidence is required.
  2. Create Report: Create a report for the same activation by passing one of the available reason IDs along with evidence, if required.

Use IDs from response to create report for the same activation you got reasons for.

Full list of Report Reasons:

ID Reason name
1 SMS is not coming
2 Wrong SMS received
3 Service not accepting the number
4 Number has been used before
5 Blocked after activation
6 SMS received too late
7 Other reason
Authorizations:
firebase_auth
query Parameters
activation_id
required
string
Example: activation_id=63f4d0dab040a865d80da08a

Activation ID

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Create report for activation

This endpoint allows you to create a report for a specific activation.

Important: Only one report can be created per activation. Submitting invalid or incomplete data may result in the report being declined.

Declined Report Response Details:

If the report is not accepted, you will receive a response with a decline_id. Below are the possible reasons corresponding to each decline_id:

Decline ID Reason
1 Try another number
2 Retry using the same number

Workflow:

  1. Retrieve Available Report Reasons: Before creating a report, you must first retrieve the available report reasons for the specific activation using the getActivationReportReasons endpoint. This will return a list of valid report reason IDs based on the current state of the activation, along with any evidence requirements.

  2. Submit a Report: Once you have obtained the list of valid report reasons, you can create a report by selecting an appropriate reason ID and including any required evidence. If required, the evidence parameter must be provided in base64 format, following the guidelines outlined in the request body specification.

Ensure that the reason ID and any accompanying evidence match the list returned by the getActivationReportReasons endpoint.

Authorizations:
firebase_auth
Request Body schema: application/json
activation_id
required
string

Activation ID

reason_id
required
integer >= 1

ID of reason

message
string <= 1000 characters

Message with details about the report.

evidence
string <base64>

A base64 encoded file, formatted as a data URL, containing evidence for the report.

Acceptable File Types: Acceptable File Types:

Type File Extension MIME Type
Images .jpg image/jpeg
.png image/png
.webp image/webp
Archives .zip application/zip
Documents .pdf application/pdf
Videos .mp4 video/mp4

Maximum File Size: 5MB (5,242,880 bytes).

Example:

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB...

The data URL must begin with the appropriate MIME type, followed by the base64 encoded content.

Note: Ensure that the total size of the base64 encoded data does not exceed the maximum limit, as this can cause the server to reject the request. The server will validate the file type and size during processing.

Responses

Request samples

Content type
application/json
{
  • "activation_id": "63f4d0dab040a865d80da08a",
  • "reason_id": 4,
  • "message": "Service activation is not possible because 2FA was previously enabled.",
  • "evidence": "data:image/png;base64,iVBORw0KGgoAABBAAAB5f..."
}

Response samples

Content type
application/json
Example
{
  • "status": "accepted",
  • "decline_id": null
}

Get report

Return a report object by Activation Id

Authorizations:
firebase_auth
query Parameters
activation_id
required
string
Example: activation_id=63f4d0dab040a865d80da08a

Activation ID

Responses

Response samples

Content type
application/json
{
  • "reason_id": 1,
  • "reason_name": "SMS is not coming",
  • "message": "Test message",
  • "activation_state_snapshot": "{\"activation_status\":\"active\",\"sms_status\":\"smsRequested\",\"billing_status\":\"reserved\",\"sms_code\":null,\"sms_text\":null,\"updated_at\":1725264364}",
  • "updated_at": 1679061001,
  • "created_at": 1679061001,
  • "activation": {
    }
}

Get reports

Returns a list of reports with pagination

Authorizations:
firebase_auth
query Parameters
page
integer
Default: 1
Example: page=3

Selected page number

limit
integer [ 1 .. 100 ]
Default: 10
Example: limit=10

Items limit per page

Responses

Response samples

Content type
application/json
{
  • "reports": [
    ],
  • "page": 1,
  • "limit": 10,
  • "pages": 5,
  • "total": 48
}

Stripe

Create stripe payment intent

Create new stripe payment intent for customer.

Authorizations:
firebase_auth
Request Body schema: application/json
amount
required
integer [ 50 .. 100000 ]

The amount to add to the customer balance, specified in USD cents.

recaptcha_token
required
string

The reCAPTCHA token generated by the reCAPTCHA Enterprise. This token is used to verify that the user is not a bot. reCaptch action: "stripe_payment"

platform
required
string
Enum: "web" "android" "ios"

The platform from which the order is being created. This can be either 'web' or 'android' or 'ios'.

Responses

Request samples

Content type
application/json
{
  • "amount": 350,
  • "recaptcha_token": "03AGdBq27b8Jkdsjfklsjdkgljsdkfgjslkfjgklsdjfg;sdgf",
  • "platform": "web"
}

Response samples

Content type
application/json
{
  • "id": "pi_3MgoJsIPMzVE2",
  • "clientSecret": "pi_3MgoJsIPMzVE2_secret_Dy55",
  • "publicKey": "pk_test_51Meel8IPMzVEnbiR"
}

Get stripe payment intent status

Get stripe payment intent status by payment intent ID.

Authorizations:
firebase_auth
Request Body schema: application/json
payment_intent_id
required
string

The ID of the Stripe payment intent to retrieve the status for.

recaptcha_token
required
string

The reCAPTCHA token generated by the reCAPTCHA Enterprise. This token is used to verify that the user is not a bot. reCaptch action: "stripe_payment"

platform
required
string
Enum: "web" "android" "ios"

The platform from which the order is being created. This can be either 'web' or 'android' or 'ios'.

Responses

Request samples

Content type
application/json
{
  • "payment_intent_id": "pi_3R7OJCHmvjeRhHLx1NKyn0Aw",
  • "recaptcha_token": "03AGdBq27b8Jkdsjfklsjdkgljsdkfgjslkfjgklsdjfg;sdgf",
  • "platform": "web"
}

Response samples

Content type
application/json
{
  • "status": "review"
}

Apple App Store

Create appstore transaction

Create new appstore transaction for customer. Transaction from appstore passed to this endpoint. If transaction is valid and not already registered it will be saved in Firestore database and synced with customer's balance.

Authorizations:
firebase_auth
Request Body schema: application/json
appTransaction
required
string

Appstore transaction payload as jwsTransaction with appTransaction inside.

Responses

Request samples

Content type
application/json
{
  • "appTransaction": "eyJhbGciOiJFUzI1NiIsIng1YyI6WyJNSUlFTURDQ0E3YWdBd0lCQWdJUWZUbGZkMGZOdkZXdnpDMVlJQU5zWGpBS0JnZ3Foa2pPUFFRREF6QjFNVVF3UWdZRFZRUURERHRCY0hCc1pTQlhiM0pzWkhkcFpHVWdSR1YyWld4dmNHVnlJRkpsYkdGMGFXOXVjeUJEWlhKMGFXWnBZMkYwYVc5dUlFRjFkR..."
}

Response samples

Content type
application/json
{
  • "result": "success"
}

Google Play Store

Create Google Play transaction

Create new Google Play transaction for customer. Purchase token from Google Play passed to this endpoint. If token is valid and not already registered it will be saved in Firestore database and synced with customer's balance.

Authorizations:
firebase_auth
Request Body schema: application/json
purchaseTokenString
required
string

Google Play purchase token

Responses

Request samples

Content type
application/json
{
  • "purchaseTokenString": "{\"orderId\":\"GPA.3362-8982-7227-07777\",\"packageName\":\"com.privatix.activate.reseller\",\"productId\":\"one_dollar_purchase\",\"purchaseTime\":1727961892690,\"purchaseState\":0,\"purchaseToken\":\"oppolnojeefhcpiolfiejlmo.AO-J1OzD0FSoQnGAVGkt1SVX6NcVq4suAH5JL0rxMyZuUJMBc4twulwy4Qo5zF-mPSOguPrIUe94ujZW-ruDYQsX57dc6iNO-rz-PK0IumH2MbZk9ziH8OI\",\"quantity\":1,\"acknowledged\":false}"
}

Response samples

Content type
application/json
{
  • "result": "success"
}

Paypal

Create paypal order

Create new paypal order for customer.

Authorizations:
firebase_auth
Request Body schema: application/json
amount
required
integer [ 50 .. 100000 ]

The amount to add to the customer balance, specified in USD cents.

recaptcha_token
required
string

The reCAPTCHA token generated by the reCAPTCHA Enterprise. This token is used to verify that the user is not a bot. reCaptch action: "paypal_payment"

platform
required
string
Enum: "web" "android" "ios"

The platform from which the order is being created. This can be either 'web' or 'android' or 'ios'.

Responses

Request samples

Content type
application/json
{
  • "amount": 350,
  • "recaptcha_token": "03AGdBq27b8Jkdsjfklsjdkgljsdkfgjslkfjgklsdjfg;sdgf",
  • "platform": "web"
}

Response samples

Content type
application/json
{}

Caprture paypal order

Capture paypal order for customer.

Authorizations:
firebase_auth
Request Body schema: application/json
order_id
required
string

Paypal order Id

Responses

Request samples

Content type
application/json
{
  • "order_id": "3WH44913RS936084G"
}

Response samples

Content type
application/json
{
  • "result": "success"
}

Cryptomus

Create cryptomus payment

Create new cryptomus payment for customer.

Authorizations:
firebase_auth
Request Body schema: application/json
amount
required
integer [ 50 .. 100000 ]

The amount to add to the customer balance, specified in USD cents.

url_return
required
string

The URL to redirect after payment.

url_success
required
string

The URL to redirect after successful payment.

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json

Management endpoints

This section includes endpoints for managing customers and get general information about retail service usage. E.g. create customer, disable customer, get customers list, get activation history of all customers, get all transactions, etc. Endpoints have the prefix manage-.

Create new customer

Create new customer and set initial balance.

Authorizations:
firebase_auth
Request Body schema: application/json
customer_id
required
string <^[a-zA-Z0-9]+$> [ 1 .. 80 ] characters

ID of customer. Must be unique.

balance
integer [ 0 .. 100000 ]

Initial customer balance in USD cents. If it is greater than zero, financial transaction will be added with purchase_id = initial to customer transactions.

Responses

Request samples

Content type
application/json
{
  • "customer_id": "xDWxt7dd6efro3yWL4qfuEWjvAz1",
  • "balance": 90
}

Response samples

Content type
application/json
{
  • "result": "success"
}

Change customer

Change customer status.

Available statuses:

  • disabled - customer is disabled. All customers operations are restricted.
  • active - customer is active. All customers operations are allowed.
  • paused - customer is paused. New activations are restricted.
  • markedForDeletion - customer is marked for deletion. All customers operations are restricted.
Authorizations:
firebase_auth
Request Body schema: application/json
customer_id
required
string <^[a-zA-Z0-9]+$> [ 1 .. 80 ] characters

ID of customer. Must be unique.

status
required
string
Enum: "disabled" "active" "paused" "markedForDeletion"

New customer status. Can be disabled, active, paused, markedForDeletion.

Responses

Request samples

Content type
application/json
{
  • "customer_id": "xDWxt7dd6efro3yWL4qfuEWjvAz1",
  • "status": "paused"
}

Response samples

Content type
application/json
{
  • "result": "success"
}

Get customers

Get customers list with their statuses and balances. Filter by status, customer_id and creation date.

Authorizations:
firebase_auth
query Parameters
customer_id
string <^[a-zA-Z0-9]+$> [ 1 .. 80 ] characters
Example: customer_id=xDWxt7dd6efro3yWL4qfuEWjvAz1

ID of customer. Must be unique.

status
Array of strings
Items Enum: "disabled" "active" "paused" "markedForDeletion"
Example: status=disabled&status=active

Array of customer statuses to filter. If empty, all customers will be returned.

created_from_timestamp
integer
Example: created_from_timestamp=1632400000

Unix timestamp in seconds. If provided, only customers created after this timestamp will be returned.

created_to_timestamp
integer
Example: created_to_timestamp=1632486400

Unix timestamp in seconds. If provided, only customers created before this timestamp will be returned.

page
integer >= 1
Default: 1
Example: page=3

Selected page number. Default is 1.

limit
integer [ 1 .. 1000 ]
Default: 100
Example: limit=10

Maximum number of customers to return. Default is 100. If not provided, 100 customers will be returned.

Responses

Response samples

Content type
application/json
{
  • "customers": [
    ],
  • "page": 1,
  • "limit": 10,
  • "pages": 5,
  • "total": 48
}

Get customers activation history

Get customers activation history. Filter by customer_id, activation_status, sms_status and creation date.

Authorizations:
firebase_auth
query Parameters
customer_id
string [ 1 .. 80 ] characters ^[a-zA-Z0-9]+$
Example: customer_id=xDWxt7dd6efro3yWL4qfuEWjvAz1

ID of customer to get single customer.

activation_status
Array of strings
Items Enum: "active" "expired" "canceled" "finalized"
Example: activation_status=canceled&activation_status=finalized

Array of activation statuses to filter. Empty array will return all activations.

sms_status
Array of strings
Items Enum: "smsRequested" "smsReceived" "retryRequested" "retryReceived"
Example: sms_status=smsReceived&sms_status=retryRequested

Array of SMS statuses to filter. Empty array will return all activations.

created_from_timestamp
integer
Example: created_from_timestamp=1632400000

Unix timestamp in seconds. If provided, only activations created after this timestamp will be returned.

created_to_timestamp
integer
Example: created_to_timestamp=1632486400

Unix timestamp in seconds. If provided, only activations created before this timestamp will be returned.

page
integer >= 1
Default: 1
Example: page=3

Selected page number. Default is 1.

limit
integer [ 1 .. 1000 ]
Default: 100
Example: limit=10

Maximum number of customers to return per page. Default is 100. If not provided, 100 customers will be returned.

Responses

Response samples

Content type
application/json
{
  • "activations": [
    ],
  • "page": 1,
  • "limit": 10,
  • "pages": 5,
  • "total": 48
}

Get customers transactions

Get customers transactions list. Filter by purchase_id, customer_id and creation date.

Authorizations:
firebase_auth
query Parameters
customer_id
string [ 1 .. 80 ] characters ^[a-zA-Z0-9]+$
Example: customer_id=xDWxt7dd6efro3yWL4qfuEWjvAz1

ID of customer to get single customer.

transaction_id
string [ 1 .. 80 ] characters ^[a-zA-Z0-9_]+$
Example: transaction_id=63f4d0dab040a865d80da08a

ID of transaction to get single transaction.

created_from_timestamp
integer
Example: created_from_timestamp=1632400000

Unix timestamp in seconds. If provided, only transactions created after this timestamp will be returned.

created_to_timestamp
integer
Example: created_to_timestamp=1632486400

Unix timestamp in seconds. If provided, only transactions created before this timestamp will be returned.

page
integer >= 1
Default: 1
Example: page=3

Selected page number. Default is 1.

limit
integer [ 1 .. 1000 ]
Default: 100
Example: limit=10

Maximum number of transactions to return. Default is 100. If not provided, 100 customers will be returned.

Responses

Response samples

Content type
application/json
{
  • "transactions": [
    ],
  • "page": 1,
  • "limit": 10,
  • "pages": 5,
  • "total": 48
}

Create customer transaction

Create new financial transaction for customer.

Authorizations:
firebase_auth
Request Body schema: application/json
customer_id
required
string <^[a-zA-Z0-9]+$> [ 1 .. 80 ] characters

ID of customer. Must be unique.

transaction_id
required
string <^[a-zA-Z0-9]+$> [ 1 .. 80 ] characters

ID of financial transaction. Must be unique. If it is not unique, the transaction will be rejected.

amount
required
integer [ -100000 .. 100000 ]

Amount in USD cents to add or deduct to/from customer balance. If amount is positive, it will be added to customer balance. If amount is negative, it will be deducted from customer balance. Note: Customer balance may be negative.

gateway
string [ 1 .. 50 ] characters

Payment gateway used for transaction.

Responses

Request samples

Content type
application/json
{
  • "customer_id": "xDWxt7dd6efro3yWL4qfuEWjvAz1",
  • "transaction_id": "xDWxt7dd6efro3yWL4qfuEWjvAz1",
  • "amount": -350,
  • "gateway": "stripe"
}

Response samples

Content type
application/json
{
  • "result": "success"
}

Telegram

Create Telegram auth token

Create Firebase custom token for Telegram authentification.

Request Body schema: application/json
id
required
string

Telegram user ID

first_name
required
string

Telegram user first name

last_name
required
string

Telegram user last name

username
required
string

Telegram user username

photo_url
required
string

Telegram user photo URL

auth_date
required
string

Telegram user auth date

hash
required
string

Telegram user hash

Responses

Request samples

Content type
application/json
{
  • "id": "3506436567",
  • "first_name": "Test",
  • "last_name": "Test",
  • "username": "test",
  • "auth_date": "1612345678",
  • "hash": "test_hash"
}

Response samples

Content type
application/json
{
  • "token": "eyJhbGciOiJS...L2xoMy"
}