Swile API (1.0)

Download OpenAPI specification:

Swile Integration API

WorkGroup

APIs related to creating, editing and manipulating WorkGroups.

Lists all WorkGroups

Will list all WorkGroups or filter it if using any of the possible query params. Paginated request.

Authorizations:
Bearer Authentication
query Parameters
workgroupName
string
branchDocument
string
page
required
integer <int32> >= 0
pageSize
required
integer <int32> [ 1 .. 100 ]

Responses

Response samples

Content type
application/json
{
  • "workgroups": [
    ],
  • "totalPages": 0,
  • "totalElements": 0,
  • "last": true
}

Create WorkGroup

Will create a new Workgroup with the received name and description

Authorizations:
Bearer Authentication
Request Body schema: application/json
required
name
required
string

Name of the new workgroup

description
required
string

Description of the new workgroup

document
string(^\d{2}.\d{3}.\d{3}/\d{4}-\d{2}$)

Document of the corporate where the workgroup will be created (if empty will create the workgroup attached to the logged account)

Responses

Request samples

Content type
application/json
{
  • "name": "Novo Grupo",
  • "description": "Grupo para colaboradores que fazem x",
  • "document": "11.111.111/0001-11"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string"
}

Employee

APIs related to creating, editing and manipulating Employees.

Updates Employee Status

Updates one or more employee status.

Authorizations:
Bearer Authentication
Request Body schema: application/json
required
status
required
string
Enum: "ACTIVE" "INACTIVE" "KEEP_ACTIVE"

The employee status that will be used

employeeIds
required
Array of integers <int64> [ items <int64 > ]

A list of the employee ids that will have the status changed

Responses

Request samples

Content type
application/json
{
  • "status": "ACTIVE",
  • "employeeIds": [
    ]
}

Response samples

Content type
application/json
{
  • "error": {
    },
  • "message": "Unable to list employees",
  • "details": "Not able to list employees for id 123"
}

Changes an employee pin code

Will change the employee pin code, given that the current one is correct and that this employee is from this corporate

Authorizations:
Bearer Authentication
path Parameters
employeeId
required
string
Example: 123

The Employee's Id

Request Body schema: application/json
required
currentPin
required
string = 4 characters

Employee's current pin code

newPin
required
string = 4 characters

Employee's new pin code

Responses

Request samples

Content type
application/json
{
  • "currentPin": "1234",
  • "newPin": "4321"
}

Response samples

Content type
application/json
{
  • "error": {
    },
  • "message": "Unable to list employees",
  • "details": "Not able to list employees for id 123"
}

Creates a new employee

With the necessary data for the employee, plus the workgroup, will create anew employee for the corporate.

Authorizations:
Bearer Authentication
Request Body schema: application/json
required
required
Array of objects (EmployeeRequest)

The list of employees do add in your corporate

Responses

Request samples

Content type
application/json
{
  • "employees": [
    ]
}

Response samples

Content type
application/json
{
  • "error": {
    },
  • "message": "Unable to list employees",
  • "details": "Not able to list employees for id 123"
}

Updates Employee data

Updates one or more employee data. Should only send the value that you want modified.

Authorizations:
Bearer Authentication
path Parameters
employeeId
required
integer <int64>
Request Body schema: application/json
required
idWorkGroup
integer <int64>

Id of workgroup where the employee will be added

name
string

Employee's name

email
string

Employee's email

phoneNumber
string^\(?\d{2}\)?[\s.-]?\d{4,5}[\s.-]?\d{4}$

Employee's phone number

document
string(^\d{3}\x2E\d{3}\x2E\d{3}\x2D\d{2}$)

Employee's document

externalId
string

An optional identifier you can set for this employee

birthDate
string <date>

Employee's birth date

Responses

Request samples

Content type
application/json
{
  • "idWorkGroup": 1,
  • "name": "João da Silva",
  • "email": "email@email.com",
  • "phoneNumber": "(99) 99999-9999",
  • "document": "111.111.111-11",
  • "externalId": "abc123",
  • "birthDate": "1990-01-01"
}

Response samples

Content type
application/json
{
  • "error": {
    },
  • "message": "Unable to list employees",
  • "details": "Not able to list employees for id 123"
}

Returns a list of all employees

Will return a list of all employees. Will filter the result using the optional parameters, if none are used will just return all data. Response is paginated.

Authorizations:
Bearer Authentication
query Parameters
required
object (FindAllEmployeesRequest)

Responses

Response samples

Content type
application/json
{
  • "employees": [
    ],
  • "totalPages": 0,
  • "totalElements": 0,
  • "last": true
}

Returns inactive employees

This API will return the inactive employees of a corporate. An inactive Employee is one that has not used their card for more than 90 days, but still has an 'ACTIVE' status. This is a pageable API that will return the requested employees page by page

Authorizations:
Bearer Authentication
query Parameters
page
required
string >= 0
Example: page=0

This is the page we are request

pageSize
required
string [ 1 .. 300 ]
Example: pageSize=100

This is the size of results in the page we want

Responses

Response samples

Content type
application/json
{
  • "employees": [
    ],
  • "totalPages": 0,
  • "totalElements": 0,
  • "last": true
}

Logistics

APIs related to creating, editing and manipulating card shipments.

Request a Card Delivery for Employees

Will request cards to be delivered for employees

Authorizations:
Bearer Authentication
Request Body schema: application/json
required
contactName
required
string

Name of the Employee Responsible for this Delivery

contactPhone
required
string^\(?\d{2}\)?[\s.-]?\d{4,5}[\s.-]?\d{4}$

Phone of the Employee Responsible for this Delivery

contactEmail
required
string

E-mail of the Employee Responsible for this Delivery

contactDocument
required
string(^\d{3}\x2E\d{3}\x2E\d{3}\x2D\d{2}$)

CPF of the Employee Responsible for this Delivery

contactDept
string [ 0 .. 64 ] characters

Department of the Employee Responsible for this Delivery

contactExternalId
string

External ID of the Employee Responsible for this Delivery

delivered
boolean

If this delivery should be created with status already delivered or not, defaults to false

required
Array of objects (CreateShipmentEmployeeItem) [ 1 .. 2000 ] items

The list of employees for the shipment

Responses

Request samples

Content type
application/json
{
  • "contactName": "Raquel Milena",
  • "contactPhone": "(99) 99999-9999",
  • "contactEmail": "email@email.com",
  • "contactDocument": "111.111.111-11",
  • "contactDept": "Recursos Humanos",
  • "contactExternalId": "abc123",
  • "delivered": false,
  • "employees": [
    ]
}

Response samples

Content type
application/json
{
  • "code": "string",
  • "origin": "string",
  • "type": "string",
  • "corporateId": 0,
  • "corporateDocument": "string",
  • "corporateName": "string",
  • "corporateSocialName": "string",
  • "branchId": 0,
  • "branchDocument": "string",
  • "branchName": "string",
  • "branchSocialName": "string",
  • "contactName": "string",
  • "contactPhone": "string",
  • "contactEmail": "string",
  • "contactDocument": "string",
  • "contactDept": "string",
  • "totalCardAmount": 0,
  • "status": "string",
  • "parcels": [
    ],
  • "createdTs": "string",
  • "updatedTs": "string"
}

Track Parcel

Will return information about a parcel given its code

Authorizations:
Bearer Authentication
path Parameters
code
required
string

Responses

Response samples

Content type
application/json
{
  • "code": "string",
  • "status": "string",
  • "recipientName": "string",
  • "recipientPhone": "string",
  • "recipientEmail": "string",
  • "recipientPostalCode": "string",
  • "recipientStreet": "string",
  • "recipientStreetNumber": "string",
  • "recipientNeighborhood": "string",
  • "recipientCity": "string",
  • "recipientState": "string",
  • "recipientComplement": "string",
  • "recipientDocument": "string",
  • "notifyRecipient": true,
  • "createdTs": "2019-08-24T14:15:22Z",
  • "updatedTs": "2019-08-24T14:15:22Z"
}

Wallet

APIs related to corporate Wallets.

Wallet Credit Balance

Will return the balance of credit for benefit and campaign for the logged user

Authorizations:
Bearer Authentication

Responses

Response samples

Content type
application/json
{
  • "benefit": 0,
  • "campaign": 0
}

Auth

APIs related to the service authentication and authorization.

Authenticates an user

Given an username and password using Basic Authentication, will return a JWT token that is necessary to use in all other APIs.

Authorizations:
Basic Authentication
header Parameters
Authorization
required
string

Responses

Response samples

Content type
application/json
{
  • "token": "string",
  • "issuedAt": "2019-08-24T14:15:22Z",
  • "expiresAt": "2019-08-24T14:15:22Z"
}

Order

APIs related to creating, editing and manipulating Order requests.

Creates a summary of an Order request

Creates a summary of an Order request, can be used for review, and returns the 'summaryId' field necessary to create the order

Authorizations:
Bearer Authentication
Request Body schema: application/json
required
required
Array of objects (OrderSummaryData)

The list of employees and the value to be requested for each type of card/wallet

Responses

Request samples

Content type
application/json
{
  • "data": [
    ]
}

Response samples

Content type
application/json
{
  • "orderGroupId": 0,
  • "orderGroupCode": "string",
  • "payerDocument": "string",
  • "payerName": "string",
  • "valueCredit": 0,
  • "valuePayment": 0,
  • "valueDiscount": 0,
  • "valueFee": 0,
  • "totalEmployees": 0,
  • "summaryId": "string",
  • "orders": [
    ]
}

Creates an Order asynchronously

Creates an Order. Since it is asynchronously, a confirmation is necessary, in this case find Order Status endpoint should be used.

Authorizations:
Bearer Authentication
Request Body schema: application/json
required
summaryId
required
string

The Summary ID related to the Order data

paymentMethod
required
string
Enum: "PIX" "BANK_SLIP" "WIRE_TRANSFER"

The payment method for the order

externalId
string

An optional external ID to make easier to link the order

creditDate
required
string <date-time>

Credit date, in which money will be transferred to employees

benefitPayerDocument
string

Branch document, if informed, the benefit orders will be grouped for that branch

campaignPayerDocument
string

Branch document, if informed, the campaign orders will be grouped for that branch

Array of objects (ExtraPaymentInfo)

Benefit extra payment information, used to inform swile credit and invoice text to specific order by document

Array of objects (ExtraPaymentInfo)

Campaign extra payment information, used to inform swile credit and invoice text to specific order by document

Responses

Request samples

Content type
application/json
{
  • "summaryId": "string",
  • "paymentMethod": "PIX",
  • "externalId": "string",
  • "creditDate": "2019-08-24T14:15:22Z",
  • "benefitPayerDocument": "string",
  • "campaignPayerDocument": "string",
  • "benefitPaymentInfo": [
    ],
  • "campaignPaymentInfo": [
    ]
}

Response samples

Content type
application/json
{
  • "summaryId": "string",
  • "orderGroupId": 0,
  • "orderGroupCode": "string",
  • "externalId": "string",
  • "status": "string",
  • "rejectReason": "string"
}

List Order Group

List Order Group with internal orders divided by branches

Authorizations:
Bearer Authentication
query Parameters
code
string
initialDate
string <date-time>
finalDate
string <date-time>
status
string
page
integer <int32> >= 0
size
integer <int32> [ 1 .. 100 ]

Responses

Response samples

Content type
application/json
{
  • "orderGroups": [
    ],
  • "totalPages": 0,
  • "totalElements": 0,
  • "last": true
}

Find Order Group Detailed

Returns the OrderGroup detailed with the inner Orders values

Authorizations:
Bearer Authentication
path Parameters
orderGroupCode
required
string

Responses

Response samples

Content type
application/json
{
  • "code": "string",
  • "creationDate": "2019-08-24T14:15:22Z",
  • "creditDate": "2019-08-24T14:15:22Z",
  • "totalEmployees": 0,
  • "statusCode": "string",
  • "orderList": [
    ]
}

Find Order Group Status

Returns the status of the OrderGroup. Recommended to use after asynchronous creation to know if it succeeded or failed.

Authorizations:
Bearer Authentication
path Parameters
orderGroupCode
required
string

Responses

Response samples

Content type
application/json
{
  • "summaryId": "string",
  • "orderGroupId": 0,
  • "orderGroupCode": "string",
  • "externalId": "string",
  • "status": "string",
  • "rejectReason": "string"
}