PHP code example of analogbridge / analog-bridge-php

1. Go to this page and download the library: Download analogbridge/analog-bridge-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

analogbridge / analog-bridge-php example snippets


composer 

$bridge = new \AnalogBridge\Customer("Your secret API Key");

$bridge = new \AnalogBridge\Customer("Your secret API Key");
$customer = $bridge->create([
    "email" => "[email protected]",
    "shipping" => [
        "first_name" => "John",
        "last_name" => "Smith",
        "address1" => "3336 Commercial Ave",
        "city" => "Northbrook",
        "state" => "IL",
        "zip" => "60062",
        "phone" => "800-557-3508",
        "email" => "[email protected]"
    ],
    "metadata" => [
        "user_id" => 123456
    ]
]);

$customer = $bridge->get("cus_12345678");

$customers = $bridge->all(["offset" => 100, "limit" => 100]);

$bridge->update("cus_12345678", [
            "email" => "[email protected]",
            "shipping" => [
                "address1" => "123 Main St.",
                "city" => "New York",
                "state" => "NY",
                "zip" => "12345"
            ]
        ]);

$bridge->delete("cus_123456789");

$bridge = new \AnalogBridge\Order("Your secret API Key");
$order = $bridge->all("cus_3ab7aa6ec5feda6fe8a3");

$order = $bridge->get("cus_3ab7aa6ec5feda6fe8a3", "ord_fe310b878dc3313c3c2e");

$order = $bridge->import_ready();

$bridge = new \AnalogBridge\Product();
$products = $bridge->all();