You have to create a client, payment and an offer. After that, create a subscription with the created client, payment and offer.
The following code will solve this issue:
$apiKey = '111111111111111111111';
$apiEndpoint = 'https://api.paymill.de/v2/';
$clientsObject = new Services_Paymill_Clients($apiKey, $apiEndpoint);
$clientData = array(
'email' => $_POST['email'],
'description' => 'Tier 1'
);
$client = $clientsObject->create($clientData);
$paymentObject = new Services_Paymill_Payments($apiKey, $apiEndpoint);
$paymentData = array(
'token' => '098f6bcd4621d373cade4e832627b4f6', //general test-token
'client' => $client['id']
);
$payment = $paymentObject->create($paymentData);
$offersObject = new Services_Paymill_Offers($apiKey, $apiEndpoint);
$offersData = array(
'amount' => '3000', // E.g. "4200" for 42.00 EUR
'currency' => 'GBP', // ISO 4217
'interval' => '1 MONTH', // Options: "# DAY", "# WEEK", "# MONTH" and "# YEAR"
'name' => 'Tier 1'
);
$offer = $offersObject->create($offersData);
$subscriptionObject = new Services_Paymill_Subscriptions($apiKey, $apiEndpoint);
$subscriptionData = array(
'client' => $client['id'],
'offer' => $offer['id'],
'payment' => $payment['id']
);
$subscription = $subscriptionObject->create($subscriptionData);
Best regards
Ringo
Paymill Developer