# Recurring payments Recurring payments allow businesses to charge customers automatically and are perfect for variable monthly costs, like usage-based services. If you have the customer’s mandate, you can manually create each payment and easily adjust the amount as needed. We will now discuss how you can create a Payment with a Mandate with our [Payments API](/reference/api/payments). ## Steps to create the payment with a mandate 1. **Create a Customer**: Use the [Customer API](/reference/api/customers/createcustomer) to create a new customer or use an existing customer. 2. **Create a Mandate**: Use the [Mandate API](/reference/api/mandates/createmandate) to create a new mandate or use an existing mandate. 3. **Create a Payment with a Mandate**: Use the [Payment API](/reference/api/payments/createpayment) to create a payment. ## Create a Customer The first step is to create a Customer. This Customer object represents the entity (person or company) that will be billed. You can create a Customer using the [Customer API](/reference/api/customers/createcustomer). PHP ```php $customer = $paypro->customers->create( [ 'email' => 'customer@example.com', 'first_name' => 'First name', 'last_name' => 'Last name' ] ); ``` Ruby ```ruby client = PayPro::Client.new('pp_...') customer = client.customers.create( email: 'customer@example.com', first_name: 'First name', last_name: 'Last name' ) ``` Once the Customer object is created, you can use it to create a mandate by referencing the customer's unique ID. ## Create a Mandate A Mandate symbolizes the permission the Customer gave you to charge their payment method. For example, if you already have the customer’s IBAN and account holder name, you can manually create a "direct-debit" mandate using the [create Mandate API](/reference/api/mandates/createmandate). Once created, this "direct-debit" mandate can be used to set up and process recurring payments. Important To create mandates you still the need permission from the customer. When creating a mandate make sure to clearly state that the customer will agree to additional charges. Communicating this clearly will also lead to less chargebacks and costs. PHP ```php $payment = $paypro->mandates->create( [ 'customer' => 'CUSTOMER_ID', 'pay_method' => 'direct-debit', 'iban' => 'IBAN', 'account_holder_name' => 'Account Holder Name' ] ); ``` Ruby ```ruby payment = client.mandates.create( customer: 'CUSTOMER_ID', pay_method: 'direct-debit', iban: 'IBAN', account_holder_name: 'Account Holder Name' ) ``` ## Create a Payment with a Mandate After creating the mandate, you can move forward with creating the payment. As the mandate is already linked to a specific customer, there’s no need to include a separate `CUSTOMER_ID`. To create the payment, provide the `amount`, `currency`, `description`, and the `mandate`, which is the unique ID of the mandate. PHP ```php $payment = $paypro->payments->create( [ 'amount' => 500, 'currency' => 'EUR', 'description' => 'Payment description', 'mandate' => 'MANDATE_ID' ] ); ``` Ruby ```ruby client = PayPro::Client.new('pp_...') payment = client.payments.create( amount: 500, currency: 'EUR', description: 'Payment description', mandate: 'MANDATE_ID' ) ``` The payment will be processed immediately after creation. A Payment object enables you to track and manage your customer’s payment journey.