Centro de Ayuda de Dardo
Referencia

Promociones

Campañas puntuales sobre una tarjeta.

GET/api/v2/promotions

Authorization

ApiKeyAuth
X-API-Key<token>

In: header

Query Parameters

templateId?integer

Filter by template ID

active?boolean

Filter by active status

page?integer

Page number

Range1 <= value
Default1
itemsPerPage?integer

Items per page

Range1 <= value <= 1000
Default30

Response Body

application/json

curl -X GET "https://example.com/api/v2/promotions"
{  "responseId": "ed662de2-39c1-4e7d-a6bf-6980511adfaf",  "createdAt": "2019-08-24T14:15:22Z",  "code": 0,  "meta": {    "totalItems": 0,    "itemsPerPage": 0,    "currentPage": 0  },  "data": [    {      "customFields": [        {          "name": "string",          "value": "string",          "type": "string"        }      ],      "templates": [        0      ],      "pushes": {        "start": {          "enabled": true,          "plannedDate": "string",          "text": "string"        },        "end": {          "enabled": true,          "plannedDate": "string",          "text": "string"        }      },      "id": 0,      "name": "string",      "background": "string",      "description": "string",      "startDate": "string",      "endDate": "string",      "active": true,      "maxUsages": 0,      "maxGlobalRedemptions": 0,      "currentGlobalRedemptions": 0,      "currentRevenue": "string",      "createdAt": "string",      "updatedAt": "string"    }  ]}
POST/api/v2/promotions

Authorization

ApiKeyAuth
X-API-Key<token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v2/promotions" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "startDate": "string",    "endDate": "string",    "backgroundImageBase64": "string"  }'
{  "responseId": "ed662de2-39c1-4e7d-a6bf-6980511adfaf",  "createdAt": "2019-08-24T14:15:22Z",  "code": 0,  "data": {    "customFields": [      {        "name": "string",        "value": "string",        "type": "string"      }    ],    "templates": [      0    ],    "pushes": {      "start": {        "enabled": true,        "plannedDate": "string",        "text": "string"      },      "end": {        "enabled": true,        "plannedDate": "string",        "text": "string"      }    },    "id": 0,    "name": "string",    "background": "string",    "description": "string",    "startDate": "string",    "endDate": "string",    "active": true,    "maxUsages": 0,    "maxGlobalRedemptions": 0,    "currentGlobalRedemptions": 0,    "currentRevenue": "string",    "createdAt": "string",    "updatedAt": "string"  }}
GET/api/v2/promotions/{id}

Authorization

ApiKeyAuth
X-API-Key<token>

In: header

Path Parameters

id*string

Response Body

application/json

curl -X GET "https://example.com/api/v2/promotions/string"
{  "responseId": "ed662de2-39c1-4e7d-a6bf-6980511adfaf",  "createdAt": "2019-08-24T14:15:22Z",  "code": 0,  "data": {    "customFields": [      {        "name": "string",        "value": "string",        "type": "string"      }    ],    "templates": [      0    ],    "pushes": {      "start": {        "enabled": true,        "plannedDate": "string",        "text": "string"      },      "end": {        "enabled": true,        "plannedDate": "string",        "text": "string"      }    },    "id": 0,    "name": "string",    "background": "string",    "description": "string",    "startDate": "string",    "endDate": "string",    "active": true,    "maxUsages": 0,    "maxGlobalRedemptions": 0,    "currentGlobalRedemptions": 0,    "currentRevenue": "string",    "createdAt": "string",    "updatedAt": "string"  }}
PATCH/api/v2/promotions/{id}

Authorization

ApiKeyAuth
X-API-Key<token>

In: header

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

All fields are optional. Only sent fields are updated.

Response Body

application/json

curl -X PATCH "https://example.com/api/v2/promotions/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "responseId": "ed662de2-39c1-4e7d-a6bf-6980511adfaf",  "createdAt": "2019-08-24T14:15:22Z",  "code": 0,  "data": {    "customFields": [      {        "name": "string",        "value": "string",        "type": "string"      }    ],    "templates": [      0    ],    "pushes": {      "start": {        "enabled": true,        "plannedDate": "string",        "text": "string"      },      "end": {        "enabled": true,        "plannedDate": "string",        "text": "string"      }    },    "id": 0,    "name": "string",    "background": "string",    "description": "string",    "startDate": "string",    "endDate": "string",    "active": true,    "maxUsages": 0,    "maxGlobalRedemptions": 0,    "currentGlobalRedemptions": 0,    "currentRevenue": "string",    "createdAt": "string",    "updatedAt": "string"  }}
DELETE/api/v2/promotions/{id}

Authorization

ApiKeyAuth
X-API-Key<token>

In: header

Path Parameters

id*string

Response Body

application/json

curl -X DELETE "https://example.com/api/v2/promotions/string"
{  "responseId": "ed662de2-39c1-4e7d-a6bf-6980511adfaf",  "createdAt": "2019-08-24T14:15:22Z",  "code": 0,  "data": {    "id": 0  }}