Skip to content

Payment pages

AsyncPaymentPage

Bases: BaseAsyncAPI

Provides a wrapper for paystack Payment Pages API

The Payment Pages API provides a quick and secure way to collect payment for products. https://paystack.com/docs/api/page/

Source code in src/pypaystack2/api/payment_pages.py
class AsyncPaymentPage(BaseAsyncAPI):
    """Provides a wrapper for paystack Payment Pages API

    The Payment Pages API provides a quick and secure way to collect payment for products.
    https://paystack.com/docs/api/page/
    """

    async def create(
        self,
        name: str,
        description: Optional[str] = None,
        amount: Optional[int] = None,
        split_code: Optional[str] = None,
        slug: Optional[str] = None,
        metadata: Optional[str] = None,
        redirect_url: Optional[str] = None,
        custom_fields: Optional[list] = None,
    ) -> Response:
        """Create a payment page on your integration

        Args:
            name: Name of page
            description: A description for this page
            amount: Amount should be in kobo if currency is ``Currency.NGN``, pesewas, if
                currency is ``Currency.GHS``, and cents, if currency is ``Currency.ZAR``
            split_code: The split code of the transaction split. e.g. SPL_98WF13Eb3w
            slug: URL slug you would like to be associated with this page.
                Page will be accessible at ``https://paystack.com/pay/[slug]``
            metadata: Extra data to configure the payment page including subaccount,
                logo image, transaction charge
            redirect_url: If you would like Paystack to redirect someplace upon
                successful payment, specify the URL here.
            custom_fields: If you would like to accept custom fields,
                specify them here.

        Returns:
            A named tuple containing the response gotten from paystack's server.
        """

        url = self._parse_url("/page")

        payload = {"name": name}
        optional_params = [
            ("description", description),
            ("amount", amount),
            ("split_code", split_code),
            ("slug", slug),
            ("metadata", metadata),
            ("redirect_url", redirect_url),
            ("custom_fields", custom_fields),
        ]
        payload = add_to_payload(optional_params, payload)
        return await self._handle_request(HTTPMethod.POST, url, payload)

    async def get_pages(
        self,
        page: int = 1,
        pagination: int = 50,
        start_date: Optional[str] = None,
        end_date: Optional[str] = None,
    ) -> Response:
        """Fetch payment pages available on your integration.

        Args:
            page: Specifies exactly what page you want to retrieve.
                If not specified we use a default value of 1.
            pagination: Specifies how many records you want to retrieve per page.
                If not specified we use a default value of 50.
            start_date: A timestamp from which to start listing page e.g. 2016-09-24T00:00:05.000Z, 2016-09-21
            end_date: A timestamp at which to stop listing page e.g. 2016-09-24T00:00:05.000Z, 2016-09-21

        Returns:
            A named tuple containing the response gotten from paystack's server.
        """

        url = self._parse_url("/page?perPage=" + str(pagination))
        query_params = [
            ("page", page),
            ("start_date", start_date),
            ("end_date", end_date),
        ]
        url = append_query_params(query_params, url)
        return await self._handle_request(HTTPMethod.GET, url)

    async def get_page(self, id_or_slug: str) -> Response:
        """Get details of a payment page on your integration.

        Args:
            id_or_slug: The page ``ID`` or ``slug`` you want to fetch

        Returns:
            A named tuple containing the response gotten from paystack's server.
        """

        url = self._parse_url(f"/page/{id_or_slug}")
        return await self._handle_request(HTTPMethod.GET, url)

    async def update(
        self,
        id_or_slug: str,
        name: str,
        description: str,
        amount: Optional[int] = None,
        active: Optional[bool] = None,
    ) -> Response:
        """Get details of a payment page on your integration.

        Args:
            id_or_slug: The page ``ID`` or ``slug`` you want to fetch
            name: Name of page
            description: A description for the page
            amount: Default amount you want to accept using this page.
                If none is set, customer is free to provide any amount
                of their choice. The latter scenario is useful for
                accepting donations
            active: Set to ``False`` to deactivate page url

        Returns:
            A named tuple containing the response gotten from paystack's server.
        """

        url = self._parse_url(f"/page/{id_or_slug}")
        payload = {
            "name": name,
            "description": description,
        }
        optional_params = [
            ("amount", amount),
            ("active", active),
        ]
        payload = add_to_payload(optional_params, payload)
        return await self._handle_request(HTTPMethod.PUT, url, payload)

    async def check_slug_available(self, slug: str) -> Response:
        """Check the availability of a slug for a payment page.

        Args:
            slug: URL slug to be confirmed

        Returns:
            A named tuple containing the response gotten from paystack's server.
        """

        url = self._parse_url(f"/page/check_slug_availability/{slug}")
        return await self._handle_request(HTTPMethod.GET, url)

    async def add_products(self, id: str, products: list[int]) -> Response:
        """Add products to a payment page

        Args:
            id: ID of the payment page
            products: Ids of all the products

        Returns:
            A named tuple containing the response gotten from paystack's server.
        """

        url = self._parse_url(f"/page/{id}/product")
        payload = {"product": products}
        return await self._handle_request(HTTPMethod.POST, url, payload)

add_products(id, products) async

Add products to a payment page

Parameters:

Name Type Description Default
id str

ID of the payment page

required
products list[int]

Ids of all the products

required

Returns:

Type Description
Response

A named tuple containing the response gotten from paystack's server.

Source code in src/pypaystack2/api/payment_pages.py
async def add_products(self, id: str, products: list[int]) -> Response:
    """Add products to a payment page

    Args:
        id: ID of the payment page
        products: Ids of all the products

    Returns:
        A named tuple containing the response gotten from paystack's server.
    """

    url = self._parse_url(f"/page/{id}/product")
    payload = {"product": products}
    return await self._handle_request(HTTPMethod.POST, url, payload)

check_slug_available(slug) async

Check the availability of a slug for a payment page.

Parameters:

Name Type Description Default
slug str

URL slug to be confirmed

required

Returns:

Type Description
Response

A named tuple containing the response gotten from paystack's server.

Source code in src/pypaystack2/api/payment_pages.py
async def check_slug_available(self, slug: str) -> Response:
    """Check the availability of a slug for a payment page.

    Args:
        slug: URL slug to be confirmed

    Returns:
        A named tuple containing the response gotten from paystack's server.
    """

    url = self._parse_url(f"/page/check_slug_availability/{slug}")
    return await self._handle_request(HTTPMethod.GET, url)

create(name, description=None, amount=None, split_code=None, slug=None, metadata=None, redirect_url=None, custom_fields=None) async

Create a payment page on your integration

Parameters:

Name Type Description Default
name str

Name of page

required
description Optional[str]

A description for this page

None
amount Optional[int]

Amount should be in kobo if currency is Currency.NGN, pesewas, if currency is Currency.GHS, and cents, if currency is Currency.ZAR

None
split_code Optional[str]

The split code of the transaction split. e.g. SPL_98WF13Eb3w

None
slug Optional[str]

URL slug you would like to be associated with this page. Page will be accessible at https://paystack.com/pay/[slug]

None
metadata Optional[str]

Extra data to configure the payment page including subaccount, logo image, transaction charge

None
redirect_url Optional[str]

If you would like Paystack to redirect someplace upon successful payment, specify the URL here.

None
custom_fields Optional[list]

If you would like to accept custom fields, specify them here.

None

Returns:

Type Description
Response

A named tuple containing the response gotten from paystack's server.

Source code in src/pypaystack2/api/payment_pages.py
async def create(
    self,
    name: str,
    description: Optional[str] = None,
    amount: Optional[int] = None,
    split_code: Optional[str] = None,
    slug: Optional[str] = None,
    metadata: Optional[str] = None,
    redirect_url: Optional[str] = None,
    custom_fields: Optional[list] = None,
) -> Response:
    """Create a payment page on your integration

    Args:
        name: Name of page
        description: A description for this page
        amount: Amount should be in kobo if currency is ``Currency.NGN``, pesewas, if
            currency is ``Currency.GHS``, and cents, if currency is ``Currency.ZAR``
        split_code: The split code of the transaction split. e.g. SPL_98WF13Eb3w
        slug: URL slug you would like to be associated with this page.
            Page will be accessible at ``https://paystack.com/pay/[slug]``
        metadata: Extra data to configure the payment page including subaccount,
            logo image, transaction charge
        redirect_url: If you would like Paystack to redirect someplace upon
            successful payment, specify the URL here.
        custom_fields: If you would like to accept custom fields,
            specify them here.

    Returns:
        A named tuple containing the response gotten from paystack's server.
    """

    url = self._parse_url("/page")

    payload = {"name": name}
    optional_params = [
        ("description", description),
        ("amount", amount),
        ("split_code", split_code),
        ("slug", slug),
        ("metadata", metadata),
        ("redirect_url", redirect_url),
        ("custom_fields", custom_fields),
    ]
    payload = add_to_payload(optional_params, payload)
    return await self._handle_request(HTTPMethod.POST, url, payload)

get_page(id_or_slug) async

Get details of a payment page on your integration.

Parameters:

Name Type Description Default
id_or_slug str

The page ID or slug you want to fetch

required

Returns:

Type Description
Response

A named tuple containing the response gotten from paystack's server.

Source code in src/pypaystack2/api/payment_pages.py
async def get_page(self, id_or_slug: str) -> Response:
    """Get details of a payment page on your integration.

    Args:
        id_or_slug: The page ``ID`` or ``slug`` you want to fetch

    Returns:
        A named tuple containing the response gotten from paystack's server.
    """

    url = self._parse_url(f"/page/{id_or_slug}")
    return await self._handle_request(HTTPMethod.GET, url)

get_pages(page=1, pagination=50, start_date=None, end_date=None) async

Fetch payment pages available on your integration.

Parameters:

Name Type Description Default
page int

Specifies exactly what page you want to retrieve. If not specified we use a default value of 1.

1
pagination int

Specifies how many records you want to retrieve per page. If not specified we use a default value of 50.

50
start_date Optional[str]

A timestamp from which to start listing page e.g. 2016-09-24T00:00:05.000Z, 2016-09-21

None
end_date Optional[str]

A timestamp at which to stop listing page e.g. 2016-09-24T00:00:05.000Z, 2016-09-21

None

Returns:

Type Description
Response

A named tuple containing the response gotten from paystack's server.

Source code in src/pypaystack2/api/payment_pages.py
async def get_pages(
    self,
    page: int = 1,
    pagination: int = 50,
    start_date: Optional[str] = None,
    end_date: Optional[str] = None,
) -> Response:
    """Fetch payment pages available on your integration.

    Args:
        page: Specifies exactly what page you want to retrieve.
            If not specified we use a default value of 1.
        pagination: Specifies how many records you want to retrieve per page.
            If not specified we use a default value of 50.
        start_date: A timestamp from which to start listing page e.g. 2016-09-24T00:00:05.000Z, 2016-09-21
        end_date: A timestamp at which to stop listing page e.g. 2016-09-24T00:00:05.000Z, 2016-09-21

    Returns:
        A named tuple containing the response gotten from paystack's server.
    """

    url = self._parse_url("/page?perPage=" + str(pagination))
    query_params = [
        ("page", page),
        ("start_date", start_date),
        ("end_date", end_date),
    ]
    url = append_query_params(query_params, url)
    return await self._handle_request(HTTPMethod.GET, url)

update(id_or_slug, name, description, amount=None, active=None) async

Get details of a payment page on your integration.

Parameters:

Name Type Description Default
id_or_slug str

The page ID or slug you want to fetch

required
name str

Name of page

required
description str

A description for the page

required
amount Optional[int]

Default amount you want to accept using this page. If none is set, customer is free to provide any amount of their choice. The latter scenario is useful for accepting donations

None
active Optional[bool]

Set to False to deactivate page url

None

Returns:

Type Description
Response

A named tuple containing the response gotten from paystack's server.

Source code in src/pypaystack2/api/payment_pages.py
async def update(
    self,
    id_or_slug: str,
    name: str,
    description: str,
    amount: Optional[int] = None,
    active: Optional[bool] = None,
) -> Response:
    """Get details of a payment page on your integration.

    Args:
        id_or_slug: The page ``ID`` or ``slug`` you want to fetch
        name: Name of page
        description: A description for the page
        amount: Default amount you want to accept using this page.
            If none is set, customer is free to provide any amount
            of their choice. The latter scenario is useful for
            accepting donations
        active: Set to ``False`` to deactivate page url

    Returns:
        A named tuple containing the response gotten from paystack's server.
    """

    url = self._parse_url(f"/page/{id_or_slug}")
    payload = {
        "name": name,
        "description": description,
    }
    optional_params = [
        ("amount", amount),
        ("active", active),
    ]
    payload = add_to_payload(optional_params, payload)
    return await self._handle_request(HTTPMethod.PUT, url, payload)

PaymentPage

Bases: BaseAPI

Provides a wrapper for paystack Payment Pages API

The Payment Pages API provides a quick and secure way to collect payment for products. https://paystack.com/docs/api/page/

Source code in src/pypaystack2/api/payment_pages.py
class PaymentPage(BaseAPI):
    """Provides a wrapper for paystack Payment Pages API

    The Payment Pages API provides a quick and secure way to collect payment for products.
    https://paystack.com/docs/api/page/
    """

    def create(
        self,
        name: str,
        description: Optional[str] = None,
        amount: Optional[int] = None,
        split_code: Optional[str] = None,
        slug: Optional[str] = None,
        metadata: Optional[str] = None,
        redirect_url: Optional[str] = None,
        custom_fields: Optional[list] = None,
    ) -> Response:
        """Create a payment page on your integration

        Args:
            name: Name of page
            description: A description for this page
            amount: Amount should be in kobo if currency is ``Currency.NGN``, pesewas, if
                currency is ``Currency.GHS``, and cents, if currency is ``Currency.ZAR``
            split_code: The split code of the transaction split. e.g. SPL_98WF13Eb3w
            slug: URL slug you would like to be associated with this page.
                Page will be accessible at ``https://paystack.com/pay/[slug]``
            metadata: Extra data to configure the payment page including subaccount,
                logo image, transaction charge
            redirect_url: If you would like Paystack to redirect someplace upon
                successful payment, specify the URL here.
            custom_fields: If you would like to accept custom fields,
                specify them here.

        Returns:
            A named tuple containing the response gotten from paystack's server.
        """

        url = self._parse_url("/page")

        payload = {"name": name}
        optional_params = [
            ("description", description),
            ("amount", amount),
            ("split_code", split_code),
            ("slug", slug),
            ("metadata", metadata),
            ("redirect_url", redirect_url),
            ("custom_fields", custom_fields),
        ]
        payload = add_to_payload(optional_params, payload)
        return self._handle_request(HTTPMethod.POST, url, payload)

    def get_pages(
        self,
        page: int = 1,
        pagination: int = 50,
        start_date: Optional[str] = None,
        end_date: Optional[str] = None,
    ) -> Response:
        """Fetch payment pages available on your integration.

        Args:
            page: Specifies exactly what page you want to retrieve.
                If not specified, we use a default value of 1.
            pagination: Specifies how many records you want to retrieve per page.
                If not specified, we use a default value of 50.
            start_date: A timestamp from which to start listing page e.g. 2016-09-24T00:00:05.000Z, 2016-09-21
            end_date: A timestamp at which to stop listing page e.g. 2016-09-24T00:00:05.000Z, 2016-09-21

        Returns:
            A named tuple containing the response gotten from paystack's server.
        """

        url = self._parse_url("/page?perPage=" + str(pagination))
        query_params = [
            ("page", page),
            ("start_date", start_date),
            ("end_date", end_date),
        ]
        url = append_query_params(query_params, url)
        return self._handle_request(HTTPMethod.GET, url)

    def get_page(self, id_or_slug: str) -> Response:
        """Get details of a payment page on your integration.

        Args:
            id_or_slug: The page ``ID`` or ``slug`` you want to fetch

        Returns:
            A named tuple containing the response gotten from paystack's server.
        """

        url = self._parse_url(f"/page/{id_or_slug}")
        return self._handle_request(HTTPMethod.GET, url)

    def update(
        self,
        id_or_slug: str,
        name: str,
        description: str,
        amount: Optional[int] = None,
        active: Optional[bool] = None,
    ) -> Response:
        """Get details of a payment page on your integration.

        Args:
            id_or_slug: The page ``ID`` or ``slug`` you want to fetch
            name: Name of page
            description: A description for the page
            amount: Default amount you want to accept using this page.
                If none is set, customer is free to provide any amount
                of their choice. The latter scenario is useful for
                accepting donations
            active: Set to ``False`` to deactivate page url

        Returns:
            A named tuple containing the response gotten from paystack's server.
        """

        url = self._parse_url(f"/page/{id_or_slug}")
        payload = {
            "name": name,
            "description": description,
        }
        optional_params = [
            ("amount", amount),
            ("active", active),
        ]
        payload = add_to_payload(optional_params, payload)
        return self._handle_request(HTTPMethod.PUT, url, payload)

    def check_slug_available(self, slug: str) -> Response:
        """Check the availability of a slug for a payment page.

        Args:
            slug: URL slug to be confirmed

        Returns:
            A named tuple containing the response gotten from paystack's server.
        """

        url = self._parse_url(f"/page/check_slug_availability/{slug}")
        return self._handle_request(HTTPMethod.GET, url)

    def add_products(self, id: str, products: list[int]) -> Response:
        """Add products to a payment page

        Args:
            id: ID of the payment page
            products: Ids of all the products

        Returns:
            A named tuple containing the response gotten from paystack's server.
        """

        url = self._parse_url(f"/page/{id}/product")
        payload = {"product": products}
        return self._handle_request(HTTPMethod.POST, url, payload)

add_products(id, products)

Add products to a payment page

Parameters:

Name Type Description Default
id str

ID of the payment page

required
products list[int]

Ids of all the products

required

Returns:

Type Description
Response

A named tuple containing the response gotten from paystack's server.

Source code in src/pypaystack2/api/payment_pages.py
def add_products(self, id: str, products: list[int]) -> Response:
    """Add products to a payment page

    Args:
        id: ID of the payment page
        products: Ids of all the products

    Returns:
        A named tuple containing the response gotten from paystack's server.
    """

    url = self._parse_url(f"/page/{id}/product")
    payload = {"product": products}
    return self._handle_request(HTTPMethod.POST, url, payload)

check_slug_available(slug)

Check the availability of a slug for a payment page.

Parameters:

Name Type Description Default
slug str

URL slug to be confirmed

required

Returns:

Type Description
Response

A named tuple containing the response gotten from paystack's server.

Source code in src/pypaystack2/api/payment_pages.py
def check_slug_available(self, slug: str) -> Response:
    """Check the availability of a slug for a payment page.

    Args:
        slug: URL slug to be confirmed

    Returns:
        A named tuple containing the response gotten from paystack's server.
    """

    url = self._parse_url(f"/page/check_slug_availability/{slug}")
    return self._handle_request(HTTPMethod.GET, url)

create(name, description=None, amount=None, split_code=None, slug=None, metadata=None, redirect_url=None, custom_fields=None)

Create a payment page on your integration

Parameters:

Name Type Description Default
name str

Name of page

required
description Optional[str]

A description for this page

None
amount Optional[int]

Amount should be in kobo if currency is Currency.NGN, pesewas, if currency is Currency.GHS, and cents, if currency is Currency.ZAR

None
split_code Optional[str]

The split code of the transaction split. e.g. SPL_98WF13Eb3w

None
slug Optional[str]

URL slug you would like to be associated with this page. Page will be accessible at https://paystack.com/pay/[slug]

None
metadata Optional[str]

Extra data to configure the payment page including subaccount, logo image, transaction charge

None
redirect_url Optional[str]

If you would like Paystack to redirect someplace upon successful payment, specify the URL here.

None
custom_fields Optional[list]

If you would like to accept custom fields, specify them here.

None

Returns:

Type Description
Response

A named tuple containing the response gotten from paystack's server.

Source code in src/pypaystack2/api/payment_pages.py
def create(
    self,
    name: str,
    description: Optional[str] = None,
    amount: Optional[int] = None,
    split_code: Optional[str] = None,
    slug: Optional[str] = None,
    metadata: Optional[str] = None,
    redirect_url: Optional[str] = None,
    custom_fields: Optional[list] = None,
) -> Response:
    """Create a payment page on your integration

    Args:
        name: Name of page
        description: A description for this page
        amount: Amount should be in kobo if currency is ``Currency.NGN``, pesewas, if
            currency is ``Currency.GHS``, and cents, if currency is ``Currency.ZAR``
        split_code: The split code of the transaction split. e.g. SPL_98WF13Eb3w
        slug: URL slug you would like to be associated with this page.
            Page will be accessible at ``https://paystack.com/pay/[slug]``
        metadata: Extra data to configure the payment page including subaccount,
            logo image, transaction charge
        redirect_url: If you would like Paystack to redirect someplace upon
            successful payment, specify the URL here.
        custom_fields: If you would like to accept custom fields,
            specify them here.

    Returns:
        A named tuple containing the response gotten from paystack's server.
    """

    url = self._parse_url("/page")

    payload = {"name": name}
    optional_params = [
        ("description", description),
        ("amount", amount),
        ("split_code", split_code),
        ("slug", slug),
        ("metadata", metadata),
        ("redirect_url", redirect_url),
        ("custom_fields", custom_fields),
    ]
    payload = add_to_payload(optional_params, payload)
    return self._handle_request(HTTPMethod.POST, url, payload)

get_page(id_or_slug)

Get details of a payment page on your integration.

Parameters:

Name Type Description Default
id_or_slug str

The page ID or slug you want to fetch

required

Returns:

Type Description
Response

A named tuple containing the response gotten from paystack's server.

Source code in src/pypaystack2/api/payment_pages.py
def get_page(self, id_or_slug: str) -> Response:
    """Get details of a payment page on your integration.

    Args:
        id_or_slug: The page ``ID`` or ``slug`` you want to fetch

    Returns:
        A named tuple containing the response gotten from paystack's server.
    """

    url = self._parse_url(f"/page/{id_or_slug}")
    return self._handle_request(HTTPMethod.GET, url)

get_pages(page=1, pagination=50, start_date=None, end_date=None)

Fetch payment pages available on your integration.

Parameters:

Name Type Description Default
page int

Specifies exactly what page you want to retrieve. If not specified, we use a default value of 1.

1
pagination int

Specifies how many records you want to retrieve per page. If not specified, we use a default value of 50.

50
start_date Optional[str]

A timestamp from which to start listing page e.g. 2016-09-24T00:00:05.000Z, 2016-09-21

None
end_date Optional[str]

A timestamp at which to stop listing page e.g. 2016-09-24T00:00:05.000Z, 2016-09-21

None

Returns:

Type Description
Response

A named tuple containing the response gotten from paystack's server.

Source code in src/pypaystack2/api/payment_pages.py
def get_pages(
    self,
    page: int = 1,
    pagination: int = 50,
    start_date: Optional[str] = None,
    end_date: Optional[str] = None,
) -> Response:
    """Fetch payment pages available on your integration.

    Args:
        page: Specifies exactly what page you want to retrieve.
            If not specified, we use a default value of 1.
        pagination: Specifies how many records you want to retrieve per page.
            If not specified, we use a default value of 50.
        start_date: A timestamp from which to start listing page e.g. 2016-09-24T00:00:05.000Z, 2016-09-21
        end_date: A timestamp at which to stop listing page e.g. 2016-09-24T00:00:05.000Z, 2016-09-21

    Returns:
        A named tuple containing the response gotten from paystack's server.
    """

    url = self._parse_url("/page?perPage=" + str(pagination))
    query_params = [
        ("page", page),
        ("start_date", start_date),
        ("end_date", end_date),
    ]
    url = append_query_params(query_params, url)
    return self._handle_request(HTTPMethod.GET, url)

update(id_or_slug, name, description, amount=None, active=None)

Get details of a payment page on your integration.

Parameters:

Name Type Description Default
id_or_slug str

The page ID or slug you want to fetch

required
name str

Name of page

required
description str

A description for the page

required
amount Optional[int]

Default amount you want to accept using this page. If none is set, customer is free to provide any amount of their choice. The latter scenario is useful for accepting donations

None
active Optional[bool]

Set to False to deactivate page url

None

Returns:

Type Description
Response

A named tuple containing the response gotten from paystack's server.

Source code in src/pypaystack2/api/payment_pages.py
def update(
    self,
    id_or_slug: str,
    name: str,
    description: str,
    amount: Optional[int] = None,
    active: Optional[bool] = None,
) -> Response:
    """Get details of a payment page on your integration.

    Args:
        id_or_slug: The page ``ID`` or ``slug`` you want to fetch
        name: Name of page
        description: A description for the page
        amount: Default amount you want to accept using this page.
            If none is set, customer is free to provide any amount
            of their choice. The latter scenario is useful for
            accepting donations
        active: Set to ``False`` to deactivate page url

    Returns:
        A named tuple containing the response gotten from paystack's server.
    """

    url = self._parse_url(f"/page/{id_or_slug}")
    payload = {
        "name": name,
        "description": description,
    }
    optional_params = [
        ("amount", amount),
        ("active", active),
    ]
    payload = add_to_payload(optional_params, payload)
    return self._handle_request(HTTPMethod.PUT, url, payload)