Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

With the Nexus card ordering API, you can build in card ordering functions into your own application. This article provides an example instruction for a typical card ordering workflow. 

For more information and real-time testing of the API, see Card ordering API details


Example: Place card order via the card ordering API

Expandtitle

Log in to ordering portal

To send an order, or get information from the ordering portal, you first need to log in. If the login is successful, the result includes a bearer token to be used in other commands.

  1. Log in with your supplied credentials to get a bearer token, using the method POST /login

    Expand
    titleExample: Log in to ordering portal


    Code Block
    languagetext
    titleExample: Log in
    POST /login
    {
    	"username": "string"
    	"password": "string"
    }
expand
title


Get layout options

If you want to see the options for layouts and accessories, follow these steps:

  1. To view a list of available layouts for your company

  1. , use the method GET /layout.  

    Expand
    titleExample: View available layouts



    Code Block
    languagetext
    titleExample: View layout options
    GET /layout
    {
      "foundCount": 0,
      "layouts": [
        {
          "layoutId": 0,
          "layoutName": "string",
          "description": "string"
        }
      ]
    }



  2. To view layout fields for a specific layout, use the method GET /layout

  1. {id}

    Expand
    titleExample: View layout fields



    Code Block
    languagetext
    titleExample: Layout fields
    GET /layout{id}
    {
      "layoutId": 0,
      "layoutName": "string",
      "articlesIncluded": [
        {
          "artId": "CH3301-S",
          "name": "Card Holder EC Standard - Black",
          "description": "Card holder for one card with clip on back. The clip is easily removed and then holds two cards. One side is open for convenient card access",
          "imageUrl": "https://web.nexusonlineservices.com/Bilder/Artikel/1300.jpg"
        }
      ],
      "inputFields": [
        {
          "name": "string",
          "label": "string",
          "type": "string",
          "required": true,
          "maxLength": 0,
          "valueList": [
            {
              "index": "Accepted value for \"name\"",
              "label": "Explanation of index"
            }
          ]
        }
      ]
    }



  2. To view a list of available accessories, use the method GET /accessories

    Expand
    titleExample: View available accessories


    Code Block
    languagetext
    titleExample: View accessories options
    GET /accessories
    {
      "artId": "CH3301-S",
      "name": "Card Holder EC Standard - Black",
      "description": "Card holder for one card with clip on back. The clip is easily removed and then holds two cards. One side is open for convenient card access",
      "imageUrl": "https://web.nexusonlineservices.com/Bilder/Artikel/1300.jpg"
    }
expand
title


Send order

Post
  1. To post the order

. Include
  1. , including specification of layout fields and accessories, use the method POST /order.

    Expand
    titleExample: Send order



    Code Block
    languagetext
    titleExample: Send order
    POST /order
    {
      "layoutId": 0,
      "inputField": "input value",
      "accessories": [
        {
          "artId": "CH3301-S",
          "amount": 0
        }
      ]
    }