Skip to content

Orders

8 endpoints. Authentication, errors, paging and rate limits are described once, in the API overview.

Action Method Description
acceptorder POST Accept/approve a pending order
addorder POST Create a new order for a client
cancelorder POST Cancel an order
deleteorder POST Delete an order
fraudorder POST Mark an order as fraudulent
getorders GET List all orders with optional filtering
orderfraudcheck POST Score an order for fraud
pendingorder POST Set an order back to pending

acceptorder

Accept/approve a pending order.

POST /api/v1/acceptorder

Permission: manage_orders

Parameters

Name Type Required Description
orderid integer yes The order.

Response

Field Description
result success
orderid integer
status string

Errors

Status When
404 No such order.

Note

What the Accept button does: every service on the order is created on its server (products set to manual setup included), ordered domains are registered, and the order becomes Active. A service whose server refuses stays pending and is queued for retry.

Example

curl -X POST https://example.com/api/v1/acceptorder \
  -H "X-API-Key: $PNLCS_IDENTIFIER" \
  -H "X-API-Secret: $PNLCS_SECRET" \
  --data-urlencode "orderid=1"

addorder

Create a new order for a client.

POST /api/v1/addorder

Permission: manage_orders

Parameters

Name Type Required Description
clientid integer yes The client.
pid array yes Product ids: pid[0], pid[1], ... At least one.
billingcycle array no One per product: monthly (default), quarterly, semiannually, annually, biennially, triennially or onetime. A cycle the product is not sold on is skipped.
domain array no One per product: the domain the service is for.
priceoverride array no One per product: a price instead of the product price (0 or more).
paymentmethod string no A gateway installed here. Default banktransfer.
promocode string no A promotion code.

Response

Field Description
result success
orderid integer
ordernum string
invoiceid integer

Errors

Status When
422 No product could be ordered, or a field is not valid.

Note

Built the way the shop builds an order: the services, the invoice and the order confirmation.

Example

curl -X POST https://example.com/api/v1/addorder \
  -H "X-API-Key: $PNLCS_IDENTIFIER" \
  -H "X-API-Secret: $PNLCS_SECRET" \
  --data-urlencode "clientid=7" \
  --data-urlencode "pid[0]=3" \
  --data-urlencode "billingcycle[0]=annually" \
  --data-urlencode "domain[0]=example.com"

cancelorder

Cancel an order.

POST /api/v1/cancelorder

Permission: manage_orders

Parameters

Name Type Required Description
orderid integer yes The order.

Response

Field Description
result success
orderid integer
status string

Errors

Status When
404 No such order.

Note

What the Cancel button does: live accounts are terminated on their servers, the other services and the domains are cancelled, and the invoice is cancelled unless it was paid in full (what was paid becomes credit).

Example

curl -X POST https://example.com/api/v1/cancelorder \
  -H "X-API-Key: $PNLCS_IDENTIFIER" \
  -H "X-API-Secret: $PNLCS_SECRET" \
  --data-urlencode "orderid=1"

deleteorder

Delete an order.

POST /api/v1/deleteorder

Permission: manage_orders

Parameters

Name Type Required Description
orderid integer yes The order.

Response

Field Description
result success

Errors

Status When
404 No such order.

Example

curl -X POST https://example.com/api/v1/deleteorder \
  -H "X-API-Key: $PNLCS_IDENTIFIER" \
  -H "X-API-Secret: $PNLCS_SECRET" \
  --data-urlencode "orderid=1"

fraudorder

Mark an order as fraudulent.

POST /api/v1/fraudorder

Permission: manage_orders

Parameters

Name Type Required Description
orderid integer yes The order.

Response

Field Description
result success
orderid integer
status string

Errors

Status When
404 No such order.

Note

What the Fraud button does: active services are suspended (on their servers), and the invoice is cancelled unless it was paid in full.

Example

curl -X POST https://example.com/api/v1/fraudorder \
  -H "X-API-Key: $PNLCS_IDENTIFIER" \
  -H "X-API-Secret: $PNLCS_SECRET" \
  --data-urlencode "orderid=1"

getorders

List all orders with optional filtering.

GET /api/v1/getorders

Permission: list_orders

Parameters

Name Type Required Description
id integer no One order.
userid integer no Only this client's orders.
status string no An order status, such as Pending, Active, Cancelled or Fraud.
limitstart integer no Where the page starts. Default 0.
limitnum integer no Page size, 1 to 250. Default 25.

Response

Field Description
result success
totalresults integer: rows matching the filters
startnumber integer: where this page starts
numreturned integer: rows on this page
data array: the rows

Example

curl -G https://example.com/api/v1/getorders \
  -H "X-API-Key: $PNLCS_IDENTIFIER" \
  -H "X-API-Secret: $PNLCS_SECRET"

orderfraudcheck

Score an order for fraud.

POST /api/v1/orderfraudcheck

Permission: manage_orders

Parameters

Name Type Required Description
orderid integer yes The order.

Response

Field Description
result success
orderid integer
fraud boolean: score of 60 or more
fraud_score integer
risk_level string
reasons array of strings

Errors

Status When
404 No such order.

Example

curl -X POST https://example.com/api/v1/orderfraudcheck \
  -H "X-API-Key: $PNLCS_IDENTIFIER" \
  -H "X-API-Secret: $PNLCS_SECRET" \
  --data-urlencode "orderid=1"

pendingorder

Set an order back to pending.

POST /api/v1/pendingorder

Permission: manage_orders

Parameters

Name Type Required Description
orderid integer yes The order.

Response

Field Description
result success
orderid integer

Errors

Status When
404 No such order.

Note

Puts the order back to Pending.

Example

curl -X POST https://example.com/api/v1/pendingorder \
  -H "X-API-Key: $PNLCS_IDENTIFIER" \
  -H "X-API-Secret: $PNLCS_SECRET" \
  --data-urlencode "orderid=1"