NAV Navbar
cURL Ruby PHP Python

Introduction

The PayPro v1 API can be used to integrate your systems and applications with our services.

This reference page provides all information necessary to create an integration with PayPro. It explains the structure of API requests and which commands you can use. It does however not provide detailed code examples and guides on how to implement certain use cases.

If you are looking for guides on how to use the API for certain use cases, check our Developer Docs.

Integrating a Payment system can be a complex task and while we try to make it as easy as possible if you have any questions, contact Support or let us call you back.

Structure of the POST API

# Example of a valid API call
curl https://paypro.nl/post_api
  -d "apikey=a19d52d1d1523ca75ddd6d1d520c692b"
  -d "command=get_sale"
  -d "params={\"sale_id\":12345}"
# Example of a valid API call
require 'paypro'

client = PayPro::Client.new('a19d52d1d1523ca75ddd6d1d520c692b')
client.command = 'get_sale'
client.params = {
  sale_id: 12345
}

response = client.execute
# Example of a valid API call
require('vendor/autoload.php');

$client = new \PayPro\Client("a19d52d1d1523ca75ddd6d1d520c692b");
$client->setCommand("get_sale");
$client->setParam("sale_id" => 12345);

$response = $client->execute();

# Example of a valid API call
from paypro import Client

client = Client('a19d52d1d1523ca75ddd6d1d520c692b')
client.setCommand('get_sale')
client.setParam('sale_id', 12345)

response = client.execute()

The POST API works by adding POST variables to an HTTP call to execute commands. The API expects three POST values to be always set. The POST values are as follows:

apikey

The API key is a key linked to your PayPro account. It is used to identify and authenticate the API call. You can create and view your API keys in your Dashboard.

command

Command is the parameter to tell the API which command you want to execute. All commands will be listed below.

params

Some commands require additional parameters. Some are mandatory while other parameters are optional. The format for these parameters should be a JSON string.

On a successful call the API will send a JSON object back and on errors an error message.

API Code Classes

For the languages in the top-right tabs we have created clients. You can use these clients in your code to make working with our API easier. All code examples on this page assume you are using the clients, except for cURL.

For more information and how to install the clients check our Developer Docs.

Payment

Payments are the central point of PayPro and this is usually where you start when integrating with the PayPro API. With payments you can create payments for your customers, create subscriptions and invoices.

Create Payment

Example Request

curl https://paypro.nl/post_api
  -d "apikey=YOUR_API_KEY"
  -d "command=create_payment"
  -d "params={\"amount\":1234,\"description\":\"A new PayPro payment for test@paypro.nl\",\"pay_methods\":\"ideal/ABNANL2A\",\"consumer_email\":\"test@paypro.nl\"}"
require 'paypro'

client = PayPro::Client.new('YOUR_API_KEY')
client.command = 'create_payment'
client.params = {
  amount: 1234,
  pay_method: 'ideal/ABNANL2A',
  consumer_city: 'Groningen',
  consumer_email: 'test@paypro.nl',
  description: 'A new PayPro payment for test@paypro.nl'
}

response = client.execute
require('vendor/autoload.php');

$client = new \PayPro\Client("YOUR_API_KEY");
$client->setCommand("create_payment");
$client->setParams(array(
  "amount" => 1234,
  "pay_method" => "ideal/ABNANL2A",
  "consumer_email" => "test@paypro.nl",
  "description" => "A new PayPro payment for test@paypro.nl"
));

$response = $client->execute();
from paypro import Client

client = Client('YOUR_API_KEY')
client.setCommand('create_payment')
client.setParams({
    'amount': 1234,
    'pay_method': 'ideal/ABNANL2A',
    'consumer_email': 'test@paypro.nl',
    'description': 'A new PayPro payment for test@paypro.nl',
})

response = client.execute()

Example Response

{
  "payment_url": "https://www.paypro.nl/betalen/4f8b340c420299bbbf101d3c20e17083ce40664d",
  "payment_hash": "4f8b340c420299bbbf101d3c20e17083ce40664d"
}

Creates a new payment in the PayPro system.

Command

create_payment

Parameters

Parameter Type Description
amount
Required
integer A postive integer in cents representing the amount to be paid. Format in cents: € 24.99 should be 2499
affiliate_amount integer A positive integer in cents representing the affiliate commission. Format in cents: € 24.99 should be 2499
approve_machtiging string Can be set if the user approves with a direct debit request. If not supplied, but trying to do a direct debit will result in a redirect to the payment page.
Allowed values: true, false (as string)
cancel_url string URL of the redirect if the user cancels the payment. If empty it will get the product cancel_url or else stays on a PayPro page.
consumer_accountno string IBAN number of the consumer. This IBAN will be used to do SEPA Direct Debits and recurring payments.
consumer_address string Street address of the consumer. Will be used for information on the consumerpage and invoice. Also used with fulfilment integrations.
consumer_city string City where the consumer lives. Will be used for information on the consumerpage and invoice. Also used with fulfilment integrations.
consumer_companyname string Name of the company of the consumer. Will be used for information on the consumerpage and invoice.
consumer_country string Country where the consumer lives. Will be used for information on the consumerpage and invoice. Also used with fulfilment integrations.
consumer_email string Emailaddress of the consumer. Payment information and other emails will be send to this address. This field is mandatory for a payment and failing to supply it will redirect the consumer to the payment page.
consumer_firstname string Firstname of the consumer. Will be used for information on the consumerpage and invoice.
consumer_mobile string Mobile phonenumber of the consumer. Will be used for information on the consumerpage and invoice.
consumer_name string Name of the consumer. Acts as the lastname if consumer_firstname is also set. Will be used for information on the consumerpage and invoice.
consumer_phone string Phonenumber of the consumer. Will be used for information on the consumerpage and invoice.
consumer_postal string Postal of the consumer. Will be used for information on the consumerpage and invoice. Also used with fulfilment integrations.
consumer_vatnumber string VAT number of the consumer. This VAT will be used in the invoices and can result in not having to pay any VAT if the VAT is valid and the consumer and merchant are from different EU countries.
currency string Currency of the payment. Only usable with PayPal.
Allowed values: EUR, USD and GDP.
Default: EUR
custom string Custom field that is free to use for the merchant. Can be used to send additional information or tracking codes.
description string Description of the payment. Will be shown to the customer on the issuers page.
locale string Sets the locale of the payment page.
Allowed values: NL, EN and DE.
Default: NL
next_direct_debit_date string Sets the next direct debit date. Format: YYYY-MM-DD.
pay_method string Sets the payment method for the payment. If empty the customer chooses a payment method on a payment screen.
postback_url string URL for the PayPro postbacks. On every status change of the payment this URL will be called.
remarks string Remarks to be shown on the consumerpage.
return_url string URL of the redirect after the customer completed the payment. If empty it will try the return url of the product or else stays on a PayPro page.
test_mode boolean Indicates whether this request should be in the test mode. Use this when testing the API and you do not want to create actual payments.
vat integer A positive integer representing the VAT percentage of this payment.
Default: 21

Create Product Payment

Example Request

curl https://paypro.nl/post_api
  -d "apikey=YOUR_API_KEY"
  -d "command=create_product_payment"
  -d "params={\"product_id\":\"48998\",\"consumer_email\":\"test@paypro.nl\"}"
require 'paypro'

client = PayPro::Client.new('YOUR_API_KEY')
client.command = 'create_product_payment'
client.params = {
  product_id: 12345,
  consumer_email: 'test@paypro.nl'
}

response = client.execute
require('vendor/autoload.php');

$client = new \PayPro\Client("YOUR_API_KEY");
$client->setCommand("create_product_payment");
$client->setParams(array(
  "product_id" => 12345,
  "consumer_email" => "test@paypro.nl"
));

$response = $client->execute();
from paypro import Client

client = Client('YOUR_API_KEY')
client.setCommand('create_product_payment')
client.setParams({
  'product_id': 12345,
  'consumer_email': 'test@paypro.nl',
})

response = api.execute()

Example Response

{
  "payment_url": "https://www.paypro.nl/betalen/4f8b340c420299bbbf101d3c20e17083ce40664d",
  "payment_hash": "4f8b340c420299bbbf101d3c20e17083ce40664d"
}

Creates a new payment for a Product in the PayPro system.

Command

create_product_payment

Parameters

Parameter Type Description
product_id
Required
integer ID of the Product where create a Payment object for.
consumer_email
Required
string Emailaddress of the consumer. Payment information and other emails will be send to this address. This field is mandatory for a payment and failing to supply it will redirect the consumer to the payment page.
amount integer A postive integer in cents representing the amount to be paid. Format in cents: € 24.99 should be 2499
affiliate_amount integer A positive integer in cents representing the affiliate commission. Format in cents: € 24.99 should be 2499
approve_machtiging string Can be set if the user approves with a direct debit request. If not supplied, but trying to do a direct debit will result in a redirect to the payment page.
Allowed values: true, false (as string)
cancel_url string URL of the redirect if the user cancels the payment. If empty it will get the product cancel_url or else stays on a PayPro page.
consumer_address string Street address of the consumer. Will be used for information on the consumerpage and invoice. Also used with fulfilment integrations.
consumer_city string City where the consumer lives. Will be used for information on the consumerpage and invoice. Also used with fulfilment integrations.
consumer_companyname string Name of the company of the consumer. Will be used for information on the consumerpage and invoice.
consumer_country string Country where the consumer lives. Will be used for information on the consumerpage and invoice. Also used with fulfilment integrations.
consumer_firstname string Firstname of the consumer. Will be used for information on the consumerpage and invoice.
consumer_mobile string Mobile phonenumber of the consumer. Will be used for information on the consumerpage and invoice.
consumer_name string Name of the consumer. Acts as the lastname if consumer_firstname is also set. Will be used for information on the consumerpage and invoice.
consumer_phone string Phonenumber of the consumer. Will be used for information on the consumerpage and invoice.
consumer_postal string Postal of the consumer. Will be used for information on the consumerpage and invoice. Also used with fulfilment integrations.
consumer_vatnumber string VAT number of the consumer. This VAT will be used in the invoices and can result in not having to pay any VAT if the VAT is valid and the consumer and merchant are from different EU countries.
currency string Currency of the payment. Only usable with PayPal.
Allowed values: EUR, USD and GDP.
Default: EUR
custom string Custom field that is free to use for the merchant. Can be used to send additional information or tracking codes.
description string Description of the payment. Will be shown to the customer on the issuers page.
locale string Sets the locale of the payment page.
Allowed values: NL, EN and DE.
Default: NL
next_direct_debit_date string Sets the next direct debit date. Format: YYYY-MM-DD.
pay_method string Sets the payment method for the payment. If empty the customer chooses a payment method on a payment screen.
postback_url string URL for the PayPro postbacks. On every status change of the payment this URL will be called.
remarks string Remarks to be shown on the consumerpage.
return_url string URL of the redirect after the customer completed the payment. If empty it will try the return url of the product or else stays on a PayPro page.
vat integer A positive integer representing the VAT percentage of this payment.
Default: 21

Get Payment

Example Request

curl https://paypro.nl/post_api
  -d "apikey=YOUR_API_KEY"
  -d "command=get_sale"
  -d "params={\"payment_hash\":\"86b11af9d1bab267f4579533d3a58c9818a1bc44\"}"
require 'paypro'

client = PayPro::Client.new('YOUR_API_KEY')
client.command = 'get_sale'
client.params = {
  payment_hash: '86b11af9d1bab267f4579533d3a58c9818a1bc44'
}

response = client.execute
require('vendor/autoload.php');

$client = new \PayPro\Client("YOUR_API_KEY");
$client->setCommand("get_sale");
$client->setParam("payment_hash", "86b11af9d1bab267f4579533d3a58c9818a1bc44");

$response = $client->execute();
from paypro import Client

client = Client('YOUR_API_KEY')
client.setCommand('get_sale')
client.setParam('payment_hash', '86b11af9d1bab267f4579533d3a58c9818a1bc44')

response = client.execute()

Example Response

{
  "last_successful_seq": 1,
  "emailaddress": "test@paypro.nl",
  "amount_total_affiliate": 0,
  "id": 1234567,
  "total_paused_days": 0,
  "current_number_of_periods": 1,
  "order_quantity": "1",
  "total": "20,00 ",
  "number_of_periods": 1,
  "address": "Emmaplein 1",
  "vatnumber": "",
  "company_name": "",
  "period_duration": "1 month",
  "custom": "custom field",
  "lastname": "PayPro Test",
  "firstname": "",
  "invoicemethod": "instant",
  "current_status": "completed",
  "postal": "9711AP",
  "country_code": "NL",
  "vat": 21,
  "amount_affiliate_initial": 0,
  "amount_total": 2000,
  "price_recurring": 0,
  "city": "Groningen",
  "affiliate": null,
  "date": "06/04/2017 14:08",
  "amount_affiliate_recurring": 0,
  "price_initial": 2000,
  "remarks": "",
  "description": "Order 10",
  "phone": "",
  "product_id": 0
}
}

Retrieves a payment from the PayPro system. You can use the sale_id or a payment_hash. The payment_hash is prefered and you get this hash when creating a payment with create_payment and create_product_payment.

Command

get_sale

Parameters

Parameter Type Description
payment_hash string The unique hash of the payment. This hash returned after creating a payment.
sale_id integer Internal ID used in the PayPro system.

Products

This is a full list of product methods that can be used.

Create Product

Example Request

curl https://paypro.nl/post_api
  -d "apikey=YOUR_API_KEY"
  -d "command=create_product"
  -d "params={\"title\":\"PayPro Product\",\"url\":\"https://www.paypro.nl/\",\"description\":\"PayPro Test Product\",\"return_url\":\"https://www.paypro.nl/return\",\"price\":\"1234\"}"
require 'paypro'

client = PayPro::Client.new('YOUR_API_KEY')
client.command = 'create_product'
client.params = {
  title: 'PayPro Product',
  url: 'https://www.paypro.nl',
  description: 'PayPro Test Product',
  return_url: 'https://www.paypro.nl/return',
  price: 1234
}

response = client.execute
require('vendor/autoload.php');

$client = new \PayPro\Client("YOUR_API_KEY");
$client->setCommand("create_product");
$client->setParams(array(
  "title" => "PayPro Product",
  "url" => "https://paypro.nl",
  "description" => "PayPro Test Product",
  "return_url" => "https://paypro.nl/return",
  "price" => 1234
));

$response = $client->execute();
from paypro import Client

client = Client('YOUR_API_KEY')
client.setCommand('create_product')
client.setParams({
    'title': 'PayPro Product',
    'url': 'https://www.paypro.nl/',
    'description': 'PayPro Test Product',
    'return_url': 'https://www.paypro.nl/return',
    'price': 1234,
})

response = client.execute()

Example Response

{
  "number_of_periods": "1",
  "score": 0,
  "return_url": "https://www.paypro.nl/return",
  "price": 1234,
  "time_multiplier": "1",
  "name": "PayPro Product",
  "has_paypal": true,
  "has_bancontact": true,
  "description": "PayPro Test Product",
  "date": "2012-12-12T12:34:56+02:00",
  "time_type": "month",
  "is_active": true,
  "product_id": 12345,
  "has_ideal": true,
  "url": "https://www.paypro.nl/",
  "has_machtiging": true
}

Creates a new Product object in the PayPro system.

Command

create_product

Parameters

Parameter Type Description
title
Required
string Name of the product which is displayed to customers.
url
Required
string URL to the product detail page. Not displayed to customers, only for internal usage.
description
Required
string Description of the product which is displayed to customers.
return_url
Required
string URL of the page where customers are redirect to after payment.
price
Required
int Amount of the product, in cents.
has_ideal boolean True if the product can be payed with iDEAL.
has_paypal boolean True if the product can be payed with PayPal.
has_machtiging boolean True if the product can be payed with Machtiging.
is_editable boolean True if the product can be editable in the PayPro dashboard. When false the product can only be edited with the API.
goods_type string The product can be ‘digital’ or ‘physical’. Only used for Sofort Payments.
Default: digital

Get Product

Example Request

curl https://paypro.nl/post_api
  -d "apikey=YOUR_API_KEY"
  -d "command=get_product"
  -d "params={\"product_id\":\"12345\"}"
require 'paypro'

client = PayPro::Client.new('YOUR_API_KEY')
client.command = 'get_product'
client.params = {
  product_id: 12345
}

response = client.execute
require('vendor/autoload.php');

$client = new \PayPro\Client("YOUR_API_KEY");
$client->setCommand("get_product");
$client->setParam("product_id", 12345);

$response = $client->execute();
from paypro import Client

client = Client('YOUR_API_KEY')
client.setCommand('get_product')
client.setParam('product_id', 12345)

response = client.execute()

Example Response

{
  "number_of_periods": "1",
  "score": 0,
  "return_url": "https://www.paypro.nl/return",
  "price": 1234,
  "time_multiplier": "1",
  "name": "PayPro Product",
  "has_paypal": true,
  "has_bancontact": true,
  "description": "PayPro Test Product",
  "date": "2012-12-12T12:34:56+02:00",
  "time_type": "month",
  "is_active": true,
  "product_id": 12345,
  "has_ideal": true,
  "url": "https://www.paypro.nl/",
  "has_machtiging": true
}

Loads an existing Product object from the PayPro system.

Command

get_product

Parameters

Parameter Type Description
product_id
Required
integer ID of the Product to load.

Update Product

Example Request

curl https://paypro.nl/post_api
  -d "apikey=YOUR_API_KEY"
  -d "command=update_product"
  -d "params={\"product_id\":\"12345\",\"parameter\":\"name\",\"value\":\"New Product Name\"}"
require('vendor/autoload.php');

$client = new \PayPro\Client("YOUR_API_KEY");
$client->setCommand("update_product");
$client->setParams(array(
  "product_id" => 12345,
  "parameter" => "name",
  "value" => "New Product Name"
));

$response = $client->execute();
from paypro import Client

client = Client('YOUR_API_KEY')
client.setCommand('get_product')
client.setParams({
    'product_id': 12345,
    'parameter': 'name',
    'value': 'New Product Name',
})

response = client.execute()
require 'paypro'

client = PayPro::Client.new('YOUR_API_KEY')
client.command = 'update_product'
client.params = {
  product_id: 12345,
  parameter: 'name',
  value: 'New Product Name'
}

response = client.execute

Example Response

"name set to 'New Name'"

Updates an existing Product object in the PayPro system.

Command

update_product

Parameters

Parameter Type Description
product_id
Required
integer ID of the Product to load.
parameter
Required
string Name of the field to update. See available fields to update below for a list of available fields.
Example: name
value
Required
string The new value of the field.

Available fields to update

Field Type Description
name string Name of the product which is displayed to customers.
url string URL to the product detail page. Not displayed to customers, only for internal usage.
description string Description of the product which is displayed to customers.
return_url string URL of the page where customers are redirect to after payment.
has_machtiging boolean True if the product can be payed with Machtiging.
has_ideal boolean True if the product can be payed with iDEAL.
has_bancontact boolean True if the product can be payed with Bancontact.
has_paypal boolean True if the product can be payed with PayPal.
has_sofort boolean True if the product can be payed with Sofort.
goods_type string The product can be ‘digital’ or ‘physical’. Only used for Sofort Payments.
Default: digital
price_c int Amount of the product, in cents.
affiliate_commission_c int Amount of the affiliate commission, in cents.
is_editable boolean True if the product can be editable in the PayPro dashboard. When false the product can only be edited with the API.
vat int VAT percentage of the product as integer.
Example: 21
form_return_companyname boolean True if the company name is required at the Payment form
form_return_name boolean True if the name is required at the Payment form
form_return_address boolean True if the address is required at the Payment form
form_return_phone boolean True if the phone number is required at the Payment form
form_return_remarks boolean True if remarks are required at the Payment form
form_return_mobile boolean True if the mobile number is required at the Payment form
form_return_password boolean True if a password is required at the Payment form
form_return_firstlastname boolean True if the first and lastname are required at the Payment form

Delete Product

Example Request

curl https://paypro.nl/post_api
  -d "apikey=YOUR_API_KEY"
  -d "command=delete_product"
  -d "params={\"product_id\":\"12345\"}"
require 'paypro'

client = PayPro::Client.new('YOUR_API_KEY')
client.command = 'delete_product'
client.params = {
  product_id: 12345
}

response = client.execute
require('vendor/autoload.php');

$client = new \PayPro\Client("YOUR_API_KEY");
$client->setCommand("delete_product");
$client->setParam("product_id", 12345);

$response = $client->execute();
from paypro import Client

client = Client('YOUR_API_KEY')
client.setCommand('delete_product')
client.set_param('product_id', 12345)

response = client.execute()

Example Response

"true"

Deletes an existing Product object from the PayPro system.

Command

delete_product

Parameters

Parameter Type Description
product_id
Required
integer ID of the Product to delete.

Refunds

Refunds are a way for the merchant to pay back a customer. With these API calls you can create refunds for already existing payments.

Create Refund

Example Request

curl https://paypro.nl/post_api
  -d "apikey=YOUR_API_KEY"
  -d "command=refund"
  -d "params={\"sale_id\":12345,\"sequence_no\":1,\"amount\":100}"
require 'paypro'

client = PayPro::Client.new('YOUR_API_KEY')
client.command = 'refund'
client.params = {
  sale_id: 12345,
  sequence_no: 1,
  amount: 1234
}

response = client.execute
require('vendor/autoload.php');

$client = new \PayPro\Client("YOUR_API_KEY");
$client->setCommand("refund");
$client->setParams(array(
  "sale_id" => 12345,
  "sequence_no" => 1,
  "amount" => 1234,
));

$response = $client->execute();
from paypro import Client

client = Client('YOUR_API_KEY')
client.setCommand('refund')
client.setParams({
    'sale_id': 12345,
    'sequence_no': 1,
    'amount': 1234,
})

response = client.execute()

Example Response

"successfully_requested"

Creates a refund for an already existing payment.

Command

refund

Parameters

Parameter Type Description
sale_id
Required
integer ID of the sale you want the refund to apply to.
sequence_number integer Number of the installment you want to refund. For single payments you can omit this parameter.
Default: 1
amount integer A postive integer in cents representing the amount to be refunded. This can be less than the payment amount, but never higher. Format in cents: € 24.99 should be 2499
Default: payment amount

Invoices

Invoice objects for Payment objects.

Create Invoice

Example Request

curl https://paypro.nl/post_api
  -d "apikey=YOUR_API_KEY"
  -d "command=create_invoice"
  -d "params={\"amount\":\"1234\",\"consumer_email\":\"test@paypro.nl\",\"consumer_postal\":\"9711AP\",\"consumer_address\":\"Emmaplein 1\",\"consumer_country\":\"Nederland\",\"consumer_city\":\"Groningen\",\"invoicemethod\":\"instant\"}"
require('vendor/autoload.php');

$client = new \PayPro\Client("YOUR_API_KEY");
$client->setCommand("create_invoice");
$client->setParams(array(
  "amount" => 1234,
  "consumer_address" => "Emmaplein 1",
  "consumer_city" => "Groningen",
  "consumer_country" => "Nederland",
  "consumer_email" => "test@paypro.nl",
  "consumer_postal" => "9711AP",
  "invoicemethod" => "instant"
));

$response = $client->execute();
from paypro import Client

client = Client('YOUR_API_KEY')
client.setCommand('create_invoice')
client.setParams({
    'amount': 1234,
    'consumer_address': 'Emmaplein 1',
    'consumer_city': 'Groningen',
    'consumer_country': 'Nederland',
    'consumer_email': 'test@paypro.nl',
    'consumer_postal': '9711AP',
    'invoicemethod': 'instant',

response = client.execute()
require 'paypro'

client = PayPro::Client.new('YOUR_API_KEY')
client.command = 'create_invoice'
client.params = {
  amount: 1234,
  consumer_address: 'Emmaplein 1',
  consumer_city: 'Groningen',
  consumer_country: 'Nederland',
  consumer_email: 'test@paypro.nl',
  consumer_postal: '9711AP',
  invoicemethod: 'instant'
}

response = client.execute

Example Response

{
  "sale_id":1579245,
  "payment_url":"https://www.paypro.nl/betalen/9ec798f54e55791342b19ef6bf8151177135cf5b",
  "payment_hash":"9ec798f54e55791342b19ef6bf8151177135cf5b"
}

Creates a new Invoice in the PayPro system.

Command

create_invoice

Parameters

Parameter Type Description
amount
Required
integer A postive integer in cents representing the amount to be paid. Format in cents: € 24.99 should be 2499
consumer_address
Required
string Street address of the consumer. Will be used for information on the consumerpage and invoice. Also used with fulfilment integrations.
consumer_city
Required
string City where the consumer lives. Will be used for information on the consumerpage and invoice. Also used with fulfilment integrations.
consumer_country
Required
string Country where the consumer lives. Will be used for information on the consumerpage and invoice. Also used with fulfilment integrations.
consumer_email
Required
string Emailaddress of the consumer. Payment information and other emails will be send to this address. This field is mandatory for a payment and failing to supply it will redirect the consumer to the payment page.
consumer_postal
Required
string Postal of the consumer. Will be used for information on the consumerpage and invoice. Also used with fulfilment integrations.
invoicemethod
Required
string Sets the invoice method for the payment. Must be any of instant, per_period and disabled.
affiliate_amount integer A positive integer in cents representing the affiliate commission. Format in cents: € 24.99 should be 2499
amount_n integer A postive integer in cents representing the amount to be paid for every next period (amount is always used for the first period). Format in cents: € 24.99 should be 2499
approve_machtiging string Can be set if the user approves with a direct debit request. If not supplied, but trying to do a direct debit will result in a redirect to the payment page.
Allowed values: true, false (as string)
consumer_accountno string IBAN number of the consumer. This IBAN will be used to do SEPA Direct Debits and recurring payments.
consumer_companyname string Name of the company of the consumer. Will be used for information on the consumerpage and invoice.
consumer_name string Name of the consumer. Acts as the lastname if consumer_firstname is also set. Will be used for information on the consumerpage and invoice.
consumer_phone string Phonenumber of the consumer. Will be used for information on the consumerpage and invoice.
consumer_vatnumber string VAT number of the consumer. This VAT will be used in the invoices and can result in not having to pay any VAT if the VAT is valid and the consumer and merchant are from different EU countries.
custom string Custom field that is free to use for the merchant. Can be used to send additional information or tracking codes.
description string Description of the payment. Will be shown to the customer on the issuers page.
periods_frequency integer How many periods this invoice has in total. 0 when subscription, 1 when one-time payment, or a fixed number of periods. Required when recurring.
periods_multiplier integer Interval when a new invoice must be made. For example, when every month 1 new invoice must be made, set periods_multiplier to 1 and periods_type to month. Required when recurring.
periods_type string Type of the periods. Must be any of day, week, month or year. Required when recurring.
postback_url string URL for the PayPro postbacks. On every status change of the payment this URL will be called.
remarks string Remarks to be shown on the consumerpage.
return_url string URL of the redirect after the customer completed the payment. If empty it will try the return url of the product or else stays on a PayPro page.
vat integer A positive integer representing the VAT percentage of this payment.
Default: 21

Subscriptions

Subscriptions are payments that are recurring. PayPro has serveral API commands to handle subscriptions. To create subscriptions, please check create_product_payment.

Pause Subscription

Example Request

curl https://paypro.nl/post_api
  -d "apikey=YOUR_API_KEY"
  -d "command=pause_subscription"
  -d "params={\"sale_id\":12345678}"
require 'paypro'

client = PayPro::Client.new('YOUR_API_KEY')
client.command = 'pause_subscription'
client.params {
  sale_id: 12345678
}
require('vendor/autoload.php');

$client = new \PayPro\Client("YOUR_API_KEY");
$client->setCommand("pause_subscription");
$client->setParams(array(
  "sale_id" => 12345678,
));

$response = $client->execute();
from paypro import Client

client = Client('YOUR_API_KEY')
client.setCommand('pause_subscription')
client.setParams({
    'sale_id': 12345678
})

response = client.execute()

Example Response

"Paused sale I-12345678"

Pauses an existing subscription.

Command

pause_subscription

Parameters

Parameter Type Description
sale_id
Required
integer ID of the subscription you want to pause.

Resume Subscription

Example Request

curl https://paypro.nl/post_api
  -d "apikey=YOUR_API_KEY"
  -d "command=resume_subscription"
  -d "params={\"sale_id\":12345678}"
require 'paypro'

client = PayPro::Client.new('YOUR_API_KEY')
client.command = 'resume_subscription'
client.params {
  sale_id: 12345678
}
require('vendor/autoload.php');

$client = new \PayPro\Client("YOUR_API_KEY");
$client->setCommand("resume_subscription");
$client->setParams(array(
  "sale_id" => 12345678,
));

$response = $client->execute();
from paypro import Client

client = Client('YOUR_API_KEY')
client.setCommand('resume_subscription')
client.setParams({
    'sale_id': 12345678
})

response = client.execute()

Example Response

"Resumed sale I-12345678"

Resumes a paused subscription.

Command

resume_subscription

Parameters

Parameter Type Description
sale_id
Required
integer ID of the subscription you want to resume.

Cancel Subscription

Example Request

curl https://paypro.nl/post_api
  -d "apikey=YOUR_API_KEY"
  -d "command=cancel_subscription"
  -d "params={\"sale_id\":12345678}"
require 'paypro'

client = PayPro::Client.new('YOUR_API_KEY')
client.command = 'cancel_subscription'
client.params {
  sale_id: 12345678
}
require('vendor/autoload.php');

$client = new \PayPro\Client("YOUR_API_KEY");
$client->setCommand("cancel_subscription");
$client->setParams(array(
  "sale_id" => 12345678,
));

$response = $client->execute();
from paypro import Client

client = Client('YOUR_API_KEY')
client.setCommand('cancel_subscription')
client.setParams({
    'sale_id': 12345678
})

response = client.execute()

Example Response

"Succesfully cancelled sale I-12345678"

Cancel and stop a subscription.

Command

cancel_subscription

Parameters

Parameter Type Description
sale_id
Required
integer ID of the subscription you want to cancel.

Discount Codes

This is a full list of Product Discount Code methods that can be used.

Get all Discount Codes for a Product

Example Request

curl https://paypro.nl/post_api
  -d "apikey=YOUR_API_KEY"
  -d "command=get_product_discount_codes"
  -d "params={\"product_id\":\"12345\"}"
require('vendor/autoload.php');

$client = new \PayPro\Client("YOUR_API_KEY");
$client->setCommand("get_product_discount_codes");
$client->setParam("product_id", 12345);

$response = $client->execute();
from paypro import Client

client = Client('YOUR_API_KEY')
client.setCommand('get_product_discount_codes')
client.setParam('product_id', 12345)

response = api.execute()
require 'paypro'

client = PayPro::Client.new('YOUR_API_KEY')
client.command = 'get_product_discount_codes'
client.params = {
  product_id: 12345
}

response = client.execute

Example Response

[
  {
    "valid_until": null,
    "allperiods": true,
    "valid_times": -1,
    "discount_percentage": 10,
    "started_from": "2012-12-12",
    "only_for_affiliates": false,
    "product_id": 12345,
    "valid_from": null,
    "active": true,
    "code": "1ABCD2",
    "discount_cents": 0
  }
]

Loads all discount codes for a Product object.

Command

get_product_discount_codes

Parameters

Parameter Type Description
product_id
Required
integer ID of the Product where to load the Discount Codes for.

Get Discount Code

Example Request

curl https://paypro.nl/post_api
  -d "apikey=YOUR_API_KEY"
  -d "command=get_product_discount_code"
  -d "params={\"product_id\":\"12345\",\"discount_code\":\"1ABCD2\"}"
require('vendor/autoload.php');

$client = new \PayPro\Client("YOUR_API_KEY");
$client->setCommand("get_product_discount_code");
$client->setParams(array(
  "product_id" => 12345,
  "discount_code" => "1ABCD2"
));

$response = $client->execute();
from paypro import Client

client = Client('YOUR_API_KEY')
client.setCommand('get_product_discount_code')
client.setParams({
    'product_id': 12345,
    'discount_code': '1ABCD2',
})

response = client.execute()
require 'paypro'

client = PayPro::Client.new('YOUR_API_KEY')
client.command = 'get_product_discount_code'
client.params = {
  product_id: 12345,
  discount_code: '1ABCD2'
}

response = client.execute

Example Response

[
  {
    "valid_until": null,
    "allperiods": true,
    "valid_times": -1,
    "discount_percentage": 10,
    "started_from": "2012-12-12",
    "only_for_affiliates": false,
    "product_id": 12345,
    "valid_from": null,
    "active": true,
    "code": "1ABCD2",
    "discount_cents": 0
  }
]

Loads all discount codes for a Product object.

Command

get_product_discount_code

Parameters

Parameter Type Description
product_id
Required
integer ID of the Product where the Discount Code belongs to.
discount_code
Required
string Discount Code to load.

Payment Methods

PayPro supports a wide variety of Payment Methods. You can make API requests to get all Payments Methods back from the system.

Get Payment Methods

Example Request

curl https://paypro.nl/post_api
  -d "apikey=YOUR_API_KEY"
  -d "command=get_all_pay_methods"
  -d "params={}"
require 'paypro'

client = PayPro::Client.new('YOUR_API_KEY')
client.command = 'get_all_pay_methods'

response = client.execute
require('vendor/autoload.php');

$client = new \PayPro\Client("YOUR_API_KEY");
$client->setCommand("get_all_pay_methods");

$response = $client->execute();
from paypro import Client

client = Client('YOUR_API_KEY')
client.setCommand('get_all_pay_methods')

response = client.execute()

Example Response

{
  "data": {
    "banktransfer": {
      "description": "SEPA Overboeking",
      "methods": [
        {
          "order": 1,
          "name": "SEPA Overboeking",
          "id": "banktransfer/sepa"
        }
      ],
      "order": 5
    },
    "bancontact": {
      "description": "Bancontact/MrCash",
      "methods": [
        {
          "order": 1,
          "name": "Bancontact/MrCash",
          "id": "bancontact/mrcash"
        }
      ],
      "order": 3
    },
    "ideal": {
      "description": "iDEAL",
      "methods": [
        {
          "order": 1,
          "name": "Rabobank",
          "id": "ideal/RABONL2U"
        },
        {
          "order": 2,
          "name": "ING",
          "id": "ideal/INGBNL2A"
        },
        {
          "order": 3,
          "name": "ABN AMRO",
          "id": "ideal/ABNANL2A"
        },
        {
          "order": 4,
          "name": "SNS Bank",
          "id": "ideal/SNSBNL2A"
        },
        {
          "order": 5,
          "name": "RegioBank",
          "id": "ideal/RBRBNL21"
        },
        {
          "order": 6,
          "name": "ASN Bank",
          "id": "ideal/ASNBNL21"
        },
        {
          "order": 7,
          "name": "Knab",
          "id": "ideal/KNABNL2H"
        },
        {
          "order": 8,
          "name": "Triodos Bank",
          "id": "ideal/TRIONL2U"
        },
        {
          "order": 9,
          "name": "van Lanschot",
          "id": "ideal/FVLBNL22"
        },
        {
          "order": 10,
          "name": "Bunq",
          "id": "ideal/BUNQNL2A"
        },
        {
          "order": 11,
          "name": "Moneyou",
          "id": "ideal/MOYONL21"
        }
      ],
      "order": 1
    },
    "sofort": {
      "description": "Sofort",
      "methods": [
        {
          "order": 1,
          "name": "Sofort",
          "id": "sofort/digital"
        },
        {
          "order": 2,
          "name": "Sofort",
          "id": "sofort/physical"
        }
      ],
      "order": 7
    },
    "afterpay": {
      "description": "Afterpay",
      "methods": [
        {
          "order": 1,
          "name":"Afterpay",
          "id": "afterpay/giro"
        }
      ],
      "order": 8
    },
    "creditcard": {
      "description": "Creditcard",
      "methods": [
        {
          "order": 1,
          "name": "Visa",
          "id": "creditcard/visa"
        },
        {
          "order": 2,
          "name": "Mastercard",
          "id": "creditcard/mastercard"
        }
      ],
      "order":6
    },
    "paypal": {
      "description": "PayPal",
      "methods": [
        {
          "order": 1,
          "name": "PayPal",
          "id": "paypal/direct"
        },
        {
          "order": 2,
          "name": "PayPal",
          "id": "paypal/recurring"
        }
      ],
      "order": 2
    },
    "directdebit": {
      "description": "SEPA Incasso",
      "methods": [
        {
          "order": 1,
          "name": "SEPA Eenmalige Machtiging",
          "id" : "directdebit/sepa-once"
        },
        {
          "order": 2,
          "name": "Sign2pay",
          "id": "directdebit/sign2pay"
        },
        {
          "order": 3,
          "name": "SEPA Doorlopende Machtiging",
          "id": "directdebit/sepa-recurring"
        }
      ],
      "order": 4
    }
  },
  "total": 8
}

Returns a list of all Payment Methods.

Command

get_all_pay_methods

Get Payment Methods for a Product

Example Request

curl https://paypro.nl/post_api
  -d "apikey=YOUR_API_KEY"
  -d "command=get_pay_methods"
  -d "params={\"product_id\": 1234}"
require 'paypro'

client = PayPro::Client.new('YOUR_API_KEY')
client.command = 'get_pay_methods'
client.params = {
  product_id: 1234
}

response = client.execute
require('vendor/autoload.php');

$client = new \PayPro\Client("YOUR_API_KEY");
$client->setCommand("get_all_pay_methods");
$client->setParam("product_id", 1234);

$response = $client->execute();
from paypro import Client

client = Client('YOUR_API_KEY')
client.setCommand('get_pay_methods')
client.setParam('product_id', 1234)

response = client.execute()

Example Response

{
  "data": {
    "bancontact": {
      "description": "Bancontact/MrCash",
      "methods": [
        {
          "order": 1,
          "name": "Bancontact/MrCash",
          "id": "bancontact/mrcash"
        }
      ],
      "order": 3
    },
    "ideal": {
      "description": "iDEAL",
      "methods": [
        {
          "order": 1,
          "name": "Rabobank",
          "id": "ideal/RABONL2U"
        },
        {
          "order": 2,
          "name": "ING",
          "id": "ideal/INGBNL2A"
        },
        {
          "order": 3,
          "name": "ABN AMRO",
          "id": "ideal/ABNANL2A"
        },
        {
          "order": 4,
          "name": "SNS Bank",
          "id": "ideal/SNSBNL2A"
        },
        {
          "order": 5,
          "name": "RegioBank",
          "id": "ideal/RBRBNL21"
        },
        {
          "order": 6,
          "name": "ASN Bank",
          "id": "ideal/ASNBNL21"
        },
        {
          "order": 7,
          "name": "Knab",
          "id": "ideal/KNABNL2H"
        },
        {
          "order": 8,
          "name": "Triodos Bank",
          "id": "ideal/TRIONL2U"
        },
        {
          "order": 9,
          "name": "van Lanschot",
          "id": "ideal/FVLBNL22"
        },
        {
          "order": 10,
          "name": "Bunq",
          "id": "ideal/BUNQNL2A"
        },
        {
          "order": 11,
          "name": "Moneyou",
          "id": "ideal/MOYONL21"
        }
      ],
      "order": 1
    },
    "sofort": {
      "description": "Sofort",
      "methods": [
        {
          "order": 1,
          "name": "Sofort",
          "id": "sofort/digital"
        },
        {
          "order": 2,
          "name": "Sofort",
          "id": "sofort/physical"
        }
      ],
      "order": 7
    }
  },
  "total": 3
}

Returns a list of Payment Methods enabled for a product.

Command

get_pay_methods

Parameters

Parameter Type Description
product_id
Required
integer ID of the product you want to get Payment Methods from.

List of Payment Methods

This is a list of all payment methods that can be used in the create_payment and create_product_payment commands. Some payment methods require additional parameters and / or an associated product.

Name Code Product Needed Note
Afterpay afterpay/giro False Requires to be enabled. See Guide for more information.
Bancontact bancontact/mistercash False
iDEAL - ABN AMRO ideal/ABNANL2A False
iDEAL - ASN Bank ideal/ASNBNL21 False
iDEAL - bunq ideal/BUNQNL2A False
iDEAL - ING ideal/INGBNL2A False
iDEAL - Knab ideal/KNABNL2H False
iDEAL - Moneyou ideal/MOYONL21 False
iDEAL - RegioBank ideal/RBRBNL21 False
iDEAL - SNS Bank ideal/SNSBNL2A False
iDEAL - Triodos Bank ideal/TRIONL2U False
iDEAL - van Lanschot ideal/FVLBNL22 False
Mastercard creditcard/mastercard False Requires to be enabled. See Guide for more information.
PayPal paypal/direct False
PayPal (recurring) paypal/recurring True Can only be used with create_product_payments and with recurring products.
SEPA Bank Transfer banktransfer/sepa False
SEPA Direct Debit directdebit/sepa-once False
SEPA Recurring Debits directdebit/sepa-recurring True Can onlt be used with create_product_payments and with recurring products.
Sofort (digital) sofort/digital True Can only be used with create_product_payment. This payment methods should be used when selling digital products.
Sofort (physical) sofort/physical True Can only be used with create_product_payment. This payment method should be used when selling physical products.
Visa creditcard/visa False Requires to be enabled. See Guide for more information.

Support

If you like additional information or need support with an integration the first place to look is at our Developer Docs and our Guides.

Can’t find your question or need additional support? Contact Support or let us call you back.