Coronium Technical Team ยท
Buying a mobile proxy with Stripe MPP
An agent can find a plan and prepare a cart before anyone signs in. To pay for one line using the Machine Payments Protocol (MPP), it needs the buyerโs Coronium API key and a Stripe payment grant for the quoted amount. Hereโs how to keep the two steps separate and find out when the line is ready.
Start with the plan
Read the public catalog. Each carrierโs plans include a tariff ID, rental period, USD price and stock indicator. Check the observation time. An in-stock plan may have inventory across several providers. The payment endpoint checks that an eligible device is still available for this particular order.
For a shopping assistant that needs to save an estimate, register an anonymous cart identity. Its token can create, update and cancel its own carts. A cart holds neither funds nor inventory. Claiming it gives the owner control of the cart. A rental is a separate order in a Coronium buyer account.
Request a price for one rental
Use the API key from the buyerโs dashboard under Account โ API Access. The production MPP endpoint accepts one eligible dedicated daily, weekly or monthly line in USD. If your integration can handle separate HTTP and SOCKS5 credentials, include the preference shown below. Keep that setting for the entire order.
The example uses Node.js and stops at the quote. Set the maximum in dollars. Generate one order key for this purchase, such as a UUID, and save it before submitting. A first request without a Stripe credential can return a five-minute 402 challenge. It does not charge the buyer.
const { CORONIUM_API_KEY, TARIFF_ID, MAX_TOTAL_USD, ORDER_KEY } = process.env;
const amount = Number(MAX_TOTAL_USD);
if (!CORONIUM_API_KEY || !/^[0-9a-f]{24}$/i.test(TARIFF_ID ?? '') ||
!Number.isFinite(amount) || amount <= 0 || !ORDER_KEY) {
throw new Error('Set the buyer key, tariff ID, USD limit and a stable order key.');
}
const body = JSON.stringify({ tariff_id: TARIFF_ID, currency: 'usd', max_total_usd: amount });
const headers = {
'Authorization': 'Bearer ' + CORONIUM_API_KEY,
'Content-Type': 'application/json',
'Idempotency-Key': ORDER_KEY,
'X-Coronium-Proxy-Credentials': 'separate-protocol-v1'
};
const quote = await fetch('https://api.coronium.io/api/v3/payment/mpp', {
method: 'POST', headers, body, redirect: 'error'
});
const challenge = quote.headers.get('www-authenticate');
if (quote.status !== 402 || !challenge?.startsWith('Payment ')) {
throw new Error('Quote unavailable (HTTP ' + quote.status + '). Check stock and account access.');
}
// Parse the challenge with your MPP client and show the priced offer to the buyer.
// Stop here until the buyer approves that exact amount and merchant.Decode the challengeโs request with your MPP client. Its amount is in cents. Show the tariff, term, USD total and Coroniumโs Stripe merchant profile to the buyer. If the quote has expired or the offer has changed, show the fresh terms before seeking payment.
Keep the account key and the payment grant separate
Once the buyer approves, their Stripe-compatible wallet or integration can issue a short-lived Shared Payment Token for the quoted merchant and amount. Use an MPP client that honors the challengeโs header field. It returns the echoed challenge and the Stripe token in Payment-Authorization: Payment โฆ. The ordinary Authorization: Bearer โฆ header continues to identify the buyerโs Coronium account.
Send the same URL, exact JSON bytes, buyer, credential preference and Idempotency-Key. On a timeout, retain the original order key and grant. Never send keys, payment grants or proxy passwords in URLs, chat or debug logs.
Know when to hand over the line
- 200 with Payment-Receipt. Stripe captured the quoted amount. A response can still say
awaiting_fulfillment. Follow the returnedstatus_urlon the Coronium API origin with the same buyer credential until delivery is confirmed. Then retrieve the rental from the buyerโs account. - 202 or an uncertain outcome. Respect
Retry-Afterwhen present and check the existing order. Keep its payment ID. Starting a second order can create an unintended second purchase. - 402 after a payment attempt. Read the response state. The bank may require buyer authentication or may have declined the grant. If there is a status URL, check the original order before requesting another authorization.
- 401 or 409. For 401, verify the account key. For 409, read the reported stock, terms or order conflict before deciding whether a different plan is suitable.
Release verification on November 23 covered the deployed endpoint, its rejection of anonymous purchases, and Stripe capture and callback in test mode. A buyer-funded production delivery had yet to be independently verified at publication.