NAME

jBilling::Client::SOAP - Communicate with jBilling

VERSION

Version 0.05

SYNOPSIS

This module acts as an interface for functionality exposed by the jBilling SOAP API.

Initialise the library use jBilling::Client::SOAP; my $jb = jBilling::Client::SOAP->new(); $jb->getAPI( 'username' => 'yourusername', 'password' => 'yourpassword', 'url' => 'http://yourservername:yourserverport/jbilling/services/api' ); # Initialise the API

Load an existing order from jBilling my $order = jBilling::Client::SOAP::OrderWS->new( 'jbilling' => $jb, # The Client connection to jBilling 'id' => 25300 # Specify the ID which we want to load )->retrieve; # Retrieve the order details from jBilling

Create a new order my $newOrder = jBilling::Client::SOAP::OrderWS->new('jbilling' => $jb, 'period' => '200', 'billingTypeId' => '2', 'currencyId' => '110', 'userId' => '122', 'activeSince' => '2015-01-31', 'notes' => 'Some Order notes from the API');

# Create some OrderLines
my $ol = jBilling::Client::SOAP::OrderLineWS->new('useItem' => 'true',
                                                  'itemId' => 2103, # MAKE SURE THIS ITEM MATCHES AN ITEM YOUR SYSTEM!
                                                  'typeId' => 1, # Item
                                                  'quantity' =>  1,
                                                  'description' => "test from perl api",
                                                  );
my $ol1 = jBilling::Client::SOAP::OrderLineWS->new('useItem'    => 'true',
                                                   'itemId'     => '2102', # MAKE SURE THIS ITEM MATCHES AN ITEM YOUR SYSTEM!
                                                   'typeId'     => 1, # Item
                                                   'quantity'   => 1,
                                                   'description' => "Another test from perl api"
                                                   );
# And some Metafields
my $retailer = jBilling::Client::SOAP::MetaFieldValueWS->new(
        'fieldName'   => 'retailer',
        'stringValue' => 'Test Retailer',
);
my $orderno = jBilling::Client::SOAP::MetaFieldValueWS->new(
        'fieldName'   => 'Order Number',
        'stringValue' => 'TestOrderNo'
);

# add our order lines to the order
$newOrder->orderLines(\@OrderLines);
$newOrder->metaFields(\@metafields);
$newOrder->save; # Returns orderId on success

SUBROUTINES/METHODS

getAPI

This method initiates a SOAP::Lite object for later re-use

new

Constructs the jBilling::Client::SOAP object