Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Change Log
## [4.61.0](https://github.com/plivo/plivo-python/tree/v4.61.0) (2026-06-11)
**Feature - PhoneNumber buy compliance application support**
- Added optional `compliance_application_id` parameter to `numbers.buy()`, sent as the `compliance_application_id` wire param. Lets regulated numbers (e.g. India) be purchased with an approved regulatory compliance application linked at purchase time. Backward-compatible trailing optional argument.

## [4.60.2](https://github.com/plivo/plivo-python/tree/v4.60.2) (2026-05-26)
**Feature - Profile API DBA field support**
- Added Doing Business As (DBA) field support to Profile API
Expand Down
5 changes: 3 additions & 2 deletions plivo/resources/numbers.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ def __init__(self, client):
app_id=[optional(of_type(six.text_type))],
verification_info=[optional(of_type_exact(dict))],
cnam_lookup=[optional(of_type(six.text_type))],
ha_enable=[optional(of_type(bool))],)
def buy(self, number, app_id=None, verification_info=None, cnam_lookup=None, ha_enable=None):
ha_enable=[optional(of_type(bool))],
compliance_application_id=[optional(of_type(six.text_type))],)
def buy(self, number, app_id=None, verification_info=None, cnam_lookup=None, ha_enable=None, compliance_application_id=None):
return self.client.request('POST', ('PhoneNumber', number),
to_param_dict(self.buy, locals()))

Expand Down
2 changes: 1 addition & 1 deletion plivo/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# -*- coding: utf-8 -*-
__version__ = '4.60.2'
__version__ = '4.61.0'
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setup(
name='plivo',
version='4.60.2',
version='4.61.0',
description='A Python SDK to make voice calls & send SMS using Plivo and to generate Plivo XML',
long_description=long_description,
url='https://github.com/plivo/plivo-python',
Expand Down
18 changes: 18 additions & 0 deletions tests/resources/test_numbers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-

import json

import plivo
from tests.base import PlivoResourceTestCase
from tests.decorators import with_response
Expand Down Expand Up @@ -88,3 +90,19 @@ def test_create_with_ha_enable(self):
self.assertUrlEqual(self.client.current_request.url,
self.get_url('PhoneNumber', number_id))
self.assertEqual(self.client.current_request.method, 'POST')

@with_response(202, method_name='create')
def test_create_with_compliance_application_id(self):
self.client.numbers.buy(
number_id,
app_id='test',
compliance_application_id='compliance123')
self.assertUrlEqual(self.client.current_request.url,
self.get_url('PhoneNumber', number_id))
self.assertEqual(self.client.current_request.method, 'POST')
body = self.client.current_request.body
if isinstance(body, bytes):
body = body.decode('utf-8')
self.assertEqual(
json.loads(body).get('compliance_application_id'),
'compliance123')
Loading