/
Card ordering API - examples

Card ordering API - examples

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 1.0

Example: Place card order via the card ordering API

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

     Example: Log in to ordering portal
    Example: Log in
    POST /login
    {
    	"username": "string"
    	"password": "string"
    }
    Example: Response
    {
      "result": "ok",
      "token": "string",
      "validUntil": "2020-02-11T12:57:35.301Z"
    }

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, use the method GET /layout.  

     Example: View available layouts
    Example: View available layouts
    Authorization: Bearer <access token>
    GET /layout
    
    Example: Response
    {
      "foundCount": 0,
      "layouts": [
        {
          "layoutId": 0,
          "layoutName": "string",
          "description": "string"
        }
      ]
    }
  2. To view layout fields for a specific layout, use the method GET /layout{id}

     Example: View layout fields


    Example: View layout fields
    Authorization: Bearer <access token>
    GET /layout{id}
    
    Example: Response
    {
      "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"
            }
          ]
        }
      ]
    }
  3. To view a list of available accessories, use the method GET /accessories

     Example: Get list of accessories
    Example: Get list of accessories
    Authorization: Bearer <access token>
    GET /accessories
    
    Example: Response
    {
      "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"
    }

Send order

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

     Example: Send order
    Example: Send order
    Authorization: Bearer <access token>
    POST /order
    
    Example: Response
    {
      "layoutId": 0,
      "inputField": "input value",
      "accessories": [
        {
          "artId": "CH3301-S",
          "amount": 0
        }
      ]
    }


Related content

Card ordering API
Card ordering API
More like this
Design cards
More like this
Card SDK overview
Card SDK overview
More like this
Nexus GO Cards ordering
Nexus GO Cards ordering
More like this
About the Nexus ID06 order portal
About the Nexus ID06 order portal
More like this
Nexus GO Cards management portal
Nexus GO Cards management portal
More like this

Copyright 2024 Technology Nexus Secured Business Solutions AB. All rights reserved.
Contact Nexus | https://www.nexusgroup.com | Disclaimer | Terms & Conditions