Skip to content

Latest commit

 

History

History
152 lines (104 loc) · 10.3 KB

File metadata and controls

152 lines (104 loc) · 10.3 KB

Configuration

(configuration)

Overview

Use this resource to retrieve and set Merchant Callback URLs. Bolt uses these URLs to exchange information with your commerce server. See our related guide About the Merchant Callback API.

Available Operations

get_merchant_callbacks

Retrieves callbacks URLs for a Bolt merchant division.

Example Usage

from bolt_api_sdk import Bolt, models
import os


with Bolt(
    security=models.Security(
        x_api_key=os.getenv("BOLT_X_API_KEY", ""),
    ),
) as bolt:

    res = bolt.configuration.get_merchant_callbacks(division_id="<id>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
division_id str ✔️ The unique ID associated to the merchant's Bolt Account division; Merchants can have different divisions to suit multiple use cases (storefronts, pay-by-link, phone order processing). You can view and switch between these divisions from the Bolt Merchant Dashboard.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.MerchantCallbacksView

Errors

Error Type Status Code Content Type
errors.ErrorsBoltAPIResponse 400, 403 application/json
errors.APIError 4XX, 5XX */*

set_merchant_callbacks

Configure callbacks URLs for a Bolt merchant division. This will store or override only the callback URLs that are specified in the request. Operations are fully transactional.

Example Usage

from bolt_api_sdk import Bolt, models
import os


with Bolt(
    security=models.Security(
        x_api_key=os.getenv("BOLT_X_API_KEY", ""),
    ),
) as bolt:

    bolt.configuration.set_merchant_callbacks(request={
        "callback_urls": [
            {
                "type": models.MerchantCallbackURLType.OAUTH_REDIRECT,
                "url": "https://example.com/1",
            },
            {
                "type": models.MerchantCallbackURLType.OAUTH_LOGOUT,
                "url": "https://example.com/2",
            },
            {
                "type": models.MerchantCallbackURLType.GET_ACCOUNT,
                "url": "https://example.com/3",
            },
        ],
        "division_id": "3X9aPQ67-YrB",
    })

    # Use the SDK ...

Parameters

Parameter Type Required Description
request models.MerchantCallbacksInput ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Errors

Error Type Status Code Content Type
errors.ErrorsBoltAPIResponse 400, 403, 422 application/json
errors.APIError 4XX, 5XX */*

get_merchant_identifiers

This endpoint returns the merchant's public ID and the publishable key related to the merchant division.

Example Usage

from bolt_api_sdk import Bolt, models
import os


with Bolt(
    security=models.Security(
        x_api_key=os.getenv("BOLT_X_API_KEY", ""),
    ),
) as bolt:

    res = bolt.configuration.get_merchant_identifiers()

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.MerchantIdentifiersView

Errors

Error Type Status Code Content Type
errors.ErrorsBoltAPIResponse 403 application/json
errors.APIError 4XX, 5XX */*