Back to top

MS Loyalty API

Bienvenido al API del MS de Lealtad, aquí encontrarás toda la información relacionada a los endpoints disponibles.

Autenticación

El API usa oAuth2 para la autenticación. Ciertas llamadas al API deben contener una autorización como se detalla abajo.

Authorization: Bearer API_KEY

Para obtener credenciales de acceso de tipo cliente (Grant cliente es adecuada para la autenticación de máquina a máquina.), y asi obtener el token correspondiente, usted puede ponerse en contacto con el equipo de desarrollo

Otra forma de autenticarse con el API es utilizar el token obtenido del Firebase Auth del MS de usuarios al momento de iniciar sesión.

Headers

Asegúrese de tener los siguientes encabezados de content type en cada solicitud:

Content-Type: application/json

Si está consumiendo el API desde un cliente frontend es necesario enviar el encabezado Platform con estos posibles valores: web, mobile, ios, android

Platform: web|mobile|ios|android

Errors

The API uses conventional HTTP response codes to indicate the success or failure of an API request. The table below contains a summary of the typical response codes:

Code Description
200 Everything is ok.
400 Valid data was given but the request has failed.
401 No valid API Key was given.
404 The request resource could not be found.
405 The method is not implemented
422 The payload has missing required parameters or invalid data was given.
429 Too many attempts.
500 Request failed due to an internal error.
503 API is offline for maintenance.

OAuth2 Token

Obtener token de acceso

Obtener token de acceso
POST/oauth/token

Este endpoint permite obtener el token de acceso para clientes OAuth2

Example URI

POST https://loyalty.dev.local/oauth/token
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "grant_type": "client_credentials",
  "client_id": 1,
  "client_secret": "ghVW0PVbKRRBCo8uRt..."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "grant_type": {
      "type": "string"
    },
    "client_id": {
      "type": "number"
    },
    "client_secret": {
      "type": "string"
    }
  },
  "required": [
    "grant_type",
    "client_id",
    "client_secret"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "token_type": "Bearer",
  "expires_in": 31536000,
  "access_token": "yJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6Ij..."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "token_type": {
      "type": "string"
    },
    "expires_in": {
      "type": "number"
    },
    "access_token": {
      "type": "string"
    }
  },
  "required": [
    "token_type",
    "expires_in",
    "access_token"
  ]
}

API de Reportes

Reportes

Reporte de puntos por tienda
GET/api/report/dailySummary/stores?startDate={startDate}&endDate={endDate}

Este endpoint permite obtener un reporte de puntos organizado por tienda y fecha.

Example URI

GET https://loyalty.dev.local/api/report/dailySummary/stores?startDate='2018&endDate='2018
URI Parameters
HideShow
startDate
string (required) Example: '2018

07-01’ (string, required)

endDate
string (required) Example: '2018

07-30’ (string, required)

Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer API_KEY
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "code": "200",
  "status": "success",
  "message": "Proceso exitoso",
  "data": [
    {
      "date": "2018-07-12",
      "week": 27,
      "store": "EL RECREO",
      "preregisteredPos": 0,
      "subscribedAfterPos": 0,
      "registeredApp": 0,
      "registeredWeb": 0,
      "referrals": 0,
      "pointEarnedOrders": 0,
      "pointEarnedCoupons": 15950,
      "pointEarnedBalance": 0,
      "pointRedeemed": 0,
      "pointExpired": 0,
      "pointReversedCoupon": 0,
      "pointReversedOrder": 0
    },
    {
      "date": "2018-07-12",
      "week": 27,
      "store": "EL RECREO",
      "preregisteredPos": 0,
      "subscribedAfterPos": 0,
      "registeredApp": 0,
      "registeredWeb": 0,
      "referrals": 0,
      "pointEarnedOrders": 0,
      "pointEarnedCoupons": 15950,
      "pointEarnedBalance": 0,
      "pointRedeemed": 0,
      "pointExpired": 0,
      "pointReversedCoupon": 0,
      "pointReversedOrder": 0
    },
    {
      "date": "2018-07-12",
      "week": 27,
      "store": "EL RECREO",
      "preregisteredPos": 0,
      "subscribedAfterPos": 0,
      "registeredApp": 0,
      "registeredWeb": 0,
      "referrals": 0,
      "pointEarnedOrders": 0,
      "pointEarnedCoupons": 15950,
      "pointEarnedBalance": 0,
      "pointRedeemed": 0,
      "pointExpired": 0,
      "pointReversedCoupon": 0,
      "pointReversedOrder": 0
    },
    {
      "date": "2018-07-12",
      "week": 27,
      "store": "EL RECREO",
      "preregisteredPos": 0,
      "subscribedAfterPos": 0,
      "registeredApp": 0,
      "registeredWeb": 0,
      "referrals": 0,
      "pointEarnedOrders": 0,
      "pointEarnedCoupons": 15950,
      "pointEarnedBalance": 0,
      "pointRedeemed": 0,
      "pointExpired": 0,
      "pointReversedCoupon": 0,
      "pointReversedOrder": 0
    }
  ],
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "data": {
      "type": "array"
    },
    "warning": {},
    "error": {}
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 422,
  "status": "error",
  "message": "Error de Validacion",
  "warning": {
    "code": "null",
    "field": "field_name",
    "value": "Error Description"
  },
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {
      "type": "object",
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "field": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      }
    },
    "error": {}
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 401,
  "status": "error",
  "message": "Unauthenticated",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  403
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 403,
  "status": "error",
  "message": "Forbidden",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 404,
  "status": "error",
  "message": "404 Not Found",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 500,
  "status": "error",
  "message": "Internal Server Error",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}

Reporte de puntos por productos
GET/api/report/dailySummary/products?startDate={startDate}&endDate={endDate}

Este endpoint permite obtener un reporte de puntos por productos organizado por tienda y fecha.

Example URI

GET https://loyalty.dev.local/api/report/dailySummary/products?startDate='2018&endDate='2018
URI Parameters
HideShow
startDate
string (required) Example: '2018

07-01’ (string, required)

endDate
string (required) Example: '2018

07-30’ (string, required)

Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer API_KEY
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "code": "200",
  "status": "success",
  "message": "Proceso exitoso",
  "data": [
    {
      "date": "2018-07-20",
      "week": 28,
      "store": "PLATAFORMA GUBERNAMENTAL",
      "codProduct": "3109",
      "numOrders": 20,
      "numProducts": 20,
      "pointRedeemed": 82,
      "pointEarnedOrders": 82,
      "pointEarnedCoupons": 0,
      "pointEarnedBalance": 0,
      "numRedeemed": 20
    },
    {
      "date": "2018-07-20",
      "week": 28,
      "store": "PLATAFORMA GUBERNAMENTAL",
      "codProduct": "3109",
      "numOrders": 20,
      "numProducts": 20,
      "pointRedeemed": 82,
      "pointEarnedOrders": 82,
      "pointEarnedCoupons": 0,
      "pointEarnedBalance": 0,
      "numRedeemed": 20
    },
    {
      "date": "2018-07-20",
      "week": 28,
      "store": "PLATAFORMA GUBERNAMENTAL",
      "codProduct": "3109",
      "numOrders": 20,
      "numProducts": 20,
      "pointRedeemed": 82,
      "pointEarnedOrders": 82,
      "pointEarnedCoupons": 0,
      "pointEarnedBalance": 0,
      "numRedeemed": 20
    },
    {
      "date": "2018-07-20",
      "week": 28,
      "store": "PLATAFORMA GUBERNAMENTAL",
      "codProduct": "3109",
      "numOrders": 20,
      "numProducts": 20,
      "pointRedeemed": 82,
      "pointEarnedOrders": 82,
      "pointEarnedCoupons": 0,
      "pointEarnedBalance": 0,
      "numRedeemed": 20
    }
  ],
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "data": {
      "type": "array"
    },
    "warning": {},
    "error": {}
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 422,
  "status": "error",
  "message": "Error de Validacion",
  "warning": {
    "code": "null",
    "field": "field_name",
    "value": "Error Description"
  },
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {
      "type": "object",
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "field": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      }
    },
    "error": {}
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 401,
  "status": "error",
  "message": "Unauthenticated",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  403
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 403,
  "status": "error",
  "message": "Forbidden",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 404,
  "status": "error",
  "message": "404 Not Found",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 500,
  "status": "error",
  "message": "Internal Server Error",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}

API de Transacciones

Transacciones

Crear transacción
POST/api/transaction

Este endpoint permite almacenar una transacción.

Example URI

POST https://loyalty.dev.local/api/transaction
Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer API_KEY
Body
{
  "type": "POINTS COUPON",
  "code": "Bienvenido",
  "externalId": "123",
  "expirationDate": "2018-06-03",
  "title": "Titulo",
  "description": "Beneficio de puntos por Bienvenida",
  "total": 100,
  "customer": {
    "externalId": "0100037894",
    "name": "Santiago",
    "data": {
      "vendorId": "1",
      "businessOwner": "2",
      "giftCardAmount": "4",
      "giftCardType": "MONETARY"
    }
  },
  "store": {
    "externalId": "1200037894",
    "name": "Centro"
  },
  "vendor": {
    "externalId": "1200015849",
    "name": "Vendor"
  },
  "checkbookId": "12240",
  "transferTransactionId": "5446"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "type": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "externalId": {
      "type": "string"
    },
    "expirationDate": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "total": {
      "type": "number"
    },
    "customer": {
      "type": "object",
      "properties": {
        "externalId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "data": {
          "type": "object",
          "properties": {
            "vendorId": {
              "type": "string"
            },
            "businessOwner": {
              "type": "string"
            },
            "giftCardAmount": {
              "type": "string"
            },
            "giftCardType": {
              "type": "string"
            }
          },
          "required": [
            "vendorId",
            "businessOwner",
            "giftCardAmount",
            "giftCardType"
          ]
        }
      },
      "required": [
        "externalId",
        "name",
        "data"
      ]
    },
    "store": {
      "type": "object",
      "properties": {
        "externalId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "vendor": {
      "type": "object",
      "properties": {
        "externalId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "checkbookId": {
      "type": "string"
    },
    "transferTransactionId": {
      "type": "string"
    }
  },
  "required": [
    "type",
    "description",
    "total",
    "customer"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "code": "200",
  "status": "success",
  "message": "OK",
  "data": {
    "id": "7860",
    "title": "Cupón",
    "description": "Beneficio de puntos por Bienvenida",
    "code": "Bienvenido",
    "external_entity_id": "Bienvenido",
    "type": "CREDIT",
    "total": "100",
    "created_at": "2018-08-03 12:44:56",
    "unit": {
      "id": "1",
      "name": "POINTS",
      "sign": "PTS"
    },
    "customer": {
      "id": "209",
      "externalId": "0100037894",
      "name": "Santiago",
      "totals": [
        {
          "id": "829",
          "total_amount": "250.00",
          "unit": {
            "id": "1",
            "name": "POINTS",
            "sign": "PTS"
          },
          "batch": "null",
          "set_name": "null"
        }
      ]
    },
    "store": "null"
  },
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "code": {
          "type": "string"
        },
        "external_entity_id": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "total": {
          "type": "string"
        },
        "created_at": {
          "type": "string"
        },
        "unit": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "sign": {
              "type": "string"
            }
          }
        },
        "customer": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "externalId": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "totals": {
              "type": "array"
            }
          }
        },
        "store": {
          "type": "string"
        }
      }
    },
    "warning": {},
    "error": {}
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 422,
  "status": "error",
  "message": "Error de Validacion",
  "warning": {
    "code": "null",
    "field": "field_name",
    "value": "Error Description"
  },
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {
      "type": "object",
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "field": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      }
    },
    "error": {}
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 401,
  "status": "error",
  "message": "Unauthenticated",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  403
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 403,
  "status": "error",
  "message": "Forbidden",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 404,
  "status": "error",
  "message": "404 Not Found",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 500,
  "status": "error",
  "message": "Internal Server Error",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}

Crear checkBook
POST/api/transaction/checkbook

Este endpoint permite almacenar un checkbook.

Example URI

POST https://loyalty.dev.local/api/transaction/checkbook
Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer API_KEY
Body
{
  "type": "POINTS ORDER",
  "customer": {
    "externalId": "0100037894",
    "name": "Santiago"
  },
  "code": "Bienvenido",
  "externalId": "123",
  "total": 100,
  "earnedRedeemed": 20,
  "store": {
    "externalId": "1200037894",
    "name": "Centro"
  },
  "title": "Titulo",
  "detail": {
    "name": "Twister",
    "externalId": "39535",
    "total": 10,
    "earnedRedeemed": 20
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "type": {
      "type": "string"
    },
    "customer": {
      "type": "object",
      "properties": {
        "externalId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "externalId",
        "name"
      ]
    },
    "code": {
      "type": "string"
    },
    "externalId": {
      "type": "string"
    },
    "total": {
      "type": "number"
    },
    "earnedRedeemed": {
      "type": "number"
    },
    "store": {
      "type": "object",
      "properties": {
        "externalId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "externalId",
        "name"
      ]
    },
    "title": {
      "type": "string"
    },
    "detail": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "externalId": {
          "type": "string"
        },
        "total": {
          "type": "number"
        },
        "earnedRedeemed": {
          "type": "number"
        }
      },
      "required": [
        "name",
        "externalId",
        "total"
      ]
    }
  },
  "required": [
    "type",
    "customer",
    "code",
    "externalId",
    "total",
    "store"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "code": "200",
  "status": "success",
  "message": "OK",
  "data": {
    "id": "7860",
    "title": "Cupón",
    "description": "Beneficio de puntos por Bienvenida",
    "code": "Bienvenido",
    "external_entity_id": "Bienvenido",
    "type": "CREDIT",
    "total": "100",
    "created_at": "2018-08-03 12:44:56",
    "unit": {
      "id": "1",
      "name": "POINTS",
      "sign": "PTS"
    },
    "customer": {
      "id": "209",
      "externalId": "0100037894",
      "name": "Santiago",
      "totals": [
        {
          "id": "829",
          "total_amount": "250.00",
          "unit": {
            "id": "1",
            "name": "POINTS",
            "sign": "PTS"
          },
          "batch": "null",
          "set_name": "null"
        }
      ]
    },
    "store": {
      "id": "7",
      "externalId": "1200037894",
      "name": "La Carolina"
    }
  },
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "code": {
          "type": "string"
        },
        "external_entity_id": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "total": {
          "type": "string"
        },
        "created_at": {
          "type": "string"
        },
        "unit": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "sign": {
              "type": "string"
            }
          }
        },
        "customer": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "externalId": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "totals": {
              "type": "array"
            }
          }
        },
        "store": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "externalId": {
              "type": "string"
            },
            "name": {
              "type": "string"
            }
          }
        }
      }
    },
    "warning": {},
    "error": {}
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 422,
  "status": "error",
  "message": "Error de Validacion",
  "warning": {
    "code": "null",
    "field": "field_name",
    "value": "Error Description"
  },
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {
      "type": "object",
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "field": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      }
    },
    "error": {}
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 401,
  "status": "error",
  "message": "Unauthenticated",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  403
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 403,
  "status": "error",
  "message": "Forbidden",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 404,
  "status": "error",
  "message": "404 Not Found",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 500,
  "status": "error",
  "message": "Internal Server Error",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}

Revertir Transacción
POST/api/transaction/reverse

Este endpoint permite revertir una transacción.

Example URI

POST https://loyalty.dev.local/api/transaction/reverse
Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer API_KEY
Body
{
  "type": "POINTS ORDER",
  "code": "Bienvenido"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "type": {
      "type": "string"
    },
    "code": {
      "type": "string"
    }
  },
  "required": [
    "type",
    "code"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "code": "200",
  "status": "success",
  "message": "OK",
  "data": {
    "id": "7866",
    "title": "Reverso de orden",
    "description": "La Carolina",
    "code": "BienvenidoDavid",
    "external_entity_id": "BienvenidoDavid",
    "type": "DEBIT",
    "total": "20.00",
    "created_at": "2018-08-06 12:18:15",
    "unit": {
      "id": "1",
      "name": "COINS",
      "sign": "$"
    },
    "customer": {
      "id": "209",
      "externalId": "0100037894",
      "name": "Santiago",
      "totals": [
        {
          "id": "829",
          "total_amount": "250.00",
          "unit": {
            "id": "1",
            "name": "COINS",
            "sign": "$"
          },
          "batch": "null",
          "set_name": "null"
        }
      ]
    },
    "store": {
      "id": "7",
      "externalId": "1200037894",
      "name": "La Carolina"
    }
  },
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "code": {
          "type": "string"
        },
        "external_entity_id": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "total": {
          "type": "string"
        },
        "created_at": {
          "type": "string"
        },
        "unit": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "sign": {
              "type": "string"
            }
          }
        },
        "customer": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "externalId": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "totals": {
              "type": "array"
            }
          }
        },
        "store": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "externalId": {
              "type": "string"
            },
            "name": {
              "type": "string"
            }
          }
        }
      }
    },
    "warning": {},
    "error": {}
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 422,
  "status": "error",
  "message": "Error de Validacion",
  "warning": {
    "code": "null",
    "field": "field_name",
    "value": "Error Description"
  },
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {
      "type": "object",
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "field": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      }
    },
    "error": {}
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 401,
  "status": "error",
  "message": "Unauthenticated",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  403
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 403,
  "status": "error",
  "message": "Forbidden",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 404,
  "status": "error",
  "message": "404 Not Found",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 500,
  "status": "error",
  "message": "Internal Server Error",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}

Revertir Transacciones
POST/api/transaction/reverseMany

Este endpoint permite revertir varias transacciones.

Example URI

POST https://loyalty.dev.local/api/transaction/reverseMany
Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer API_KEY
Body
{
  "type": "POINTS ORDER",
  "codes": [
    "Bienvenido3",
    "Bienvenido4"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "type": {
      "type": "string"
    },
    "codes": {
      "type": "array"
    }
  },
  "required": [
    "type",
    "codes"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "code": "200",
  "status": "success",
  "message": "OK",
  "data": [
    {
      "id": "7867",
      "title": "Reverso de orden",
      "description": "La Carolina",
      "code": "Bienvenido3",
      "external_entity_id": "Bienvenido3",
      "type": "DEBIT",
      "total": "20.00",
      "created_at": "2018-08-06 12:18:15",
      "unit": {
        "id": "1",
        "name": "COINS",
        "sign": "$"
      },
      "customer": {
        "id": "209",
        "externalId": "0100037894",
        "name": "Santiago",
        "totals": [
          {
            "id": "829",
            "total_amount": "250.00",
            "unit": {
              "id": "1",
              "name": "COINS",
              "sign": "$"
            },
            "batch": "null",
            "set_name": "null"
          }
        ]
      },
      "store": {
        "id": "7",
        "externalId": "1200037894",
        "name": "La Carolina"
      }
    },
    {
      "id": "7868",
      "title": "Reverso de orden",
      "description": "La Carolina",
      "code": "Bienvenido4",
      "external_entity_id": "Bienvenido4",
      "type": "DEBIT",
      "total": "20.00",
      "created_at": "2018-08-06 12:18:20",
      "unit": {
        "id": "1",
        "name": "COINS",
        "sign": "$"
      },
      "customer": {
        "id": "209",
        "externalId": "0100037894",
        "name": "Santiago",
        "totals": [
          {
            "id": "829",
            "total_amount": "250.00",
            "unit": {
              "id": "1",
              "name": "COINS",
              "sign": "$"
            },
            "batch": "null",
            "set_name": "null"
          }
        ]
      },
      "store": {
        "id": "7",
        "externalId": "1200037894",
        "name": "La Carolina"
      }
    }
  ],
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "data": {
      "type": "array"
    },
    "warning": {},
    "error": {}
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 422,
  "status": "error",
  "message": "Error de Validacion",
  "warning": {
    "code": "null",
    "field": "field_name",
    "value": "Error Description"
  },
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {
      "type": "object",
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "field": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      }
    },
    "error": {}
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 401,
  "status": "error",
  "message": "Unauthenticated",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  403
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 403,
  "status": "error",
  "message": "Forbidden",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 404,
  "status": "error",
  "message": "404 Not Found",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 500,
  "status": "error",
  "message": "Internal Server Error",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}

Transferir puntos
POST/api/transaction/transfer

Este endpoint permite transferir puntos de una cuenta a otra.

Example URI

POST https://loyalty.dev.local/api/transaction/transfer
Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer API_KEY
Body
{
  "type": "BALANCE TRANSFER DEBIT",
  "total": 1,
  "title": "Transferencia",
  "customerFrom": {
    "externalId": "1716583941",
    "name": "David"
  },
  "customerTo": {
    "externalId": "1716583941001",
    "name": "Santiago"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "type": {
      "type": "string"
    },
    "total": {
      "type": "number"
    },
    "title": {
      "type": "string"
    },
    "customerFrom": {
      "type": "object",
      "properties": {
        "externalId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "externalId",
        "name"
      ]
    },
    "customerTo": {
      "type": "object",
      "properties": {
        "externalId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "externalId",
        "name"
      ]
    }
  },
  "required": [
    "type",
    "total",
    "customerFrom",
    "customerTo"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "code": "200",
  "status": "success",
  "message": "OK",
  "data": {
    "from": {
      "id": "7873",
      "title": "Transferencia",
      "description": "Santiago",
      "code": "null",
      "external_entity_id": "null",
      "type": "DEBIT",
      "total": "1.00",
      "created_at": "2018-08-06 12:18:20",
      "unit": {
        "id": "1",
        "name": "POINTS",
        "sign": "PTS"
      },
      "customer": {
        "id": "209",
        "externalId": "0100037894",
        "name": "Santiago",
        "totals": [
          {
            "id": "829",
            "total_amount": "250.00",
            "unit": {
              "id": "1",
              "name": "COINS",
              "sign": "$"
            },
            "batch": "null",
            "set_name": "null"
          }
        ]
      },
      "store": "null"
    },
    "to": {
      "id": "7874",
      "title": "Transferencia",
      "description": "David",
      "code": "null",
      "external_entity_id": "null",
      "type": "DEBIT",
      "total": "1.00",
      "created_at": "2018-08-06 12:18:20",
      "unit": {
        "id": "1",
        "name": "POINTS",
        "sign": "PTS"
      },
      "customer": {
        "id": "209",
        "externalId": "0100037894",
        "name": "Santiago",
        "totals": [
          {
            "id": "829",
            "total_amount": "250.00",
            "unit": {
              "id": "1",
              "name": "COINS",
              "sign": "$"
            },
            "batch": "null",
            "set_name": "null"
          }
        ]
      },
      "store": "null"
    }
  },
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "data": {
      "type": "object",
      "properties": {
        "from": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "title": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "code": {
              "type": "string"
            },
            "external_entity_id": {
              "type": "string"
            },
            "type": {
              "type": "string"
            },
            "total": {
              "type": "string"
            },
            "created_at": {
              "type": "string"
            },
            "unit": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "sign": {
                  "type": "string"
                }
              }
            },
            "customer": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "externalId": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "totals": {
                  "type": "array"
                }
              }
            },
            "store": {
              "type": "string"
            }
          }
        },
        "to": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "title": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "code": {
              "type": "string"
            },
            "external_entity_id": {
              "type": "string"
            },
            "type": {
              "type": "string"
            },
            "total": {
              "type": "string"
            },
            "created_at": {
              "type": "string"
            },
            "unit": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "sign": {
                  "type": "string"
                }
              }
            },
            "customer": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "externalId": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "totals": {
                  "type": "array"
                }
              }
            },
            "store": {
              "type": "string"
            }
          }
        }
      }
    },
    "warning": {},
    "error": {}
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 422,
  "status": "error",
  "message": "Error de Validacion",
  "warning": {
    "code": "null",
    "field": "field_name",
    "value": "Error Description"
  },
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {
      "type": "object",
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "field": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      }
    },
    "error": {}
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 401,
  "status": "error",
  "message": "Unauthenticated",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  403
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 403,
  "status": "error",
  "message": "Forbidden",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 404,
  "status": "error",
  "message": "404 Not Found",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 500,
  "status": "error",
  "message": "Internal Server Error",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}

Redimir voucher
POST/api/transaction/redeemFullBalance

Este endpoint permite redimir un voucher y almacenar un checkbook.

Example URI

POST https://loyalty.dev.local/api/transaction/redeemFullBalance
Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer API_KEY
Body
{
  "type": "POINTS ORDER",
  "customer": {
    "externalId": "0100037894",
    "name": "0100037894"
  },
  "code": "Bienvenido",
  "externalId": "123",
  "total": 100,
  "earnedRedeemed": 20,
  "store": {
    "externalId": "1200037894",
    "name": "Centro"
  },
  "title": "Titulo",
  "detail": {
    "name": "Twister",
    "externalId": "39535",
    "total": 10,
    "earnedRedeemed": 20
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "type": {
      "type": "string"
    },
    "customer": {
      "type": "object",
      "properties": {
        "externalId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "externalId",
        "name"
      ]
    },
    "code": {
      "type": "string"
    },
    "externalId": {
      "type": "string"
    },
    "total": {
      "type": "number"
    },
    "earnedRedeemed": {
      "type": "number"
    },
    "store": {
      "type": "object",
      "properties": {
        "externalId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "externalId",
        "name"
      ]
    },
    "title": {
      "type": "string"
    },
    "detail": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "externalId": {
          "type": "string"
        },
        "total": {
          "type": "number"
        },
        "earnedRedeemed": {
          "type": "number"
        }
      },
      "required": [
        "name",
        "externalId",
        "total"
      ]
    }
  },
  "required": [
    "type",
    "customer",
    "code",
    "externalId",
    "total",
    "store"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "code": "200",
  "status": "success",
  "message": "OK",
  "data": {
    "id": "209",
    "externalId": "0100037894",
    "name": "0100037894",
    "totals": [
      {
        "id": "829",
        "total_amount": "250.00",
        "unit": {
          "id": "1",
          "name": "POINTS",
          "sign": "PTS"
        },
        "batch": "null",
        "set_name": "null"
      }
    ]
  },
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "externalId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "totals": {
          "type": "array"
        }
      }
    },
    "warning": {},
    "error": {}
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 422,
  "status": "error",
  "message": "Error de Validacion",
  "warning": {
    "code": "null",
    "field": "field_name",
    "value": "Error Description"
  },
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {
      "type": "object",
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "field": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      }
    },
    "error": {}
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 401,
  "status": "error",
  "message": "Unauthenticated",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  403
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 403,
  "status": "error",
  "message": "Forbidden",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 404,
  "status": "error",
  "message": "404 Not Found",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 500,
  "status": "error",
  "message": "Internal Server Error",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}

Obtener Transacciones
GET/api/transaction/history?customerId={customerId}&page={page}

Este endpoint devuelve las transacciones del cliente .

Example URI

GET https://loyalty.dev.local/api/transaction/history?customerId='1716583941'&page='2'
URI Parameters
HideShow
customerId
number (required) Example: '1716583941'
page
number (required) Example: '2'
Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer API_KEY
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "data": [
    {
      "id": "7874",
      "title": "Transferencia",
      "description": "David",
      "code": "null",
      "external_entity_id": "null",
      "type": "DEBIT",
      "total": "1.00",
      "created_at": "2018-08-06 12:18:20",
      "unit": {
        "id": "1",
        "name": "POINTS",
        "sign": "PTS"
      },
      "customer": {
        "id": "209",
        "externalId": "0100037894",
        "name": "Santiago",
        "totals": [
          {
            "id": "829",
            "total_amount": "250.00",
            "unit": {
              "id": "1",
              "name": "COINS",
              "sign": "$"
            },
            "batch": "null",
            "set_name": "null"
          }
        ]
      },
      "store": "null"
    },
    {
      "id": "7874",
      "title": "Transferencia",
      "description": "David",
      "code": "null",
      "external_entity_id": "null",
      "type": "DEBIT",
      "total": "1.00",
      "created_at": "2018-08-06 12:18:20",
      "unit": {
        "id": "1",
        "name": "POINTS",
        "sign": "PTS"
      },
      "customer": {
        "id": "209",
        "externalId": "0100037894",
        "name": "Santiago",
        "totals": [
          {
            "id": "829",
            "total_amount": "250.00",
            "unit": {
              "id": "1",
              "name": "COINS",
              "sign": "$"
            },
            "batch": "null",
            "set_name": "null"
          }
        ]
      },
      "store": "null"
    },
    {
      "id": "7874",
      "title": "Transferencia",
      "description": "David",
      "code": "null",
      "external_entity_id": "null",
      "type": "DEBIT",
      "total": "1.00",
      "created_at": "2018-08-06 12:18:20",
      "unit": {
        "id": "1",
        "name": "POINTS",
        "sign": "PTS"
      },
      "customer": {
        "id": "209",
        "externalId": "0100037894",
        "name": "Santiago",
        "totals": [
          {
            "id": "829",
            "total_amount": "250.00",
            "unit": {
              "id": "1",
              "name": "COINS",
              "sign": "$"
            },
            "batch": "null",
            "set_name": "null"
          }
        ]
      },
      "store": "null"
    },
    {
      "id": "7874",
      "title": "Transferencia",
      "description": "David",
      "code": "null",
      "external_entity_id": "null",
      "type": "DEBIT",
      "total": "1.00",
      "created_at": "2018-08-06 12:18:20",
      "unit": {
        "id": "1",
        "name": "POINTS",
        "sign": "PTS"
      },
      "customer": {
        "id": "209",
        "externalId": "0100037894",
        "name": "Santiago",
        "totals": [
          {
            "id": "829",
            "total_amount": "250.00",
            "unit": {
              "id": "1",
              "name": "COINS",
              "sign": "$"
            },
            "batch": "null",
            "set_name": "null"
          }
        ]
      },
      "store": "null"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "array"
    }
  }
}

Obtener transacción por código
GET/api/transaction/transactionByCode?code={code}&type={type}

Este endpoint permite obtener una tranbsacción por el código.

Example URI

GET https://loyalty.dev.local/api/transaction/transactionByCode?code='Bienvenido732'&type='POINTS COUPON'
URI Parameters
HideShow
code
string (required) Example: 'Bienvenido732'
type
string (required) Example: 'POINTS COUPON'
Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer API_KEY
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "code": "200",
  "status": "success",
  "message": "OK",
  "data": [
    {
      "id": "7860",
      "title": "Cupón",
      "description": "Beneficio de puntos por Bienvenida",
      "code": "Bienvenido",
      "external_entity_id": "Bienvenido",
      "type": "CREDIT",
      "total": "100",
      "created_at": "2018-08-03 12:44:56",
      "unit": {
        "id": "1",
        "name": "POINTS",
        "sign": "PTS"
      },
      "customer": {
        "id": "209",
        "externalId": "0100037894",
        "name": "Santiago",
        "totals": [
          {
            "id": "829",
            "total_amount": "250.00",
            "unit": {
              "id": "1",
              "name": "POINTS",
              "sign": "PTS"
            },
            "batch": "null",
            "set_name": "null"
          }
        ]
      },
      "store": "null"
    }
  ],
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "data": {
      "type": "array"
    },
    "warning": {},
    "error": {}
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 422,
  "status": "error",
  "message": "Error de Validacion",
  "warning": {
    "code": "null",
    "field": "field_name",
    "value": "Error Description"
  },
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {
      "type": "object",
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "field": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      }
    },
    "error": {}
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 401,
  "status": "error",
  "message": "Unauthenticated",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  403
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 403,
  "status": "error",
  "message": "Forbidden",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 404,
  "status": "error",
  "message": "404 Not Found",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 500,
  "status": "error",
  "message": "Internal Server Error",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}

Obtener transacción de recargas por cliente
GET/api/transaction/reloadsByCustomer?document={document}&from={from}&to={to}

Este endpoint permite obtener una tranbsacción por el documento del cliente y un rango de fechas .

Example URI

GET https://loyalty.dev.local/api/transaction/reloadsByCustomer?document='0401591714'&from='2018&to='2018
URI Parameters
HideShow
document
string (required) Example: '0401591714'
from
string (required) Example: '2018

09-03’ (string, required)

to
string (required) Example: '2018

09-30’ (string, required)

Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer API_KEY
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "code": "200",
  "status": "success",
  "message": "OK",
  "data": [
    {
      "id": "7860",
      "title": "Cupón",
      "description": "Beneficio de puntos por Bienvenida",
      "code": "Bienvenido",
      "external_entity_id": "Bienvenido",
      "type": "CREDIT",
      "total": "100",
      "created_at": "2018-08-03 12:44:56",
      "unit": {
        "id": "1",
        "name": "POINTS",
        "sign": "PTS"
      },
      "customer": {
        "id": "209",
        "externalId": "0100037894",
        "name": "Santiago",
        "totals": [
          {
            "id": "829",
            "total_amount": "250.00",
            "unit": {
              "id": "1",
              "name": "POINTS",
              "sign": "PTS"
            },
            "batch": "null",
            "set_name": "null"
          }
        ]
      },
      "store": "null"
    }
  ],
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "data": {
      "type": "array"
    },
    "warning": {},
    "error": {}
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 422,
  "status": "error",
  "message": "Error de Validacion",
  "warning": {
    "code": "null",
    "field": "field_name",
    "value": "Error Description"
  },
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {
      "type": "object",
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "field": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      }
    },
    "error": {}
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 401,
  "status": "error",
  "message": "Unauthenticated",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  403
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 403,
  "status": "error",
  "message": "Forbidden",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 404,
  "status": "error",
  "message": "404 Not Found",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 500,
  "status": "error",
  "message": "Internal Server Error",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}

Obtener transacción de puntos por cliente
GET/api/transaction/pointsByCustomer?document={document}&from={from}&to={to}

Este endpoint permite obtener una tranbsacción por el documento del cliente y un rango de fechas .

Example URI

GET https://loyalty.dev.local/api/transaction/pointsByCustomer?document='0401591714'&from='2018&to='2018
URI Parameters
HideShow
document
string (required) Example: '0401591714'
from
string (required) Example: '2018

09-03’ (string, required)

to
string (required) Example: '2018

09-30’ (string, required)

Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer API_KEY
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "code": "200",
  "status": "success",
  "message": "OK",
  "data": [
    {
      "id": "7860",
      "title": "Cupón",
      "description": "Beneficio de puntos por Bienvenida",
      "code": "Bienvenido",
      "external_entity_id": "Bienvenido",
      "type": "CREDIT",
      "total": "100",
      "created_at": "2018-08-03 12:44:56",
      "unit": {
        "id": "1",
        "name": "POINTS",
        "sign": "PTS"
      },
      "customer": {
        "id": "209",
        "externalId": "0100037894",
        "name": "Santiago",
        "totals": [
          {
            "id": "829",
            "total_amount": "250.00",
            "unit": {
              "id": "1",
              "name": "POINTS",
              "sign": "PTS"
            },
            "batch": "null",
            "set_name": "null"
          }
        ]
      },
      "store": "null"
    }
  ],
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "data": {
      "type": "array"
    },
    "warning": {},
    "error": {}
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 422,
  "status": "error",
  "message": "Error de Validacion",
  "warning": {
    "code": "null",
    "field": "field_name",
    "value": "Error Description"
  },
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {
      "type": "object",
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "field": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      }
    },
    "error": {}
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 401,
  "status": "error",
  "message": "Unauthenticated",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  403
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 403,
  "status": "error",
  "message": "Forbidden",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 404,
  "status": "error",
  "message": "404 Not Found",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 500,
  "status": "error",
  "message": "Internal Server Error",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}

API de Lotes

Lotes

Obtener Lotes Activos
GET/api/batch/expiration?customerId={customerId}

Este endpoint devuelve lotes activos del cliente .

Example URI

GET https://loyalty.dev.local/api/batch/expiration?customerId='1716583941'
URI Parameters
HideShow
customerId
number (required) Example: '1716583941'
Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer API_KEY
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "data": [
    {
      "id": "3985",
      "total_amount": "460.00",
      "unit": {
        "id": "1",
        "name": "POINTS",
        "sign": "PTS"
      },
      "batch object": {
        "id": "143",
        "start_date": "null",
        "end_date": "null",
        "expiration_date": "2019-01-15 17:48:12"
      },
      "set_name": "PROMOCIONAL"
    },
    {
      "id": "3916",
      "total_amount": "00.00",
      "unit": {
        "id": "1",
        "name": "POINTS",
        "sign": "PTS"
      },
      "batch object": {
        "id": "3916",
        "start_date": "null",
        "end_date": "null",
        "expiration_date": "2019-01-15 17:48:12"
      },
      "set_name": "PROMOCIONAL"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "array"
    }
  }
}

API de Grupos

Grupos

Api de grupos
GET/api/group/default

Endpoint que retorna grupos

Example URI

GET https://loyalty.dev.local/api/group/default
Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer API_KEY
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "code": "200",
  "status": "success",
  "message": "Proceso exitoso",
  "data": {
    "id": "1",
    "name": "AMIGO",
    "description": "AMIGO",
    "group_rules": [
      {
        "id": "1",
        "name": "POINTS",
        "sign": "PTS"
      },
      {
        "id": "1",
        "name": "POINTS",
        "sign": "PTS"
      }
    ],
    "next_group": {
      "id": "2",
      "name": "BUEN AMIGO",
      "description": "BUEN AMIGO"
    }
  },
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "group_rules": {
          "type": "array"
        },
        "next_group": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "description": {
              "type": "string"
            }
          }
        }
      }
    },
    "warning": {},
    "error": {}
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 422,
  "status": "error",
  "message": "Error de Validacion",
  "warning": {
    "code": "null",
    "field": "field_name",
    "value": "Error Description"
  },
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {
      "type": "object",
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "field": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      }
    },
    "error": {}
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 401,
  "status": "error",
  "message": "Unauthenticated",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  403
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 403,
  "status": "error",
  "message": "Forbidden",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 404,
  "status": "error",
  "message": "404 Not Found",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 500,
  "status": "error",
  "message": "Internal Server Error",
  "warning": [],
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {},
    "error": {}
  }
}

API de Clientes

Clientes

Verificar si existe un cliente por su externalId
GET/api/customer/findByExternalId?externalId={externalId}

Este endpoint devuelve si un cliente existe según su externalId.

Example URI

GET https://loyalty.dev.local/api/customer/findByExternalId?externalId='w0vww4g1ek'
URI Parameters
HideShow
externalId
string (required) Example: 'w0vww4g1ek'
Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer API_KEY
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "code": "200",
  "status": "success",
  "message": "Ok",
  "data": {
    "exists": true,
    "id": 270,
    "external_id": "c991ijco5y",
    "name": "Santiago",
    "data": {
      "vendorId": 1,
      "giftCardType": "MONETARY",
      "businessOwner": 2,
      "giftCradAmount": 4
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "data": {
      "type": "object",
      "properties": {
        "exists": {
          "type": "boolean"
        },
        "id": {
          "type": "number"
        },
        "external_id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "data": {
          "type": "object",
          "properties": {
            "vendorId": {
              "type": "number"
            },
            "giftCardType": {
              "type": "string"
            },
            "businessOwner": {
              "type": "number"
            },
            "giftCradAmount": {
              "type": "number"
            }
          }
        }
      }
    }
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 422,
  "status": "error",
  "message": "Error de Validacion",
  "warning": {
    "code": "null",
    "field": "field_name",
    "value": "Error Description"
  },
  "error": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "warning": {
      "type": "object",
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "field": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      }
    },
    "error": {}
  }
}

Generated by aglio on 23 Sep 2019