Create preference
It is possible to create Preferences using the SDK below. For details on request parameters, check the Create preferences API.
preference_data = {
items: [
{
title: 'Blue shirt',
quantity: 10,
currency_id: 'BRL',
unit_price: 10
}
],
payer: {
email: 'john@yourdomain.com'
}
}
preference_response = sdk.preference.create(preference_data)
preference = preference_response[:response]