Peplink Portal Docs

Create order via API with no coding

Place a test order through the Partner API from an HTTP client, without writing code, to learn the order integration flow end to end.

You will learn how to create order via API without writing code. This can help you to get familiar to develop order integration with our systems.

Prerequisite

It is assumed you are already familiar with the ordering processing at eStore.

Recipe

Setup in eStore: configure default billing address.

Obtain an API key in Peplink Portal by following this guide.
Open HTTPie to call API.

Enter core informations in HTTPie:

Create Order Via API page
  1. Method: Select POST
  2. Enter API path https://portal.peplink.com/api/e/v1/cp/orders
  3. Under Auth tab, enter API key (obtained in the above step). Make sure Bearer token is selected at the bottom dropdown.
  4. Enter order details under the tab Body: Create Order Via API page
  5. Make sure Text and JSON are selected at the bottom.
  6. Paste this json:

Please modify customerEmail to your email.

{
  "isDryRun": true,
  "customerEmail": "[email protected]",
  "isUseDefaultBillingAddress": true,
  "orderItems": [{
    "sku": "SFC-CN-A",
    "generateNewEsim": true,
    "quantity": 2
  }]
}

Click submit to create order.

Create Order Via API page

Receive success (green) response: the API is executed successfully.

Create Order Via API page

No order is created

As we have "isDryRun": true, in the above json, the API will just validate the inputs and do not create order.

If you remove "isDryRun": true, from the json and submit again, the API will create an order and new order number will appear in the response body.

Test follow-up actions with dry run

If you need to test follow-up actions after order is created, set dryRunReturnNewOrderNumber in addition of isDryRun=true:

  1. Create order with isDryRun=true and dryRunReturnNewOrderNumber, e.g.

    {
      "isDryRun": true,
      "dryRunReturnNewOrderNumber": "your_order_number",
      ... // other parameters for create order request
    }

    You will receive newOrderNumber in the response if the request is valid.

  2. Call GET /orders/{orderNumber} until the order is ready for follow-up

  3. Update PO informations for the new order via

    • POST: /orders/{orderNumber}/customer-po-number
    • POST /orders/{orderNumber}/customer-po-files

Then you will receive newOrderNumber in the response if the request is valid.

What value should I set for dryRunReturnNewOrderNumber?

Find an old and completed order from your orders and it should be good.

References

After going through the above recepie, you should have the sense on what is needed to order with API. Please check for more details from these references:

On this page