Placing an order
The Kigo API allows partners to place orders for products that are tokenized and claimed inside a user's Kigo-powered wallet. This guide walks a developer through integrating with the place order API.
Prerequisites
Before making an API call to create a user-level session token, obtain a partner-level session token following the Authentication Guide.
Steps to Implement
-
Receive a Product ID
- A partner can obtain the
product_idspecific to their integration from their primary contact at Kigo. Note the id will be different in the UAT and production environments.
- A partner can obtain the
-
Place an Order
- Endpoint: Create a claim code for a product.
- Purpose: This endpoint places an order for the associated product. The endpoint returns a
claim_codeanddeeplink_urlwhich are used as the mechanism for fulfilling the order. - Usage: Use the
deeplink_urlto redirect the user to a Kigo-powered wallet. As an optional addition, display theclaim_codeto the user as a backup in case thedeeplink_urldoesn't work or for customized fulfillment flows.
-
Using the SSO Session ID
- URL Example:
https://partner-hub.kigo.io?claim-code=${claim_code}
- URL Example:
Key Considerations
- The Product ID is specific to a product within Kigo's systems. Products at Kigo can be thought of as "token templates". This means the type of token the user will receive in their Kigo-powered wallet is determined by the
product_idpassed to the endpoint for ordering a product. Since the product depends on a partner's specific use case, partners should coordinate with their contact at Kigo to create products and tokens to suite their use case. Several common use cases are "boosted" offer bundles, gift cards, and merchandise vouchers. - SSO Session Integrations with Kigo require that the deeplink also contain a
session_idin the url parameters. Obtain thesession_idby following the Creating an SSO Session Guide. Then append thesession_idto the end of thedeeplink_url:
https://partner-hub.kigo.io?claim-code=${claim_code}&session-id=${session_id}
Example Workflow
- End-user clicks a boost button inside a partner's web application.
- The application makes an API call to the partner's server.
- Obtain a partner-level session token using the provided endpoint in the server.
- Make an API call to make an order to receive a
deeplink_urlandclaim_codethat can to authenticate the user into a Kigo-powered experience.- (Optional) Create an SSO session by making an API call to receive a
session_id, which authenticates the user into a Kigo-powered experience. Append a url parameter for thesession_idto the end of thedeeplink_url.
- (Optional) Create an SSO session by making an API call to receive a
- Pass the
deeplink_urlto the web application. - Redirect the user to a Kigo-hosted wallet at the
deeplink_url
Best Practices
- Idempotency: The
external_order_idis idempotent in the place order endpoint. This means that subsequent API calls for a partner using the sameexternal_order_idwill return the previously created order, and retry logic can be safely implement with the place order endpoint. - Secure Handling: The
deeplink_urlgrants the holder the right to claim the token associated with theclaim_code. Therefore, it should only be accessible to the correct user.
Updated 3 months ago