ARNPROXY

Balance purchase; real debit

POST/account/api/v1/orders/create
Confirm the operation deliberately

This operation may change a record, balance or service configuration. Read its scope and notes first. After an uncertain result, query the same operation rather than starting another.

Authorization

AuthorizationBearer YOUR_ARNPROXY_API_KEY
Required permissionpurchases
Acceptapplication/json
Content-Typeapplication/json
Idempotency-Key16–100 letters, digits, _ or -. Persist and reuse the same value for the same operation.

Parameters

NameTypeDescription
Idempotency-Key
headerRequired
string16–100 letters/digits/_/-. Keep the same value for the operation/status; do not reuse with a different body.
product_id
bodyRequired
integerProduct ID from products; 1–2147483647.
lines
bodyRequired
object[]1–20 distinct location lines for one product. No duplicate location_id; at most 100000 proxies in total.
lines[].location_id
bodyRequired
integerLocation ID from the selected product catalog.
lines[].time_id
bodyRequired
integerPeriod ID offered for that location.
lines[].quantity
bodyRequired
integer1–100000, also subject to product.minimum_quantity.
lines[].purpose_id
bodyRequired
integerSend 201 for the current customer purpose workflow.
lines[].subpurpose_id
bodyRequired
integerActive child purpose under 201; use -1 for Other.
lines[].other_purpose
bodyConditional
stringRequired with subpurpose_id=-1: 1–30 UTF-8 characters; otherwise ignored.
currency
bodyRequired
stringTRY or USD from the same quote; must match the account currency.
expected_total_minor
bodyRequired
integertotal_minor from the same quote, as an integer; never decimal money or a string. 1–999999999999.
terms
bodyRequired
booleanMust be the JSON boolean true for explicit approval, not the string "true".
promo_code
bodyOptional
stringOptional promo, up to 100 bytes. Keep it identical between quote and purchase/renewal.
Default: ""
auth
bodyOptional
objectDelivery authentication; defaults to {"mode":"username_password"}. Does not grant primary-credential management.
auth.mode
bodyConditional
stringRequired when auth is supplied: username_password or ip. Do not specify a username/password here.
auth.ip
bodyConditional
stringIPv4 required only for auth.mode=ip; omit for username_password.

Request body

Replace YOUR_/FROM_ placeholders with values from the relevant catalog, quote or scope. Examples leave consent false; only approve a real operation intentionally.

request.json
{
    "product_id": "FROM_PRODUCTS",
    "lines": [
        {
            "location_id": "FROM_CATALOG",
            "time_id": "FROM_CATALOG",
            "quantity": 1,
            "purpose_id": 201,
            "subpurpose_id": "FROM_CATALOG_CHILDREN"
        }
    ],
    "currency": "FROM_QUOTE",
    "expected_total_minor": "FROM_QUOTE_TOTAL_MINOR",
    "promo_code": "",
    "terms": false
}

Additional usage examples

IDs and prices are illustrative; use real values from the catalog and the same quote. JSON IDs and expected_total_minor must be numbers. Examples deliberately keep terms=false; submit terms=true only after explicit customer approval for the real paid operation.

One product type, two countries

Use up to 20 distinct location_id values under one product_id. Each country creates a separate order record; the linked checkout is handled as one invoice. Quantity discounts are calculated independently per country.

application/json
{
    "product_id": 5,
    "lines": [
        {
            "location_id": 10,
            "time_id": 101,
            "quantity": 1,
            "purpose_id": 201,
            "subpurpose_id": 202
        },
        {
            "location_id": 11,
            "time_id": 102,
            "quantity": 1,
            "purpose_id": 201,
            "subpurpose_id": 202
        }
    ],
    "currency": "TRY",
    "expected_total_minor": 2000,
    "promo_code": "",
    "terms": false
}

The “Other” purpose

For Other, send subpurpose_id=-1 and other_purpose containing 1–30 characters. Other selections do not require other_purpose. purpose_id remains 201.

application/json
{
    "product_id": 5,
    "lines": [
        {
            "location_id": 10,
            "time_id": 101,
            "quantity": 1,
            "purpose_id": 201,
            "subpurpose_id": -1,
            "other_purpose": "Custom purpose"
        }
    ],
    "currency": "TRY",
    "expected_total_minor": 1000,
    "promo_code": "",
    "terms": false
}

Request example

cURL
printf 'Authorization: Bearer %s\n' "$ARNPROXY_API_KEY" |
  curl --silent --show-error --header @- \
    --header 'Accept: application/json' \
    --connect-timeout 10 --max-time 30 \
    --header 'Idempotency-Key: YOUR_SAVED_OPERATION_KEY' \
    --request POST --header 'Content-Type: application/json' \
    --data-binary @request.json \
    'https://www.arnproxy.com/account/api/v1/orders/create'

Examples are not executed on this page. Keep the API key in a server-side environment variable; do not put real keys in URLs or browser code. Prepare request.json for POST examples.

Responses

201Success response
application/json
{
    "ok": true,
    "data": {
        "state": "accepted",
        "delivery_state_at_acceptance": "queued",
        "currency": "TRY",
        "total": "10.00",
        "total_minor": 1000,
        "checkout_group_id": null,
        "orders": [
            {
                "id": 10001,
                "number": "1000010001",
                "location_id": 10,
                "time_id": 101,
                "quantity": 1,
                "total": "10.00"
            }
        ],
        "accepted_at": "2030-01-01T12:00:00+00:00",
        "automatic_renewal": false,
        "replayed": false
    },
    "meta": {
        "request_id": "000000000000000000000001",
        "phase": "public_v1",
        "source": "arnproxy_records"
    }
}
Response fields and types
NameTypeDescription
okbooleanSuccess envelope flag; on false inspect error.code.
dataobjectOperation-specific result; examples are illustrative and synthetic.
data.statestringRecord/operation state. accepted is not delivery; completed is not a connection test.
data.delivery_state_at_acceptancestringOperation-specific delivery state at acceptance value; preserve its demonstrated type and consult the behavior notes.
data.currencystringAccount transaction currency: TRY or USD.
data.totalstringMoney amount; preserve the returned string/integer representation for precision.
data.total_minorintegerInteger minor units: 1000 means 10.00 TRY/USD.
data.checkout_group_idinteger|nullOperation-specific checkout group id value; preserve its demonstrated type and consult the behavior notes.
data.ordersarrayOperation-specific orders value; preserve its demonstrated type and consult the behavior notes.
data.orders[]objectOperation-specific orders value; preserve its demonstrated type and consult the behavior notes.
data.orders[].idintegerRelevant ARNPROXY record ID; use it instead of the upstream internal ID.
data.orders[].numberstringDisplay order number; not interchangeable with fields requesting an id.
data.orders[].location_idintegerLocal catalog location or product-type ID.
data.orders[].time_idintegerLocal period/GB-plan record ID, not a day or GB count.
data.orders[].quantityintegerSelected or ordered proxy quantity.
data.orders[].totalstringMoney amount; preserve the returned string/integer representation for precision.
data.accepted_atstringTimestamp in the API’s returned representation; example dates are synthetic.
data.automatic_renewalbooleanOperation-specific automatic renewal value; preserve its demonstrated type and consult the behavior notes.
data.replayedbooleanSaved result for the same operation was returned, not proof of a new debit/action.
metaobjectRequest correlation and data-source metadata.
meta.request_idstringThis HTTP request’s correlation ID, not an operation key or order ID.
meta.phasestringOperation-specific phase value; preserve its demonstrated type and consult the behavior notes.
meta.sourcestringData source; local records and a live provider lookup are different evidence.

Error response

HTTP 401 · INVALID_API_KEY
{
  "ok": false,
  "error": { "code": "INVALID_API_KEY" },
  "meta": { "request_id": "000000000000000000000001" }
}

Authentication and validation may reject a request before execution. Consult the error reference and retain request_id when contacting support. Never send keys or passwords. Errors & limits →

Behavior & important notes

  • Take identifiers from products/catalog. Quote lines contain only location_id, time_id and quantity. Purchase lines additionally require purpose_id=201 and the selected subpurpose_id.
  • Multiple countries create separate orders and one multi-line invoice. Discounts are country-specific. accepted is not delivered; follow order_delivery and order_proxies.
  • A timeout/5xx is not proof that a write failed. Use the original Idempotency-Key with its status resource. Do not retry under a new key; GET does not resend the change.
  • Do not ask customers to make two selections for a standard order. Find id=201 in catalog.purposes and display only its children. In purchase, purpose_id is the fixed integer 201 and subpurpose_id is the selected child ID. The hierarchical catalog shape remains for compatibility with existing integrations.
  • For Other, send subpurpose_id=-1 and other_purpose containing 1–30 characters. Other selections do not require other_purpose. purpose_id remains 201.
  • Use up to 20 distinct location_id values under one product_id. Each country creates a separate order record; the linked checkout is handled as one invoice. Quantity discounts are calculated independently per country.
Follow the same operationSaved purchase result →

Search the current language. Close with Esc