Skip to main content

Create

The type of campaign is determined by the partial parameter, it could be a full campaign that applies to all items in your store, or it could be a partial campaign that applies to specific items.

In the case of a partial campaign it is necessary to add the articles to which the financing campaign applies.

Learn how to manage the articles of a financing campaign.

POST /me/campaigns HTTP/1.1
Accept: application/vnd.aplazame.v1+json
Authorization: Bearer api_private_key
Host: api.aplazame.com
Content-Type: application/json
{
"name": "Summertime",
"start_date": "2016-06-01T00:00:00",
"end_date": "2016-08-31T23:59:59",
"interest": "2500",
"partial": true,
"num_instalments": [1, 2, 3, 5, 8]
}
ParameterTypeRequiredDescription
namestringYesCampaign name.
start_dateISO 8601YesStart date of the campaign.
end_dateISO 8601NoEnd date of the campaign.
interestdecimalYesInterest discount rate.
partialBooleanNoDetermines if the campaign applies to all products, false by default.
num_instalmentsarrayNoMinimum shopping cart amount (order.total_amount) to which the campaign applies.
min_order_amountdecimalNoMinimum shopping cart amount (order.total_amount) to which the campaign applies.
max_order_amountdecimalNoMaximum shopping cart amount (order.total_amount) to which the campaign applies.

Response

HTTP/1.1 201 CREATED
Content-Type: application/json
X-Aplazame-Media-Type: aplazame.v1
{
"id": "c994e03e42d24be7bf6e1fcbad3334c0",
"name": "Summertime",
"start_date": "2016-06-01T00:00:00",
"end_date": "2016-08-31T23:59:59",
"interest": 2500,
"partial": true,
"num_instalments": [1, 2, 3, 5, 8],
"created": "2016-03-10T11:08:57.265971"
}