imagex/apexedge-client

Apexedge library

v1.0.4-beta 2022-11-29 14:03 UTC

README

ApexEdge is company that builds Subscription Management and Financial Advocacy solutions to help humans live better financial lives. You can read the complete API documentation here.

Available Products

ApexEdge offers different types of APIs, one for each product. This library was created to use with the Negotiate product.

Installation

composer require imagex/apexedge-client

Quickstart

$client = new \GuzzleHttp\Client([...]);
$apexEdge = new \Apexedge\ApexedgeClient($client, 'api-key');

Negotiate

To process Negotiation Service Requests, the following API calls are required as part of the integration process:

Get Billers

The List all Billers & Required Data API will return:

  • The list of Billers available for Negotiation
  • The data required to process a Service Request for Negotiation when you the billing statement is attached.
$apexEdge->listAllBillers();

You’ll want to cache the returned response on your side to reduce API calls. Because Billers available for Cancellation and the data required to process a Service Request can change, you’ll want to make this API call monthly/quarterly for the most current information.

Get Probability

To drive the best customer experience (targeted, meaningful engagement & conversion), presenting a call to action to your customers should be targeted based on the probability of meaningful Negotiations success. The Get Probability API call will provide you the data to facilitate your strategic decision.

  • Savings Rate (%) = Average/expected monthly savings negotiated to the current bill amount
  • Success Rate (%) = Probability of negotiations success
  • Average Savings Length (months) = The average duration of negotiated savings

Your Decision: If the rates or savings are too low, you will not present the ‘Negotiate’ call to action.

Get Probability calls are recommended 1x per quarter and results should be cached. You may choose to make:

  • Probability by Biller and Bill Amount. You provide the Biller ID and Bill Amount (Not recommended due to efficiency)
  • Probability by Biller. You provide the Biller ID. Probability by $ ranges are returned.
  • Probability for all Billers. Probability by $ ranges are returned for all billers. (Note this API also returns all fields in Get Billers).

    $apexEdge->listAllBillersProbabilities();
    # OR
    $apexEdge->getBillerProbability(biller_id: $biller_id, original_monthly_amount: 1000, );
    

    Create Service Request

    In order to create a service request we must do this process in two steps:

  • Create Customer Account API. With this API call, you will submit general customer contact information (name, address, etc.) to establish a customer specific account. The API will return a Customer ID to be used for Service Requests.

  • Create Service Request API

    Create Customer Account API

    $account_params = new CustomerAccountParams(...);
    $customer = $apexEdge->createCustomerAccount($account_params);
    

    Create Service Request API

    $service_request_params = new ServiceRequestParams(...);
    $service_request = $apexEdge->createServiceRequest($customer->id, $service_request_params);
    

    Service Request Status

    Option 1. API request to check the status of a service requests

  • Get Status - Retrieve Service Request API

    $service_request = $apexEdge->getServiceRequest($customer_id, $service_request_id);
    

Option 2. Subscribe and Receive Status via Webhook

To configure webhooks see the following sections:

Submit Missing Information

You can submit information or data that is needed to complete the related Service Request.

$apexEdge->submitMissingInformation($customer_id, $service_request_id,$missing_information_array);

Webhooks

Webhooks may be used to notify you when a change or event occurs in our Apexedge Platform.

You can read the full documentation about ApexEdge webhooks here

Create a Webhook

$webhook_params = new WebhookParams(...);
$webhook = $apexEdge->createWebhook($webhook_params);

Retrieve a Webhook

$webhook = $apexEdge->getWebhook($webhook_id);

Update a Webhook

$webhook_params = new WebhookParams(...);
$updated_webhook = $apexEdge->updateWebhook($webhook_id, $webhook_params);

List all Webhooks

$webhooks = $apexEdge->listAllWebhooks();

Delete a specific Webhook

$webhooks = $apexEdge->deleteWebhook($webhook_id);

Parse a received Webhook

$webhook = new ApexedgeWebhook($received_request_body);
$parsed_webhook = ApexedgeWebhookParser::parse($webhook);

Contributing

Run unit tests

./vendor/bin/pest