Service for managing Checkouts within the SDK Provides functionality for creating and configuring checkouts

Hierarchy (View Summary)

Constructors

Methods

  • Creates a new checkout in the Coinbase Commerce platform

    Parameters

    Returns Promise<APIResponse<CheckoutResponse>>

    A promise that resolves to the created checkout

    const { data: checkout } = await commerce.checkouts.createCheckout({
    name: 'Test Checkout',
    description: 'Test checkout description',
    pricing_type: 'fixed_price',
    local_price: {
    amount: '100.00',
    currency: 'USD'
    },
    requested_info: ['email']
    });

    When the API request fails or validation fails

  • Retrieves a specific checkout by ID from the Coinbase Commerce platform

    Parameters

    • checkout_id: string

      The unique identifier of the checkout to retrieve

    Returns Promise<APIResponse<CheckoutResponse>>

    A promise that resolves to the checkout details

    const { data: checkout } = await commerce.checkouts.getCheckout('a3f457b7-2a06-4268-a97c-989c58d908fd');
    console.log(checkout.data.name); // "Test Checkout"

    When the API request fails or the checkout is not found

  • Retrieves a list of checkouts from the Coinbase Commerce platform

    Parameters

    • Optionalparams: GetCheckoutsParams

      Optional parameters for the list request

      • Optionalending_before?: string
      • Optionallimit?: number
      • Optionalorder?: "asc" | "desc"
      • Optionalstarting_after?: string

    Returns Promise<APIResponse<CheckoutsResponse>>

    A promise that resolves to a paginated list of checkouts

    // Get first page of checkouts
    const { data: checkoutsList } = await commerce.checkouts.getCheckouts({
    limit: 10,
    order: 'desc'
    });

    // Get next page using cursor
    const nextPage = await commerce.checkouts.getCheckouts({
    starting_after: checkoutsList.pagination.cursor_range[1]
    });

    When the API request fails or invalid parameters are provided