Orders
Create and manage orders on behalf of a registrar's end customer.
POST /v1/orders
Authenticated with X-API-Key. Requires an Idempotency-Key header — replaying the same key returns the original order body.
curl -X POST https://api.jsys.com/v1/orders \
-H 'X-API-Key: res_live_…' \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: $(uuidgen)' \
-d '{
"customer": { "email": "user@example.com", "externalRef": "your-cust-id" },
"lineItems": [
{ "productSku": "website-starter", "quantity": 1,
"metadata": { "businessName": "Portland Cupcakes", "domain": "portlandcupcakes.com", "niche": "bakery" } }
],
"currency": "USD"
}'Response
201 Created. status starts at PENDING. The worker processes the order asynchronously and the status transitions to FULFILLED (or FAILED with auto-refund) within seconds. You can poll GET /v1/orders/<id> or — preferred — register a webhook for order.fulfilled.
Status transitions
PENDING→PROCESSING→FULFILLED(happy path)PENDING→PROCESSING→FAILED(worker retried up to N times)PENDING→CANCELLED(only allowed in PENDING; refunds the wallet)FULFILLED→REFUNDED(manual via support)
POST /v1/orders/{orderId}/assign-owner
Hand the website fulfilled by an order to an end-user, creating their login on demand. Use this when your portal runs editor access OFF: in that mode a fulfilled order publishes the site with no owner login (no account, no credentials email) — you assign the real end-user later with this call. It find-or-creates the (reseller, email) account (pre-verified), makes them the site owner, and emails them a set-password link.
curl -X POST https://api.jsys.com/v1/orders/<orderId>/assign-owner \
-H 'X-API-Key: res_live_…' \
-H 'Content-Type: application/json' \
-d '{ "email": "enduser@example.com", "name": "Jane Buyer" }'200 OK. Idempotent — re-calling with the same email re-sends the access link. The order/site must belong to your API key's reseller, else 404. If the site already has a different owner the call returns 409; pass "transfer": true to reassign (the prior owner is demoted to an editor). Works regardless of your editor-access setting — it is your explicit grant for one site.
Errors
The API returns a stable envelope:
{ "error": { "code": "insufficient_funds", "message": "Wallet balance below order total", "details": {}, "requestId": "abc-123" } }Common code values: idempotency_key_missing, idempotency_key_conflict, insufficient_funds, credit_limit_exceeded, product_not_available, metadata_schema_mismatch, rate_limit_exceeded, ip_not_allowed, reseller_suspended.