v1

latestOpenAPI 3.0.12026-07-265331168.0 KB
Checkout

Create Checkout

This endpoint creates a checkout for the authenticated user based on the provided data. It supports different payment platforms, promotional codes, and can handle both one-time and recurring payments. You can either specify a product_code directly or supply the traditional combination of product_type, country_id, and product_protocol.

Important considerations

  • If product_code is provided alongside product_type/country_id/product_protocol, their values must match the actual product attributes.
  • If the invoice amount remaining is 0, it means your available credit fully covered the cost and the service is considered immediately paid.
  • If the invoice needs payment, you will be returned an invoice_url to complete checkout.
post/public/user/checkout/create

Headers

Content-Typestring required

Content type for the request body as application/json.

Request body

country_idstring

An ISO country code used for region-specific datacenter or ISP products.

cycle_interval'year' | 'month' | 'week' | 'day'

The billing interval for recurring purchases.

cycle_interval_countinteger

The number of intervals for a recurring cycle (e.g. 1 month, 2 months, etc.).

product_codestring

A direct product code (e.g. "datacenter_us"). If this is provided, you do not need product_type, country_id, or product_protocol.

product_protocol'ipv4' | 'ipv6' | 'dual'

The protocol of the product.

product_type'datacenter' | 'isp' | 'residential' | 'mobile'

The type of product to purchase (if product_code is not used).

promotional_codestring

A promotional code to apply a discount to the checkout.

quantityinteger required

The quantity of the product to purchase.

service_fulfillment_filterobject

An optional filter object for advanced product/service configurations.

Example request

{
  "cycle_interval": "month",
  "cycle_interval_count": 1,
  "product_code": "isp_us",
  "promotional_code": "HALFOFF",
  "quantity": 5
}

Response

Successfully created a checkout. Depending on the remaining invoice amount, it may already be paid by credit, or you may need to complete payment at the returned invoice URL.

messagestring

Success message.

Example response

{
  "data": {
    "created": [
      "API-1234-5678"
    ],
    "invoice_is_paid": true,
    "invoice_url": "https://invoice.stripe.com/i/acct_1H7dAB2BUlqim5l/test_123",
    "mobile_ledger_created": [],
    "proxies": [
      {
        "asn_id": 7018,
        "asn_name": "AT&T Enterprises, LLC",
        "city_example_postcode": "75202",
        "city_id": 75202,
        "city_latitude": 32.7767,
        "city_longitude": -96.797,
        "city_name": "Dallas",
        "city_timezone": "America/Chicago",
        "country_id": "us",
        "country_name": "United States",
        "customer_id": 1976,
        "default_proxy_user_password": "apple1984",
        "default_proxy_user_username": "stevejobs",
        "ip_address_id_v4": "107.225.73.142",
        "ip_address_id_v6": "2600:1000:b12a:6351:8523:997e:93c4:f124",
        "proxy_http_port": 8080,
        "proxy_id": "7a018d34-76c2-4c23-b14d-f7b9a7054e25",
        "proxy_ip_address": "107.225.73.142",
        "proxy_ip_address_v6": "2600:1000:b12a:6351:8523:997e:93c4:f124",
        "proxy_protocol": "ipv4",
        "proxy_socks5_port": 1080,
        "proxy_status": "in_use",
        "proxy_type": "isp",
        "service_id": "API-1234-5678",
        "subdivision_id": "us-tx",
        "subdivision_name": "Texas",
        "subnet_id": "107.225.72.0/22",
        "subnet_id_v6": "2600:1000::/28"
      }
    ],
    "proxy_edited": [
      "7a018d34-76c2-4c23-b14d-f7b9a7054e25"
    ],
    "residential_ledger_created": [],
    "service": {
      "country_id": "us",
      "customer_id": 1976,
      "open_invoice_id": "null",
      "payment_method_id": "null",
      "product_id": "prod_ATT7018",
      "service_cycle": "1:month",
      "service_fulfillment_filter": {
        "asn_id": 7018
      },
      "service_id": "API-1234-5678",
      "service_image": "https://files.stripe.com/links/MDB8YWNjdF8xSDdkOEFCMkJVbHFpbTVsfGZsX2xpdmVfZFZ6TTZjUG01Q0NuR1IzSTZsVzNjVVFX00kUPPfQE9",
      "service_is_automatic_collection": true,
      "service_is_cancellable": true,
      "service_is_reconfigurable": true,
      "service_metadata": {},
      "service_name": "AT&T ISP Proxies [US]",
      "service_price_id": "price_1QJx2DB2BUlqim5lxmO3aT2v",
      "service_promotional_code": "HALFOFF",
      "service_protocol": "ipv4",
      "service_quantity": 5,
      "service_status": "active",
      "service_subscription_id": "sub_1QxSHmB2BUlqim5lTUH8HvKa",
      "service_total": 450,
      "service_type": "isp",
      "subscription_schedule_id": "null"
    },
    "service_id": "API-1234-5678"
  },
  "message": "Successfully created checkout and paid with credit. Your service will be provisioned shortly."
}