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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## [5.49.0](https://github.com/plivo/plivo-java/tree/v5.49.0) (2026-06-11)
**Feature - complianceApplicationId on phone number buy**
- Added an optional `complianceApplicationId` builder param to `PhoneNumberCreator`, serialized to the `compliance_application_id` wire param on phone number buy
- Lets regulated numbers (e.g. India) be purchased with an approved regulatory compliance application linked at purchase time
- Backward-compatible additive builder method

## [5.48.1](https://github.com/plivo/plivo-java/tree/v5.48.1) (2026-05-26)
**Feature - Profile API DBA field support**
- Added Doing Business As (DBA) field support to Profile API
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.plivo</groupId>
<artifactId>plivo-java</artifactId>
<version>5.48.1</version>
<version>5.49.0</version>
<name>plivo-java</name>
<description>A Java SDK to make voice calls &amp; send SMS using Plivo and to generate Plivo XML</description>
<licenses>
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/plivo/api/models/number/PhoneNumberCreator.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public class PhoneNumberCreator extends Creator<PhoneNumberCreateResponse> {
private String appId;
private String cnamLookup;
private Boolean haEnable;
private String complianceApplicationId;

public PhoneNumberCreator(String number) {
if (number == null) {
Expand Down Expand Up @@ -45,6 +46,15 @@ public PhoneNumberCreator haEnable(final Boolean haEnable) {
return this;
}

public String complianceApplicationId() {
return this.complianceApplicationId;
}

public PhoneNumberCreator complianceApplicationId(final String complianceApplicationId) {
this.complianceApplicationId = complianceApplicationId;
return this;
}

@Override
protected Call<PhoneNumberCreateResponse> obtainCall() {
return client().getApiService().phoneNumberCreate(client().getAuthId(), number, this);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/com/plivo/api/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.48.1
5.49.0
17 changes: 17 additions & 0 deletions src/test/java/com/plivo/api/NumberTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static junit.framework.TestCase.assertEquals;

import com.fasterxml.jackson.databind.JsonNode;
import com.plivo.api.models.base.ListResponse;
import com.plivo.api.models.number.Number;
import com.plivo.api.models.number.PhoneNumber;
Expand Down Expand Up @@ -173,4 +174,20 @@ public void phoneNumberCreateWithClientShouldSucceed() throws Exception {
assertRequest("POST", "PhoneNumber/%s/", number);
}

@Test
public void phoneNumberBuyWithComplianceApplicationIdShouldSucceed() throws Exception {
expectResponse("phoneNumberCreateResponse.json", 201);

final String number = "1231231231";
final String complianceApplicationId = "1234567890123456";

PhoneNumber.buyer(number)
.complianceApplicationId(complianceApplicationId)
.create();

JsonNode payload = actualRequestPayload();
assertEquals(complianceApplicationId,
payload.get("compliance_application_id").asText());
}

}
Loading