Campaigns API

The API Campaigns allow you to manage the financing campaigns of your store.

Consult the documentation on the financing campaigns as a strategy to increase sales in your store.

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]
}
Parameter Type Required Description
name string yes Campaign name
start_date ISO 8601 yes Start date of the campaign
end_date ISO 8601 no End date of the campaign
interest decimal yes Interest discount rate
partial Boolean no Determines if the campaign applies to all products, false by default
num_instalments array no Number of instalments available for the campaign
min_order_amount decimal no Minimum shopping cart amount (order.total_amount) to which the campaign applies
max_order_amount decimal no Maximum 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"
}

Details

GET /me/campaigns/:campaignId HTTP/1.1
Accept: application/vnd.aplazame.v1+json
Authorization: Bearer api_private_key
Host: api.aplazame.com
Parameter Type Required Description
:merchantId hash yes id of the store to perform action with
:campaignId hash yes id of the campaign to perform action with

Response

HTTP/1.1 200 OK
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"
}
Parameter Type Description
id hash Hostname id,
name string Campaign name
start_date ISO 8601 Start date of the campaign
end_date ISO 8601 End date of the campaign
interest decimal Interest discount rate
partial Boolean Determines if the campaign applies to all products

Edit

PUT /me/campaigns/:campaignId 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]
}
Parameter Type Required Description
name string yes Campaign name
start_date ISO 8601 yes Start date of the campaign
end_date ISO 8601 no End date of the campaign
interest decimal yes Interest discount rate
partial Boolean no Determines if the campaign applies to all products, false by default
num_instalments array no Number of instalments available for the campaign

Response

HTTP/1.1 204 NO CONTENT
X-Aplazame-Media-Type: aplazame.v1

Partial edit

PATCH /me/campaigns/:campaignId HTTP/1.1
Accept: application/vnd.aplazame.v1+json
Authorization: Bearer api_private_key
Host: api.aplazame.com
Content-Type: application/json

{
  "start_date": "2016-06-22T00:00:00"
}
Parameter Type Required Description
:merchantId hash yes id of the store to perform action with
:campaignId hash yes id of the campaign to perform action with
HTTP/1.1 204 NO CONTENT
X-Aplazame-Media-Type: aplazame.v1
Parameter Type Required Description
--------- ---- -------- -----------
name string no Campaign name
start_date ISO 8601 no Start date of the campaign
end_date ISO 8601 no End date of the campaign
interest decimal no Interest discount rate
partial Boolean no Determines if the campaign applies to all products, false by default
num_instalments array no Number of instalments available for the campaign

Delete

DELETE /me/campaigns/:campaignId HTTP/1.1
Accept: application/vnd.aplazame.v1+json
Authorization: Bearer api_private_key
Host: api.aplazame.com

Response

HTTP/1.1 204 NO CONTENT
X-Aplazame-Media-Type: aplazame.v1

List

GET /me/campaigns?page=2 HTTP/1.1
Accept: application/vnd.aplazame.v1+json
Authorization: Bearer api_private_key
Host: api.aplazame.com

Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Aplazame-Media-Type: aplazame.v1

{
  "cursor": {
    "after": 3,
    "before": 1
  },
  "paging": {
    "count": 314,
    "next": "https://api.aplazame.com/me/campaigns?page=3",
    "previous": "https://api.aplazame.com/me/campaigns?page=1"
  },
  "results": [
  ]
}
Parameter Type Description
cursor object Pagination cursor object
paging object Pagination status
results collection List of campaigns