Skip to content

Latest commit

 

History

History
91 lines (62 loc) · 3.89 KB

PurchaseRegisterApi.md

File metadata and controls

91 lines (62 loc) · 3.89 KB

hlconnect_client.PurchaseRegisterApi

All URIs are relative to https://hlconnect-api.mu.se

Method HTTP request Description
connector_purchase_register POST /purchase/register Register a new purchase transaction

connector_purchase_register

connector_purchase_register(purchase_register_request)

Register a new purchase transaction

Initiates the purchase process for a digital asset. Validates request parameters, creates a new order, and begins fulfillment. This is an asynchronous operation - use /purchase/info to check order status. An order of several assets is registered with one call per asset: same order_number, a different order_line_id.

Example

  • Bearer Authentication (access_token):
import hlconnect_client
from hlconnect_client.models.purchase_register_request import PurchaseRegisterRequest
from hlconnect_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://hlconnect-api.mu.se
# See configuration.py for a list of all supported configuration parameters.
configuration = hlconnect_client.Configuration(
    host = "https://hlconnect-api.mu.se"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: access_token
configuration = hlconnect_client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with hlconnect_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = hlconnect_client.PurchaseRegisterApi(api_client)
    purchase_register_request = hlconnect_client.PurchaseRegisterRequest() # PurchaseRegisterRequest | Purchase registration request with asset and order details

    try:
        # Register a new purchase transaction
        api_instance.connector_purchase_register(purchase_register_request)
    except Exception as e:
        print("Exception when calling PurchaseRegisterApi->connector_purchase_register: %s\n" % e)

Parameters

Name Type Description Notes
purchase_register_request PurchaseRegisterRequest Purchase registration request with asset and order details

Return type

void (empty response body)

Authorization

access_token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 Purchase registration process successfully initiated * X-Environment -
* X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
429 Too many requests: the client exceeded its rate limit * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
401 Unauthorized - Missing or invalid access token -
404 Not Found - Specified asset ID does not exist -
409 Conflict - the order already holds this order_line_id. A new order_line_id under the same order_number is allowed; a previously failed line is replaced and answers 201. A cancelled line stays a conflict: repurchase it under a new order_line_id. -
422 Unprocessable Entity - Request validation failed -
500 Internal Server Error - Something went wrong processing the request -

[Back to top] [Back to API list] [Back to Model list] [Back to README]