API Sales for a customer
Sale, POST /contracts/{contractNo}/sales This app allows the declaration of a sale.
Sales List, GET /contracts/{contractNo}/sales This app allows the consultation of sales by debtor and/or month of invoice.
Modify Sale, POST /contracts/{contractNo}/sale This app allows the modification of a sale.
Sale Consult, GET /contracts/{contractNo}/sale This app allows the consultation of a sale.
Subsidiaries List, GET /contracts/{contractNo}/subsidiaries This app allows the consultation of the internal code that Cesce grants to the affiliated members of the policy. Subsidiaries active at the time of the consultation.
Sandbox Model
Sample data model available for sandbox testing. Includes examples of allavailable cases with their corresponding input and output data:
Pagination
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}/sales
Create Sale
This app allows the declaration of a sale
OAuth flow password credentials (Resource Owner Credentials)
Policy or Contract number
Required fields to create sale
Created.
Bad Request.
Unauthorized.
Forbidden.
Not Found.
Method Not Allowed.
Too Many Requests.
Internal Server Error.
Returns a sales list
This app allows the consultation of sales by debtor and/or month of invoice
Includes pagination.
Initial search data in case of pagination. Empty on the first call. With the content of the output field for successive calls until the end of the data.
OAuth flow password credentials (Resource Owner Credentials)
Policy or Contract number
Language ISO CODE 3166-1 ALPHA-2
Initial search data in case of pagination.
Recent movements
Number of supplement of classification associated with the debtor
Code with which the client identifies to the debtor in his system of information
Year/month of invoice date
Situation Code of the sale
OK.
Bad Request.
Unauthorized.
Forbidden.
Not Found.
Method Not Allowed.
Too Many Requests.
Internal Server Error.
/contracts/{contractNo}/sale
Modify Sale
This app allows the modification of a sale.
OAuth flow password credentials (Resource Owner Credentials)
Policy or Contract number
Required fields to modify sale
Bad Request.
Unauthorized.
Forbidden.
Not Found.
Method Not Allowed.
Too Many Requests.
Internal Server Error.
Retrieve of a Sale
This app allows the consultation of a sale
OAuth flow password credentials (Resource Owner Credentials)
Policy or Contract number
Language ISO CODE 3166-1 ALPHA-2
Cesce internal reference number that uniquely identifies the expiration
Invoice code
Invoice due date
OK.
Bad Request.
Unauthorized.
Forbidden.
Not Found.
Method Not Allowed.
Too Many Requests.
Internal Server Error.
/contracts/{contractNo}/subsidiaries
Retrieve a list of the internal codes that Cesce grants to the affiliated members of the policy
This app allows the consultation of the internal code that Cesce grants to the affiliated members of the policy. Subsidiaries active at the time of the consultation
Includes pagination
Initial search data in case of pagination. Empty on the first call. With the content of the output field for successive calls until the end of the data.
OAuth flow password credentials (Resource Owner Credentials)
Policy or Contract number
Language ISO CODE 3166-1 ALPHA-2
Initial search data in case of pagination.
Bad Request.
Unauthorized.
Forbidden.
Not Found.
Method Not Allowed.
Too Many Requests.
Internal Server Error.
Definitions
Schema with the entry data of a single sale request
{
"type": "object",
"required": [
"client",
"generalData"
],
"properties": {
"client": {
"title": "ClientRequest",
"type": "object",
"description": "General request data",
"required": [
"languageCode"
],
"properties": {
"languageCode": {
"type": "string",
"description": "Language ISO CODE 3166-1 ALPHA-2",
"example": "ES"
}
},
"additionalProperties": false
},
"generalData": {
"title": "GeneralDataRequest",
"type": "object",
"description": "General request data",
"required": [
"invoiceNo",
"invoiceDate",
"maturityDate",
"currencyAmount"
],
"properties": {
"subsidiaryNo": {
"type": "string",
"description": "Internal number Cesce awarded to the subsidiary that owns the sale",
"example": "123"
},
"endorsementNo": {
"type": "string",
"description": "Number of supplement of classification associated with the debtor",
"example": "489147"
},
"customerReference": {
"type": "string",
"description": "Code with which the client identifies to the debtor in his system of information",
"example": "CLIENT-194"
},
"invoiceNo": {
"type": "string",
"description": "Invoice code",
"example": "afs4af978as4"
},
"invoiceDate": {
"type": "string",
"description": "Invoice date",
"example": "20200417"
},
"acquisitionDate": {
"type": "string",
"description": "Date acquisition of the bill",
"example": "20200417"
},
"maturityDate": {
"type": "string",
"description": "Date maturity of the bill",
"example": "20200417"
},
"currencyAmount": {
"type": "string",
"description": "Amount of bill",
"example": "123456789012345,15"
},
"currencyCode": {
"type": "string",
"description": "ISO code of the currency associated with declared amount",
"example": "EUR"
},
"taxCodeTransferor": {
"type": "string",
"description": "Assignor tax code",
"example": "ascacec"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
Schema with the response data of a single sale request
{
"type": "object",
"required": [
"generalData",
"error"
],
"properties": {
"error": {
"title": "ErrorResponse",
"description": "Data relating to an error",
"type": "object",
"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
},
"generalData": {
"title": "GeneralDataResponse",
"type": "object",
"description": "General request data",
"required": [
"statusCode",
"countervalueAmount",
"currencyContractCode",
"saleCesceReferenceNo",
"entryDate"
],
"properties": {
"statusCode": {
"type": "string",
"description": "Situation Code of the sale",
"example": "123"
},
"reasonStatusCode": {
"type": "string",
"description": "Situation Reason Code of the sale",
"example": "489"
},
"countervalueAmount": {
"type": "string",
"description": "Amount of the invoice in the contract currency",
"example": "123456789012345,15"
},
"currencyContractCode": {
"type": "string",
"description": "ISO currency code contract",
"example": "EUR"
},
"commercialRiskCoverPct": {
"type": "string",
"description": "Coverage percentage of Commercial Risk",
"example": "100,00"
},
"commercialRiskRate": {
"type": "string",
"description": "Premium rate applied to Commercial Risk",
"example": "123,78478"
},
"commercialRiskPremium": {
"type": "string",
"description": "Risk Accrual Premium Commercial",
"example": "123456789012345,15"
},
"politicalRiskCoverPct": {
"type": "string",
"description": "Coverage percentage of Political risk",
"example": "100,00"
},
"politicalRiskRate": {
"type": "string",
"description": "Premium rate applied to Political risk",
"example": "123,78478"
},
"politicalRiskPremium": {
"type": "string",
"description": "Premium earned by Political risk",
"example": "123456789012345,15"
},
"saleCesceReferenceNo": {
"type": "string",
"description": "Reference number internal Cesce that uniquely identifies the declared sale",
"example": "123456789012"
},
"entryDate": {
"type": "string",
"description": "Declaration date of the sale",
"example": "20200417"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
Schema with the response data of a single sale request
{
"type": "object",
"required": [
"error",
"generalData"
],
"properties": {
"error": {
"title": "ErrorResponse",
"description": "Data relating to an error",
"type": "object",
"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
},
"generalData": {
"title": "GeneralDataGetResponse",
"type": "object",
"description": "General request data",
"required": [
"statusCode",
"invoiceDate",
"maturityDate",
"entryDate",
"currencyAmount",
"countervalueAmount",
"currencyContractCode",
"saleCesceReferenceNo"
],
"properties": {
"statusCode": {
"type": "string",
"description": "Situation Code of the sale",
"example": "123"
},
"reasonStatusCode": {
"type": "string",
"description": "Situation Reason Code of the sale",
"example": "489"
},
"financeStatus": {
"type": "string",
"description": "Financing status code of the sale",
"example": "789"
},
"endorsementNo": {
"type": "string",
"description": "Debtor classification supplement number",
"example": "158781"
},
"customerReference": {
"type": "string",
"description": "Code with which the client identifies the debtor in its information system",
"example": "Ref/2/00002"
},
"taxCodeTransferor": {
"type": "string",
"description": "Assignor tax code",
"example": "B96578323"
},
"subsidiaryNo": {
"type": "string",
"description": "Cesce internal number granted to the subsidiary owning the sale",
"example": "3"
},
"invoiceNo": {
"type": "string",
"description": "Invoice code",
"example": "f20/22222"
},
"invoiceDate": {
"type": "string",
"description": "Invoice date",
"example": "20200505"
},
"acquisitionDate": {
"type": "string",
"description": "Invoice acquisition date",
"example": "20200505"
},
"maturityDate": {
"type": "string",
"description": "Invoice due date",
"example": "20200505"
},
"entryDate": {
"type": "string",
"description": "Date of declaration of sale",
"example": "20200505"
},
"currencyAmount": {
"type": "string",
"description": "Amount of the invoice in currency",
"example": "123456789012345,15"
},
"currencyCode": {
"type": "string",
"description": "ISO currency code of the sale",
"example": "EUR"
},
"countervalueAmount": {
"type": "string",
"description": "Amount of the invoice in the contract currency",
"example": "123456789012345,15"
},
"currencyContractCode": {
"type": "string",
"description": "ISO currency code contract",
"example": "EUR"
},
"collectedAmount": {
"type": "string",
"description": "Amount collected from the invoice. In the contract currency",
"example": "123456789012345,15"
},
"commercialRiskCoverPct": {
"type": "string",
"description": "Coverage percentage of Commercial Risk",
"example": "100,00"
},
"commercialRiskRate": {
"type": "string",
"description": "Premium rate applied to Commercial Risk",
"example": "123,78478"
},
"commercialRiskPremium": {
"type": "string",
"description": "Risk Accrual Premium Commercial",
"example": "123456789012345,15"
},
"politicalRiskCoverPct": {
"type": "string",
"description": "Coverage percentage of Political risk",
"example": "100,00"
},
"politicalRiskRate": {
"type": "string",
"description": "Premium rate applied to Political risk",
"example": "123,78478"
},
"politicalRiskPremium": {
"type": "string",
"description": "Premium earned by Political risk",
"example": "123456789012345,15"
},
"saleCesceReferenceNo": {
"type": "string",
"description": "Reference number internal Cesce that uniquely identifies the declared sale",
"example": "200000000002"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
Schema with the response data of a single sale request
{
"type": "object",
"required": [
"error",
"result"
],
"properties": {
"error": {
"title": "ErrorResponse",
"description": "Data relating to an error",
"type": "object",
"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
},
"paginationData": {
"title": "PaginationData",
"description": "Service pagination",
"type": "object",
"properties": {
"initialValue": {
"type": "string",
"description": "Initial search data in case of pagination.",
"example": "0"
}
},
"additionalProperties": false
},
"result": {
"type": "array",
"items": {
"title": "ResultListSalesResponse",
"type": "object",
"description": "General request data",
"required": [
"statusCode",
"invoiceDate",
"maturityDate",
"entryDate",
"currencyAmount",
"currencyCode",
"countervalueAmount",
"currencyContractCode",
"saleCesceReferenceNo"
],
"properties": {
"statusCode": {
"type": "string",
"description": "Situation Code of the sale",
"example": "5"
},
"reasonStatusCode": {
"type": "string",
"description": "Situation Reason Code of the sale",
"example": "0"
},
"financeStatus": {
"type": "string",
"description": "Financing status code of the sale",
"example": "0"
},
"endorsementNo": {
"type": "string",
"description": "Debtor classification supplement number",
"example": "2"
},
"customerReference": {
"type": "string",
"description": "Code with which the client identifies the debtor in its information system",
"example": "Ref/2/00002"
},
"cesceCode": {
"type": "string",
"description": "CESCE debtor code",
"example": "116220000"
},
"taxCodeTransferor": {
"type": "string",
"description": "Assignor tax code",
"example": "B96578323"
},
"subsidiaryNo": {
"type": "string",
"description": "Cesce internal number granted to the subsidiary owning the sale",
"example": "2"
},
"invoiceNo": {
"type": "string",
"description": "Invoice code",
"example": "f20/77777"
},
"invoiceDate": {
"type": "string",
"description": "Invoice date",
"example": "20200505"
},
"acquisitionDate": {
"type": "string",
"description": "Invoice acquisition date",
"example": "20200505"
},
"maturityDate": {
"type": "string",
"description": "Invoice due date",
"example": "20200505"
},
"entryDate": {
"type": "string",
"description": "Date of declaration of sale",
"example": "20200505"
},
"currencyAmount": {
"type": "string",
"description": "Amount of the invoice in currency",
"example": "123456789012345,15"
},
"currencyCode": {
"type": "string",
"description": "ISO currency code of the sale",
"example": "EUR"
},
"countervalueAmount": {
"type": "string",
"description": "Amount of the invoice in the contract currency",
"example": "123456789012345,15"
},
"currencyContractCode": {
"type": "string",
"description": "ISO currency code contract",
"example": "EUR"
},
"collectedAmount": {
"type": "string",
"description": "Amount collected from the invoice. In the contract currency",
"example": "123456789012345,15"
},
"commercialRiskCoverPct": {
"type": "string",
"description": "Coverage percentage of Commercial Risk",
"example": "100,00"
},
"commercialRiskRate": {
"type": "string",
"description": "Premium rate applied to Commercial Risk",
"example": "123,78478"
},
"commercialRiskPremium": {
"type": "string",
"description": "Risk Accrual Premium Commercial",
"example": "123456789012345,15"
},
"politicalRiskCoverPct": {
"type": "string",
"description": "Coverage percentage of Political risk",
"example": "100,00"
},
"politicalRiskRate": {
"type": "string",
"description": "Premium rate applied to Political risk",
"example": "123,78478"
},
"politicalRiskPremium": {
"type": "string",
"description": "Premium earned by Political risk",
"example": "123456789012345,15"
},
"saleCesceReferenceNo": {
"type": "string",
"description": "Reference number internal Cesce that uniquely identifies the declared sale",
"example": "123456789012"
},
"statusDate": {
"type": "string",
"example": "20200113"
}
},
"additionalProperties": false
}
}
}
}
Schema with the response data of a several subdsidiaries request
{
"type": "object",
"required": [
"error",
"paginationData",
"result"
],
"properties": {
"error": {
"title": "ErrorResponse",
"description": "Data relating to an error",
"type": "object",
"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
},
"paginationData": {
"title": "PaginationData",
"description": "Service pagination",
"type": "object",
"properties": {
"initialValue": {
"type": "string",
"description": "Initial search data in case of pagination.",
"example": "0"
}
},
"additionalProperties": false
},
"result": {
"type": "array",
"items": {
"title": "ResultListSubsidiariesResponse",
"type": "object",
"description": "General request data",
"required": [
"subsidiaryNo",
"subsidiaryName"
],
"properties": {
"subsidiaryNo": {
"type": "string",
"description": "Internal number Cesce awarded to the subsidiary that owns the sale",
"example": "1"
},
"subsidiaryName": {
"type": "string",
"description": "Branch name",
"example": "CUADROS ELECTRICOS RAMÓN SL"
}
},
"additionalProperties": false
}
}
}
}
Schema with the entry data of a sale modification request
{
"type": "object",
"required": [
"client",
"sale"
],
"properties": {
"client": {
"title": "ClientRequest",
"type": "object",
"description": "General request data",
"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 request data",
"properties": {
"saleCesceReferenceNo": {
"type": "string",
"description": "Cesce internal reference number that uniquely identifies maturity",
"example": "202222222222"
},
"invoiceNo": {
"type": "string",
"description": "Sales invoice code",
"example": "f19/11111111"
},
"maturityDate": {
"type": "string",
"description": "Invoice due date",
"example": "20200202"
}
},
"additionalProperties": false
},
"newData": {
"title": "NewDataRequest",
"type": "object",
"description": "New request data",
"properties": {
"endorsementNo": {
"type": "string",
"description": "Debtor classification supplement number",
"example": "2"
},
"customerReference": {
"type": "string",
"description": "Code with which the client identifies the debtor in its information system",
"example": "Ref/2/00002"
},
"invoiceNo": {
"type": "string",
"description": "Invoice code",
"example": "f20/22222"
},
"invoiceDate": {
"type": "string",
"description": "Invoice date",
"example": "20200202"
},
"acquisitionDate": {
"type": "string",
"description": "Invoice acquisition date",
"example": "20200202"
},
"maturityDate": {
"type": "string",
"description": "Invoice due date",
"example": "20200202"
},
"currencyAmount": {
"type": "string",
"description": "Invoice amount",
"example": "12345,99"
},
"currencyCode": {
"type": "string",
"description": "ISO code of the currency associated with the declared amount",
"example": "EUR"
},
"taxCodeTransferor": {
"type": "string",
"description": "Assignor tax code",
"example": "B96578323"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
Schema with the entry data of a sale modification response
{
"type": "object",
"required": [
"error",
"result"
],
"properties": {
"error": {
"title": "ErrorResponse",
"description": "Data relating to an error",
"type": "object",
"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
},
"result": {
"title": "ResultResponse",
"type": "object",
"required": [
"statusCode",
"countervalueAmount",
"currencyContractCode"
],
"description": "Result response data",
"properties": {
"statusCode": {
"type": "string",
"description": "Sale Status Code",
"example": "1"
},
"reasonStatusCode": {
"type": "string",
"description": "Reason Code of sale situation",
"example": "0"
},
"countervalueAmount": {
"type": "string",
"description": "Amount of the invoice in the contract currency",
"example": "12345,99"
},
"currencyContractCode": {
"type": "string",
"description": "ISO code of the contract currency",
"example": "EUR"
},
"commercialRiskCoverPct": {
"type": "string",
"description": "Commercial Risk coverage percentage",
"example": "95,00"
},
"commercialRiskRate": {
"type": "string",
"description": "Premium rate applied to Commercial Risk",
"example": "0,13752"
},
"commercialRiskPremium": {
"type": "string",
"description": "Premium accrued for Commercial Risk",
"example": "715,11"
},
"politicalRiskCoverPct": {
"type": "string",
"description": "Percentage of coverage of Political Risk",
"example": "95,00"
},
"politicalRiskRate": {
"type": "string",
"description": "Premium rate applied to Political Risk",
"example": "0,13752"
},
"politicalRiskPremium": {
"type": "string",
"description": "Premium accrued for Political Risk",
"example": "715,11"
}
},
"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
}