API Collections for a customer
- Collection, POST /contracts/{contractNo}/collections This application allows the declaration of the amount collected from a sale.
Sandbox Model
Sample data model available for sandbox testing. Includes examples of allavailable cases with their corresponding input and output data:
Pagination
Not includes pagination.
Security
This API is secured with an OAuth server. You must to request a token before invoking any of its operations. To perform a token request you have to invoke the next endpoint:
https://api.cesce.es/sandbox/oauth2/v1/token
Passing the next data as formData parameters:
- grant_type: You have to set ‘password’ value
- client_id: The client_id of the app you subscribed to this API
- client_secret: The client_secret of the app you subscribed to this API
- scope: The required scope/s to invoke the operation (create, read, update, delete are valid values). You can set one o more at the same time (separated by spaces)
- username: Your username
- password: Your password
Then, you will receive an access_token that you have to include as a Authorization header (Bearer authentication)
Keep in mind you have to subscribe to the OAuth Product API to be able to perform a token request.
If you need more information about autentication features (timeout, refresh token, . . .), you can see more details in the Getting Started section in the following link:
Paths
/contracts/{contractNo}/collections
Create the amount collected from a sale.
This application allows the declaration of the amount collected from a sale.
OAuth flow for password credentials (Resource Owner Credentials)
Operation support contract.
Required fields to create the amount collected from a sale.
Created
Bad Request.
Unauthorized.
Forbidden.
Not Found.
Method Not Allowed.
Too Many Requests.
Internal Server Error.
Definitions
Schema with the entry data of a single amount collected rqeuest from a sale.
{
"type": "object",
"required": [
"client",
"sale",
"collectionData"
],
"properties": {
"client": {
"title": "ClientRequest",
"type": "object",
"description": "Client data request.",
"required": [
"languageCode"
],
"properties": {
"languageCode": {
"type": "string",
"description": "Language ISO CODE 3166-1 ALPHA-2",
"example": "ES"
}
},
"additionalProperties": false
},
"sale": {
"title": "SaleRequest",
"type": "object",
"description": "Sale data request.",
"properties": {
"saleCesceReferenceNo": {
"type": "string",
"description": "Cesce internal reference number that uniquely identifies the expiration.",
"example": "13245679"
},
"invoiceNo": {
"type": "string",
"description": "Sales invoice code.",
"example": "f20/22222"
},
"maturityDate": {
"type": "string",
"description": "Invoice due date.",
"example": "20200602"
}
},
"additionalProperties": false
},
"collectionData": {
"title": "CollectionDataRequest",
"type": "object",
"description": "Schema with the entry data of a single sale request",
"required": [
"amount",
"date"
],
"properties": {
"amount": {
"type": "string",
"description": "",
"example": "1234567,89"
},
"date": {
"type": "string",
"description": "",
"example": "20200602"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
Schema with the entry data of a single sale request
{
"type": "object",
"required": [
"error",
"saleData"
],
"properties": {
"error": {
"title": "ErrorResponse",
"type": "object",
"description": "Data relating to an error",
"required": [
"errorCode",
"errorDescription"
],
"properties": {
"errorCode": {
"type": "string",
"description": "Unique error code that can be identified and located for further details",
"example": "0"
},
"errorDescription": {
"description": "An error message that clarifies to the developer why the error may have occurred",
"type": "string",
"example": ""
}
},
"additionalProperties": false
},
"saleData": {
"title": "SaleResponse",
"type": "object",
"description": "Data repsonse relative to the sale",
"required": [
"countervalueAmount",
"collectedAmount"
],
"properties": {
"countervalueAmount": {
"type": "string",
"description": "Amount of the invoice in the contract currency",
"example": "1324567,89"
},
"collectedAmount": {
"description": "Total amount collected from the invoice. In the contract currency",
"type": "string",
"example": "1324567,89"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
Bad Request
{
"type": "object",
"properties": {
"error": {
"type": "object",
"description": "No Error",
"properties": {
"errorCode": {
"type": "string",
"example": "2"
},
"errorDescription": {
"type": "string",
"example": "SOME DATA IS MANDATORY TO IDENTIFY THE LIMIT"
}
}
}
},
"additionalProperties": false
}
Unauthorized
{
"type": "object",
"properties": {
"error": {
"type": "object",
"description": "Unauthorized",
"properties": {
"errorCode": {
"type": "string",
"example": "21"
},
"errorDescription": {
"type": "string",
"example": "Unauthorized"
}
}
}
},
"additionalProperties": false
}
Forbidden
{
"type": "object",
"properties": {
"error": {
"type": "object",
"description": "Forbidden",
"properties": {
"errorCode": {
"type": "string",
"example": "6"
},
"errorDescription": {
"type": "string",
"example": "You are not authorized to execute this operation"
}
},
"additionalProperties": false
}
}
}
Not Found
{
"type": "object",
"properties": {
"error": {
"type": "object",
"description": "Not Found",
"properties": {
"errorCode": {
"type": "string",
"example": "4"
},
"errorDescription": {
"type": "string",
"example": "API not found for requested URI"
}
}
}
},
"additionalProperties": false
}
Method Not Allowed
{
"type": "object",
"properties": {
"error": {
"type": "object",
"description": "Method Not Allowed",
"properties": {
"errorCode": {
"type": "string",
"example": "25"
},
"errorDescription": {
"type": "string",
"example": "Method Not Allowed"
}
}
}
},
"additionalProperties": false
}
Too Many Requests
{
"type": "object",
"properties": {
"error": {
"type": "object",
"description": "Too Many Requests",
"properties": {
"errorCode": {
"type": "string",
"example": "29"
},
"errorDescription": {
"type": "string",
"example": "Too Many Requests"
}
}
}
},
"additionalProperties": false
}
Service unavailable. Please, try again later
{
"type": "object",
"properties": {
"error": {
"type": "object",
"description": "Service unavailable. Please, try again later",
"properties": {
"errorCode": {
"type": "string",
"example": "3"
},
"errorDescription": {
"type": "string",
"example": "Service unavailable. Please, try again later"
}
}
}
},
"additionalProperties": false
}