Methods/Services of the API
1 - CrearPieza (Creat Item)
Objective
This method is used to register an item in a logical way in Delivery (our system) and it returns a unique identifier of the created item in order to use it with this API’s following methods, even though the rest of the methods can be invoked through the client’s item number.
Unproductive URL: (customers will be informed in case this URL is modified)
https://www.ocageo.com.ar/OCAGEOAPITEST/CrearPieza
Productive URL: (customers will be informed in case this URL is modified)
https://www1.oca.com.ar/OCAGEOAPI/CrearPieza
Authentication:
It allows to generate an access token.
Table 1. Parameters to obtain Authentication Token:
Parameters | Type | Description |
---|---|---|
Grant Type | String | Password Credentials |
Access Token Productive URL | String | http://www1.oca.com.ar/OCAGEOAPI/login |
Access Token Unproductive URL | String | http://www.ocageo.com.ar/OCAGEOAPITEST/login |
Usarname | String | User Code previously created by OCA, e.g. DEMOAPI |
Password | String | User’s password. |
Client Authentication | String | Send Client credentials in Body |
Respuesta:
Status: 200 - json document containing token, etc.
{ "token_type": "bearer", "access_token": "string", "expires_in": integer ,(600 seg.) "scope": "string" }
Status: 400 - json document that may contain additional details about the Failure
Body Raw:
- Example Request
curl --location --request POST 'https://www1.oca.com.ar/OCAGEOAPI/CrearPieza' \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiIiwiVXNlcklEIjoiMzM2NzYiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3JvbGUiOiJDT05TVUxUQSIsIm5iZiI6MTYyOTc0ODI1OSwiZXhwIjoxNjI5NzQ4ODU5LCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjQwMjM3In0.sGi5WwPrMwkuWp0yfeUx5t32G8S95xqmsvKwdiujsMT5taOlD4KSiRPxvEW8hI9a0my4lBdcatZw8hNP58EmPA' \
--header 'Content-Type: application/json' \
--data-raw ' { "TypePieza": "1", "NumeroPieza": "3000500", "Cliente": "UKQZ", "Producto": "101199",
"SucursalCliente": "0", "SucursalOCA": "", "TypeDocumento": "DNI", "NumeroDocumento": "45648798",
"Apellido": "Gonzalez", "Nombre": "Speedy", "Sexo": "M", "Observaciones": "", "Calle": "La Rioja", "Numero":
"301", "Piso": "4", "Departamento": "yterte", "Torre": "", "Entrecalles": "", "CodigoPostal": "1214",
"Localidad": "Once", "Provincia": "Caba", "Telefono": "145464678", "TelefonoLaboral": "", "TelefonoCelular":
"12467891321", "Email": "", "FechaVisita": "", "CodigoRangoHorario": "1", "CodigoAccionAutomatica": "",
"VinculoConPaquete":"", "ClavePiezaCliente":"3545454", "DatosAdicionalesCliente":"LIMCRE## $40.000,00#$#LIMLARGO## $35.000,00#$#" }'
Table 2. Parameters to obtain the Request:
Parameters | Optional? | Description |
---|---|---|
TipoPieza | NO | Possible Values 1 = Individual item, 4=Component item |
NumeroPieza | NO | Customer’s Item Number |
Cliente | NO | Customer’s external code in OCA |
Producto | NO | It indicates the Product Code sent by the customer |
SucursalCliente | NO | Store code of the point of origin of the customer’s item |
SucursalOCA | YES | OCA Store acronym to be assigned directly to the item |
TipoDocumento | YES | Types of documents, e.g. ID, CUIT (Individual Taxpayer Identification Number), CUIL (Worker Identification Number),DU, PAS, LE, etc. |
NumeroDocumento | YES | ID Number |
Apellido | NO | Addressee’s last name |
Nombre | YES | Addressee’s first name |
Sexo | NO | Addressee’s gender |
Observaciones | YES | Any observation useful to clarify about the address, for instance. |
Calle | NO | Addressee’s street name address |
Número | YES | Addressee’s street number address |
Piso | YES | Addressee’s floor number address |
Departamento | YES | Addressee’s apartment number address |
Torre | YES | Addressee’s tower number address |
EntreCalles | YES | In between which streets the addressee’s address is located |
CodigoPostal | NO | Addressee’s Zip Code |
Localidad | NO | Addressee’s town |
Provincia | YES | Addressee’s province |
Telefono | YES | Addressee’s telephone number |
TelefonoLaboral | YES | Addressee’s work telephone number |
TelefonoCelular | YES | Addressee’s cellphone number |
YES | Addressee’s e-mail | |
CodigoRangoHorario | NO | Possible values 1=8:30 – 18:00,2=8:30-13,3=13-18 |
CodigoAccionAutomatica | YES | Possible values 19,17,32,36 |
VinculoConPaquete | YES | Item Number related to the component. |
ClavePiezaCliente | YES | This field is used by those customers who inform a Password or Code Uniqueness in order not to create repeated items in the System. |
DatosAdicionalesCliente | YES | This field informs any additional data in case the customer requires to send for any particular use, for example, LIMCRE## $40.000,00#$#LIMLARGO## $35.000,00#$# separated by TAGS (Nombre Etiqueta ## VALOR #$# ) |
- Example Response:
Status: 200 – OK (It returns the OCA’s Unique Identifier of the Item)
{ { "IdentificadorPieza": "G0785300120000000007", "Status": { "Codigo": 1, "Texto": "OK" } } }
Status: In case it is detected that the ClavePiezaCliente code is duplicated, it will return the following message
{ { "IdentificadorPieza": "G0785300120000000007", "Status": { "Codigo": 1, "Texto": "OK" } } }
Status: 401 - Unauthorized
Status: 500 - Internal Server Error
2 - EstadoActual (CurrentStatus)
Objective
This method is used to obtain the Current Status/Motive of an item at our system.
Unproductive URL: (customers will be informed in case this URL is modified)
https://www.ocageo.com.ar/OCAGEOAPITEST/EstadoActual
Productive URL: (customers will be informed in case this URL is modified)
https://www1.oca.com.ar/OCAGEOAPI/EstadoActual
Authentication:
It allows to generate an access token.
Table 3. Parameters to obtain the Authentication Token:
Parameters | Type | Description |
---|---|---|
Grant Type | String | Password Credentials |
Access Token Productive URL | String | http://www1.oca.com.ar/OCAGEOAPI/login |
Access Token Unproductive URL | String | http://www.ocageo.com.ar/OCAGEOAPITEST/login |
Username | String | User Code previously created by OCA, e.g.DEMOAPI |
Password | String | User’s password. |
Client Authentication | String | Send Client credentials in body |
Response:
Status: 200 - json document containing token, etc.
{ "token_type": "bearer", "access_token": "string", "expires_in": integer ,(600 seg.) "scope": "string" }
Status: 400 - json document that may contain additional details about the Failure
Body Raw:
- Example Request
curl --location --request POST 'http://www.ocageo.com.ar/OCAGEOAPI/EstadoActual' \ --header 'Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiIiwiVXNlcklEIjoiMzM2NzYiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3JvbGUiOiJDT05TVUxUQSIsIm5iZiI6MTYyOTc0ODI1OSwiZXhwIjoxNjI5NzQ4ODU5LCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjQwMjM3In0.sGi5WwPrMwkuWp0yfeUx5t32G8S95xqmsvKwdiujsMT5taOlD4KSiRPxvEW8hI9a0my4lBdcatZw8hNP58EmPA' \ --header 'Content-Type: application/json' \ --data-raw '{ "Producto":"", "NumeroPieza":"", "IdentificadorPieza": "G0785300120000000007", "IdPieza":0 }'
Table 4. Parameters to obtain the Request:
Parameters | Optional? | Description |
---|---|---|
Producto | YES | Indicates the Product Number sent by the customer |
Customer’s Item Number | ||
NumeroPieza | YES | OCA Item’s WEB tracking identification |
IdentificadorPieza | YES | Internal ID of the OCA Item |
IDPieza | YES |
- Example Response:
- Errors Codes:
Status: 200 – OK (It returns the OCA’s Unique Identifier of the Item)
Status: 401 - Unauthorized
Status: 500 - Internal Server Error
{ • "Piezas": [ { "NumeroPiezaCliente": "3280904", "FechaEstado": "07/09/2016 11:36:14", "Operativa": "105658-TARJETA VISA", "Producto": "310 -TARJETA VISA ", "Recibo": "50644356", "Carta": "", "FechaRendicion": "", "Cliente": "XXXX - BCO.XXXX S.A.", "Subservicio": "P3", "SucursalOCA": "MZA (MENDOZA)", "SucursalCliente": "0000000100", "IdPieza": 129693818, "Destinatario": "RAMIREZ VICTOR HUGO", "TipoPieza": "Individual", "FechaInclusion": "06/09/2016 07:08", "FechaEnvioCliente": "05/09/2016 21:26", "PlanillaEnvio": "", "FechaPlanillaEnvio": "", "EstadoMotivoOCA": "Enviada a Digitalizadora/Entregada", "CodigoEstadoCliente": "0", "EstadoCliente": "", "IDEstadoPiezaOCA": 203, "IDMotivoPiezaOCA": 99, "IdentificadorPiezaOCA": "G0000129693818", "CodigoProducto": "310", "EstadoWebOCA": "Entregado ", "CodigoEstadoWebOCA": 9, "CodigoEstadoMotivoUnificadoOCA": 99, "DescripcionEstadoMotivoUnificado": "Entregada" } ], "Status": { "Codigo": 1, "Texto": "OK" } }
Code | Message |
---|---|
1 | OK |
2 | No item was found |
3 | Blocked User |
4 | Nonexistent User |
5 | There is no profile assigned to this username |
6 | An Item Number, an Item Identifier, or an Idpieza to be looked up must be specified |
7 | The entered product does not exist |
8 | The Idpieza number does not exist |
9 | The Idpieza identifier does not exist |
10 | The item number does not exist |
3 - HistorialSeguimiento (TrackingHistory)
Objective
This method is used to obtain the tracking (Tracking History) of an Item.
Unproductive URL: (customers will be informed in case this URL is modified)
https://www.ocageo.com.ar/OCAGEOAPITEST/HistorialSeguimiento
Productive URL: (customers will be informed in case this URL is modified)
https://www1.oca.com.ar/OCAGEOAPI/HistorialSeguimiento
Authentication :
It allows to generate the access token.
Table 5. Parameters to obtain the Authentication Token:
Parameters | Type | Description |
---|---|---|
Grant Type | String | Password Credentials |
Access Token Productive URL | String | http://www1.oca.com.ar/OCAGEOAPI/login |
Access Token Unproductive URL | String | http://www.ocageo.com.ar/OCAGEOAPITEST/login |
Username | String | User Code previously created by OCA, e.g. DEMOAPI |
Password | String | User’s password. |
Client Authentication | String | Send Client credentials in Body |
Response:
Status: 200 - json document containing token, etc.
{ "token_type": "bearer", "access_token": "string", "expires_in": integer ,(600 seg.) "scope": "string" }
Status: 400 - json document that may contain additional details about the Failure
Body Raw :
-
Example Request
curl --location --request POST 'https://www1.oca.com.ar/OCAGEOAPI/HistorialSeguimiento' \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiIiwiVXNlcklEIjoiMzM2NzYiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3JvbGUiOiJDT05TVUxUQSIsIm5iZiI6MTYyOTc0ODI1OSwiZXhwIjoxNjI5NzQ4ODU5LCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjQwMjM3In0.sGi5WwPrMwkuWp0yfeUx5t32G8S95xqmsvKwdiujsMT5taOlD4KSiRPxvEW8hI9a0my4lBdcatZw8hNP58EmPA' \
--header 'Content-Type: application/json' \
--data-raw ' { "IdentificadorPieza":"G0785300120000000007", "IdPieza":0 }'
Table 6. Parameters for the Request: “One of the parameters must be specified”
Parameters | Optional? | Description |
---|---|---|
IdentificadorPieza | YES | OCA Item’s WEB tracking identification |
IDPieza | YES | Internal ID of OCA Item |
NumeroPieza | YES | Customer’s Item Number |
-
Example Response :
Status: 200 – OK (It returns the complete tracking information of an item or more than one item if two or more items found are the same when checking the customer’s item number)
Status: 401 - Unauthorized
Status: 500 - Internal Server Error
"Historiales": [ { "IdPieza": 129662194, "Historial": [ { "FechaEstadoSolicitud": "05/09/2016 19:05:07", "EstadoDescripcion": "Lógico Recibido", "MotivoDescripcion": "Sin Motivo", "Usuario": "Usuario para inclusión. TJN, SISTEMAS(SISTEMAS)", "FechaEjecucion": "", "Respuesta": "", "Motivo": "", "Tipo": "ESTADO", "IdEstadoPiezaOCA": 29, "IdMotivoPiezaOCA": 0, "CodigoEstadoWebOCA": 1, "EstadoWebOCA": "En proceso de Retiro", "CodigoEstadoMotivoUnificadoOCA": 10, "DescripcionEstadoMotivoUnificado": "Al Aguardo del Físico" }, { "FechaEstadoSolicitud": "06/09/2016 13:35:50", "EstadoDescripcion": "Fisico Recibido", "MotivoDescripcion": "Sin Motivo", "Usuario": "CARRERA, CHRISTIAN(999501)", "FechaEjecucion": "", "Respuesta": "", "Motivo": "", "Tipo": "ESTADO", "IdEstadoPiezaOCA": 42, "IdMotivoPiezaOCA": 0, "CodigoEstadoWebOCA": 3, "EstadoWebOCA": "En Proceso en OCA", "CodigoEstadoMotivoUnificadoOCA": 14, "DescripcionEstadoMotivoUnificado": "En Proceso en Plantas de OCA" }, { "FechaEstadoSolicitud": "06/09/2016 13:49:40", "EstadoDescripcion": "A Enviar a Sucursal Oca", "MotivoDescripcion": "Sin Motivo", "Usuario": "CARRERA, CHRISTIAN(999501)", "FechaEjecucion": "", "Respuesta": "", "Motivo": "", "Tipo": "ESTADO", "IdEstadoPiezaOCA": 43, "IdMotivoPiezaOCA": 0, "CodigoEstadoWebOCA": 3, "EstadoWebOCA": "En Proceso en OCA", "CodigoEstadoMotivoUnificadoOCA": 14, "DescripcionEstadoMotivoUnificado": "En Proceso en Plantas de OCA" }, { "FechaEstadoSolicitud": "06/09/2016 14:31:56", "EstadoDescripcion": "Despachada a Sucursal Oca", "MotivoDescripcion": "Sin Motivo", "Usuario": "CARRERA, CHRISTIAN(999501)", "FechaEjecucion": "", "Respuesta": "", "Motivo": "", "Tipo": "ESTADO", "IdEstadoPiezaOCA": 41, "IdMotivoPiezaOCA": 0, "CodigoEstadoWebOCA": 4, "EstadoWebOCA": "En viaje a Sucursal de Destino", "CodigoEstadoMotivoUnificadoOCA": 13, "DescripcionEstadoMotivoUnificado": "En viaje a Sucursal de Destino" }, { "FechaEstadoSolicitud": "07/09/2016 19:32:00", "EstadoDescripcion": "Recepcionada en Sucursal", "MotivoDescripcion": "Sin Motivo", "Usuario": "Sistema, Usuario(sistema)", "FechaEjecucion": "", "Respuesta": "", "Motivo": "", "Tipo": "ESTADO", "IdEstadoPiezaOCA": 38, "IdMotivoPiezaOCA": 0, "CodigoEstadoWebOCA": 5, "EstadoWebOCA": "Arribado a Sucursal de Destino", "CodigoEstadoMotivoUnificadoOCA": 12, "DescripcionEstadoMotivoUnificado": "Arribado a Sucursal de Destino" }, { "FechaEstadoSolicitud": "07/09/2016 19:32:00", "EstadoDescripcion": "Programación p/Despacho", "MotivoDescripcion": "Sin Motivo", "Usuario": "Sistema, Usuario(sistema)", "FechaEjecucion": "", "Respuesta": "", "Motivo": "", "Tipo": "ESTADO", "IdEstadoPiezaOCA": 8, "IdMotivoPiezaOCA": 0, "CodigoEstadoWebOCA": 6, "EstadoWebOCA": "Procesado en OCA", "CodigoEstadoMotivoUnificadoOCA": 1, "DescripcionEstadoMotivoUnificado": "En Distribución " }, { "FechaEstadoSolicitud": "07/09/2016 23:00:00", "EstadoDescripcion": "A Despachar a Calle", "MotivoDescripcion": "Sin Motivo", "Usuario": "Sistema, Usuario(sistema)", "FechaEjecucion": "", "Respuesta": "", "Motivo": "", "Tipo": "ESTADO", "IdEstadoPiezaOCA": 9, "IdMotivoPiezaOCA": 0, "CodigoEstadoWebOCA": 6, "EstadoWebOCA": "", "CodigoEstadoMotivoUnificadoOCA": 1, "DescripcionEstadoMotivoUnificado": "En Distribución " }, { "FechaEstadoSolicitud": "09/09/2016 08:31:00", "EstadoDescripcion": "A Despachar a Calle", "MotivoDescripcion": "Sin Motivo", "Usuario": "Sistema, Usuario(sistema)", "FechaEjecucion": "", "Respuesta": "", "Motivo": "", "Tipo": "ESTADO", "IdEstadoPiezaOCA": 9, "IdMotivoPiezaOCA": 0, "CodigoEstadoWebOCA": 6, "EstadoWebOCA": "", "CodigoEstadoMotivoUnificadoOCA": 1, "DescripcionEstadoMotivoUnificado": "En Distribución " }, { "FechaEstadoSolicitud": "09/09/2016 16:07:00", "EstadoDescripcion": "En Calle", "MotivoDescripcion": "Sin Motivo", "Usuario": "Sistema, Usuario(sistema)", "FechaEjecucion": "", "Respuesta": "", "Motivo": "", "Tipo": "ESTADO", "IdEstadoPiezaOCA": 45, "IdMotivoPiezaOCA": 0, "CodigoEstadoWebOCA": 7, "EstadoWebOCA": "Visita a Domicilio en Curso", "CodigoEstadoMotivoUnificadoOCA": 1, "DescripcionEstadoMotivoUnificado": "En Distribución " }, { "FechaEstadoSolicitud": "09/09/2016 16:11:00", "EstadoDescripcion": "Visita", "MotivoDescripcion": "Entregada", "Usuario": "Sistema, Usuario(sistema)", "FechaEjecucion": "", "Respuesta": "", "Motivo": "", "Tipo": "ESTADO", "IdEstadoPiezaOCA": 10, "IdMotivoPiezaOCA": 99, "CodigoEstadoWebOCA": 9, "EstadoWebOCA": "Entregado", "CodigoEstadoMotivoUnificadoOCA": 4, "DescripcionEstadoMotivoUnificado": "Visita:Entregada" }, { "FechaEstadoSolicitud": "09/09/2016 18:25:00", "EstadoDescripcion": "Tramitación Finalizada en Sucursal Oca", "MotivoDescripcion": "Entregada", "Usuario": "Sistema, Usuario(sistema)", "FechaEjecucion": "", "Respuesta": "", "Motivo": "", "Tipo": "ESTADO", "IdEstadoPiezaOCA": 11, "IdMotivoPiezaOCA": 99, "CodigoEstadoWebOCA": 9, "EstadoWebOCA": "Entregado ", "CodigoEstadoMotivoUnificadoOCA": 99, "DescripcionEstadoMotivoUnificado": "Entregada" }, { "FechaEstadoSolicitud": "09/09/2016 18:25:00", "EstadoDescripcion": "Enviada a Digitalizadora", "MotivoDescripcion": "Entregada", "Usuario": "Sistema, Usuario(sistema)", "FechaEjecucion": "", "Respuesta": "", "Motivo": "", "Tipo": "ESTADO", "IdEstadoPiezaOCA": 203, "IdMotivoPiezaOCA": 99, "CodigoEstadoWebOCA": 9, "EstadoWebOCA": "Entregado ", "CodigoEstadoMotivoUnificadoOCA": 99, "DescripcionEstadoMotivoUnificado": "Entregada" } ] }, { "IdPieza": 129693818, "Historial": [ "FechaEstadoSolicitud": "05/09/2016 19:05:07", "EstadoDescripcion": "Lógico Recibido", "MotivoDescripcion": "Sin Motivo", "Usuario": "Usuario para inclusión. TJN, SISTEMAS(SISTEMAS)", "FechaEjecucion": "", "Respuesta": "", "Motivo": "", "Tipo": "ESTADO", "IdEstadoPiezaOCA": 29, "IdMotivoPiezaOCA": 0, "CodigoEstadoWebOCA": 1, "EstadoWebOCA": "En proceso de Retiro", "CodigoEstadoMotivoUnificadoOCA": 10, "DescripcionEstadoMotivoUnificado": "Al Aguardo del Físico" }, { "FechaEstadoSolicitud": "06/09/2016 13:35:50", "EstadoDescripcion": "Fisico Recibido", "MotivoDescripcion": "Sin Motivo", "Usuario": "CARRERA, CHRISTIAN(999501)", "FechaEjecucion": "", "Respuesta": "", "Motivo": "", "Tipo": "ESTADO", "IdEstadoPiezaOCA": 42, "IdMotivoPiezaOCA": 0, "CodigoEstadoWebOCA": 3, "EstadoWebOCA": "En Proceso en OCA", "CodigoEstadoMotivoUnificadoOCA": 14, "DescripcionEstadoMotivoUnificado": "En Proceso en Plantas de OCA" }, { "FechaEstadoSolicitud": "06/09/2016 13:49:40", "EstadoDescripcion": "A Enviar a Sucursal Oca", "MotivoDescripcion": "Sin Motivo", "Usuario": "CARRERA, CHRISTIAN(999501)", "FechaEjecucion": "", "Respuesta": "", "Motivo": "", "Tipo": "ESTADO", "IdEstadoPiezaOCA": 43, "IdMotivoPiezaOCA": 0, "CodigoEstadoWebOCA": 3, "EstadoWebOCA": "En Proceso en OCA", "CodigoEstadoMotivoUnificadoOCA": 14, "DescripcionEstadoMotivoUnificado": "En Proceso en Plantas de OCA" }, { "FechaEstadoSolicitud": "19/08/2021 18:18:37", "EstadoDescripcion": "Rescatar", "MotivoDescripcion": "", "Usuario": UKSQ - Consulta x Web Services", "FechaEjecucion": "", "Respuesta": "Ingresada", "Motivo": "", "Tipo": "ACCION", "IdEstadoPiezaOCA": null, "IdMotivoPiezaOCA": null, "CodigoEstadoWebOCA": null, "EstadoWebOCA": "", "CodigoEstadoMotivoUnificadoOCA": null, "DescripcionEstadoMotivoUnificado": "" } ] } ], "Status": { "Codigo": 1, "Texto": "OK" } }
- Error Codes:
Code | Message |
---|---|
1 | OK |
2 | No item was found |
3 | Blocked User |
4 | Nonexistent User |
5 | There is no profile assigned to this username |
6 | An Item Number, an Item Identifier, or an Idpieza to be looked up must be specified |
7 | The entered product does not exist |
8 | The Idpieza number does not exist |
9 | The Idpieza identifier does not exist |
10 | The item number does not exist |
4- PiezasPorDocumento (ItemsPerDocument)
Objective
This method is used to obtain all the items in Distribution by the addressee’s ID number.
Unproductive URL: (customers will be informed in case this URL is modified)
https://www.ocageo.com.ar/OCAGEOAPITEST/PiezasPorDocumento
Productive URL: (customers will be informed in case this URL is modified)
https://www1.oca.com.ar/OCAGEOAPI/PiezasPorDocumento
Authentication :
It allows to generate an access token.
Table 7. Parameters to obtain the Access Token:
Parameters | Type | Description |
---|---|---|
Grant Type | String | Password Credentials |
Access Token Productive URL | String | http://www1.oca.com.ar/OCAGEOAPI/login |
Access Token Unproductive URL | String | http://www.ocageo.com.ar/OCAGEOAPITEST/login |
Username | String | User Code previously created by OCA, e.g. DEMOAPI |
Password | String | User’s password. |
Client Authentication | String | Send Client credentials in Body |
Response :
Status: 200 - json document containing token, etc.
{ "token_type": "bearer", "access_token": "string", "expires_in": integer ,(600 seg.) "scope": "string" }
Status: 400 - json document that may contain additional details about the Failure
Body Raw :
-
Example Request:
curl --location --request POST 'https://www1.oca.com.ar/OCAGEOAPI/PiezasPorDocumento' \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiIiwiVXNlcklEIjoiMzM2NzYiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3JvbGUiOiJDT05TVUxUQSIsIm5iZiI6MTYyOTc0ODI1OSwiZXhwIjoxNjI5NzQ4ODU5LCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjQwMjM3In0.sGi5WwPrMwkuWp0yfeUx5t32G8S95xqmsvKwdiujsMT5taOlD4KSiRPxvEW8hI9a0my4lBdcatZw8hNP58EmPA' \
--header 'Content-Type: application/json' \
--data-raw '{ "TipoDocumento":"", "NumeroDocumento":"20403624", "Producto":"", "Operativa":"","CantidadMeses":"2","EstadosNoTerminal":1 }'
Table 8. Parameters for the Request:
Parameters | Optional? | Description |
---|---|---|
TipoDocumento | YES | Types of documents, e.g. ID, CUIT (Individual Taxpayer Identification Number), CUIL (Worker Identification Number),DU, PAS, LE, etc. |
NumeroDocumento | NO | Addressee’s ID number |
Producto | YES | Customer’s Product Code |
Operativa | YES | Code of the Commercial Operation with OCA |
CantidadMeses | YES | Quantity of months of the date the item to be recovered was entered. If the parameter is not specified, the default will return whatever appears during the last 6 months. |
EstadosNoTerminal | YES | Set as a numerical value, with no quotation marks. Possible Values 1= It returns items on a NOT finalized status, 0= It returns items on all the status, finalized and not finalized status. |
-
Example Response :
Status: 200 – OK (It returns the Items corresponding to the Addressee’s ID number that are in Distribution at OCA)
Status: 401 - Unauthorized
Status: 500 - Internal Server Error
{ "Piezas": [ { "NumeroPieza": "0000000157895972", "Destinatario": "POLASTRO CARLOS FEDERICO", "Operativa": "03 DELV REEMPLAZA 23225", "IdPieza": 125518966, "FechaInclusion": "12/07/2016 07:09:03", "EstadoMotivoOCA": "Archivada/Entregada", "FechaEstado": "24/08/2016 00:00:00", "Producto": "VISAIN-Visa Internacional ", "CodigoEstadoCliente": "0", "EstadoCliente": "", "IdEstadoPiezaOCA": 17, "IdMotivoPiezaOCA": 99, "CodigoProducto": "VISAIN", "IdentificadorPiezaOCA": "G0000125518966", "CodigoEstadoWebOCA": 9, "EstadoWebOCA": "Entregado ", "CodigoEstadoMotivoUnificadoOCA": 99, "DescripcionEstadoMotivoUnificado": "Entregada" }, { "NumeroPieza": "4055160001954682", "Destinatario": "POLASTRO CARLOS FEDERICO", "Operativa": "Banelco Gral. ", "IdPieza": 124792851, "FechaInclusion": "01/07/2016 07:07:45", "EstadoMotivoOCA": "Visita/No Responde", "FechaEstado": "07/09/2016 14:54:00", "Producto": "VDBHRC- BANELCO GENERAL", "CodigoEstadoCliente": "0", "EstadoCliente": "", "IdEstadoPiezaOCA": 10, "IdMotivoPiezaOCA": 7, "CodigoProducto": "VDBHRC", "IdentificadorPiezaOCA": "G0000124792851", "CodigoEstadoWebOCA": 10, "EstadoWebOCA": "No entregado", "CodigoEstadoMotivoUnificadoOCA": 2, "DescripcionEstadoMotivoUnificado": "Visita: Imposible de Entregar" } ], "Status": { "Codigo": 1, "Texto": "Ok" } }
- Errors Codes:
Code | Message |
---|---|
1 | OK |
2 | No item was found |
3 | Blocked User |
4 | Nonexistent User |
7 | The entered product does not exist |
11 | The ID number parameter is mandatory |
12 | The ID number parameter must be valid |
5- IngresarAccion (EnterAction):
Objective
This method is used to enter any action (Retrieval at one branch store of the client, Rescheduled (change of address), redelivery with a rescheduled date and time, delivery at an OCA’s branch store, Destruction)). If the action is successfully executed, the item’s distribution circuit is modified.
Unproductive URL: (customers will be informed in case this URL is modified)
https://www.ocageo.com.ar/OCAGEOAPITEST/IngresarAccion
Productive URL: (customers will be informed in case this URL is modified)
https://www1.oca.com.ar/OCAGEOAPI/IngresarAccion
Authentication:
It allows to generate an access token.
Table 9. Parameters to obtain the Access Token:
Parameters | Type | Description |
---|---|---|
Grant Type | String | Password Credentials |
Access Token Productive URL | String | http://www1.oca.com.ar/OCAGEOAPI/login |
Access Token Unproductive URL | String | http://www.ocageo.com.ar/OCAGEOAPITEST/login |
Username | String | User Code previously created by OCA, e.g. DEMOAPI |
Password | String | User’s password. |
Client Authentication | String | Send Client credentials in Body |
Response:
Status: 200 - json document containing token, etc.
{ "token_type": "bearer", "access_token": "string", "expires_in": integer ,(600 seg.) "scope": "string" }
Status: 400 - json document that may contain additional details about the Failure
Body Raw:
- Example Request
curl --location --request POST 'https://www.ocageo.com.ar/OCAGEOAPI/IngresarAccion' \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiIiwiVXNlcklEIjoiMzM2NzYiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3JvbGUiOiJDT05TVUxUQSIsIm5iZiI6MTYyOTc0ODI1OSwiZXhwIjoxNjI5NzQ4ODU5LCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjQwMjM3In0.sGi5WwPrMwkuWp0yfeUx5t32G8S95xqmsvKwdiujsMT5taOlD4KSiRPxvEW8hI9a0my4lBdcatZw8hNP58EmPA' \
--header 'Content-Type: application/json' \
--data-raw
'{ "PiezasAcciones": [ { "Cliente": "XXX", "Producto": "103172", "NumeroPieza": "501042000032743011", "IdentificadorPieza": "", "IdPieza": "0", "IdAccion": "17", "FillerAccion": "Rescate Automatico Test" }, { "Cliente": "XXX", "Producto": "103172", "NumeroPieza": "501042000032743012", "IdentificadorPieza": "", "IdPieza": "0", "IdAccion": "18", "FillerAccion": "0000001234Rescate Automatico Test" } ], "CantidadAcciones": "2", "CancelaAccionPrevia": "true" }'
Table 10. Parameters for the Request: “One of the parameters, NumeroPieza, IdentificadorPieza or IdPieza, must be specified”
Parameters | Optional? | Description |
---|---|---|
Cliente | NO | Customer’s Code. |
Producto | NO | Customer’s Product’s Code |
NumeroPieza | YES | Customer’s Item Number |
IdentificadorPieza | YES | OCA Item identifier for WEB tracking |
IdPieza | YES | OCA Item’s Internal ID |
IdAccion | NO | Entry Action Code (Check the list with all the possible actions) |
FillerAccion | YES | Variable Filler according to the action that is required to be entered, it is a String with a fixed width. (Check additional data for each action) |
Possible Actions Code | Type | Long | Optional | Comments |
---|---|---|---|---|
17 – Retrieve at original store (Return to the customer) | ||||
Observations | Character | 100 | YES | |
18 - Retrieve (Return to the customer) | ||||
Customer’s Store | Character | 10 | NO | |
Observations | Character | 100 | YES | |
19 – Retrieve at Head Office (Return to the customer) | ||||
Observations | Character | 100 | YES | |
51 – Delivery at OCA Store | ||||
OCA Store Acronym | Character | 3 | NO | For example: BNO Store, Belgrano’s store acronym |
92 - Reschedule(Schedule a change of delivery address and new visiting time) | ||||
Street | Character | 50 | NO | The whole address can be indicated in this field |
Number | Character | 5 | YES | Fill in the blanks |
Tower | Character | 1 | YES | Fill in the blanks |
Floor | Character | 2 | YES | Fill in the blanks |
Apartment | Character | 4 | YES | Fill in the blanks |
Town | Character | 35 | NO | |
Province | Character | 20 | YES | Fill in the blanks |
Zip Code | Character | 8 | NO | 4 digits Zip Code e.g. 5000 |
Country | Character | 30 | YES | Fill in the blanks |
Telephone | Character | 30 | YES | Preferably, inform Cellphone number. Otherwise, fill in the blanks. |
Monday | Character | 1 | YES | Days of the week the delivery will be done if it is prescheduled. Otherwise, mark all the days with an "X" |
Tuesday | Character | 1 | YES | Days of the week the delivery will be done if it is prescheduled. Otherwise, mark all the days with an "X" |
Wednesday | Character | 1 | YES | Days of the week the delivery will be done if it is prescheduled. Otherwise, mark all the days with an "X" |
Thursday | Character | 1 | YES | Days of the week the delivery will be done if it is prescheduled. Otherwise, mark all the days with an "X" |
Friday | Character | 1 | YES | Days of the week the delivery will be done if it is prescheduled. Otherwise, mark all the days with an "X" |
Saturday | Character | 1 | YES | Days of the week the delivery will be done if it is prescheduled. Otherwise, mark all the days with an "X" |
Time From | Character | 5 | YES | Time when the delivery will be done. From 8 am to 6 pm. The time range between from and to must be at least of 4 hours. |
Time To | Character | 5 | YES | Time when the delivery will be done. From 8 am to 6 pm. The time range between from and to must be at least of 4 hours. |
Observations | Character | 100 | YES | |
Visiting Scheduled Date | Character | 10 | SI | The date of the visiting if it was scheduled. Format DD/MM/YYYY.- If this date is informed, the time range is mandatory. |
The week of visiting starts | Character | 10 | SI | Fill in the blanks |
91 - New Delivery (Schedule new visit) | ||||
Monday | Character | 1 | YES | Days of the week the delivery will be done if it is prescheduled. Otherwise, mark all the days with an "X" |
Tuesday | Character | 1 | YES | Days of the week the delivery will be done if it is prescheduled. Otherwise, mark all the days with an "X" |
Wednesday | Character | 1 | YES | Days of the week the delivery will be done if it is prescheduled. Otherwise, mark all the days with an "X" |
Thursday | Character | 1 | YES | Days of the week the delivery will be done if it is prescheduled. Otherwise, mark all the days with an "X" |
Friday | Character | 1 | YES | Days of the week the delivery will be done if it is prescheduled. Otherwise, mark all the days with an "X" |
Saturday | Character | 1 | YES | Days of the week the delivery will be done if it is prescheduled. Otherwise, mark all the days with an "X" |
Time From | Character | 5 | YES | Time when the delivery will be done. From 8 am to 6 pm. The time range between from and to must be at least of 4 hours. |
Time To | Character | 5 | YES | Time when the delivery will be done. From 8 am to 6 pm. The time range between from and to must be at least of 4 hours. |
Observations | Character | 100 | YES | |
Visiting Scheduled Date | Character | 10 | YES | The date of the visiting if it was scheduled. Format DD/MM/YYYY.- If this date is informed, the time range is mandatory. |
The week of visiting starts | Character | 10 | YES | Fill in the blanks |
-
Examples of FillerAccion for each action:
IDAccion | FillerAccion |
---|---|
17 | RETURN URGENTLY |
18 | 0000000050RETURN URGENTLY |
19 | RETURN URGENTLY |
51 | BNO |
91 | X X XX10:0015:00 X 09:0018:00 18/02/2021 |
92 | Bº CHILE M-H C-12 12 BAHIA BLANCA BAHIA BLANCA 8000 ARGENTINA XXXXXX09:0018:00 |
-
Example Response :
Status: 200 – OK (It means the transaction was done and it also returns a list of the items that were sent to enter actions to them. In each case, it returns its own StatusAction where the code 1 means OK and -1 means the action could not be entered for that Item and in “String” it informs the reason why that action could not be entered.)
At the end, it sends a Status with Code “1” String “OK” Code “-1” “Error Message”
Status: 401 - Unauthorized
Status: 500 - Internal Server Error
Example 1: “2 Actions sent, 1 successfully entered”
{ "Piezas": [ { "Cliente": "XXX", "Producto": "103172", "NumeroPieza": "501042000032743011", "IdentificadorPieza": "", "IdPieza": 0, "IdAccion": 17, "FillerAccion": "Rescate Automatico Test", "StatusAccion": { "Codigo": 1, "Texto": "OK" } }, { "Cliente": "XXX", "Producto": "103172", "NumeroPieza": "501042000032743012", "IdentificadorPieza": "", "IdPieza": 0, "IdAccion": 18, "FillerAccion": "0000001234Rescate Automatico Test", "StatusAccion": { "Codigo": -1, "Texto": "No existe una Pieza con este Producto y Numero de Pieza." } } ], "CantidadAccionesEnviadas": 2, "CantidadAccionesRechazadas": 1, "Status": { "Codigo": -1, "Texto": "Algunas acciones no pudieron ingresarse, revise en la lista de resultado." } }
Example 2: “2 Actions sent, 2 successfully entered”
{ "Piezas": [ { "Cliente": "XXX", "Producto": "103172", "NumeroPieza": "501042000132743011", "IdentificadorPieza": "", "IdPieza": 0, "IdAccion": 17, "FillerAccion": "Rescate Automatico Test", "StatusAccion": { "Codigo": 1, "Texto": "OK" } }, { "Cliente": "XXX", "Producto": "103172", "NumeroPieza": "501042013256870007", "IdentificadorPieza": "", "IdPieza": 0, "IdAccion": 18, "FillerAccion": "0000000001Rescate Automatico Test", "StatusAccion": { "Codigo": 1, "Texto": "OK" } } ], "CantidadAccionesEnviadas": 2, "CantidadAccionesRechazadas": 0, "Status": { "Codigo": 1, "Texto": "OK" } }
-
Errors Codes:
Code | Message |
---|---|
1 | OK |
2 | No item was found |
3 | Blocked User |
4 | Nonexistent User |
6 | An Item Number, an Item Identifier, or an Idpieza to be looked up must be specified |
7 | The entered product does not exist |
8 | The Idpieza number does not exist |
9 | The Idpieza identifier does not exist |
13 | The Customer Attribute is mandatory |
14 | The Customer Attribute is not valid |
15 | The Product Code Parameter is mandatory |
16 | The Action Code is not valid |
17 | There is more than one item with that Product and Item Number |
18 | There does not exist any item with that product and item number |
19 | The Item to be executed does not exist |
20 | The Item’s Action must be executed as Owner or Type of Package |
21 | The item has a pending action, you must cancel it if you want to try again |
22 | The error indicates the action cannot be entered on the item’s present status. |
6- Extra Specifications:
Architecture: REST
Standard Protocol of Authentication: OAuth 2.0
Transmission Web Protocol: Https://
Inform of Request to the API: http Standard Codes (for example: 200: OK-CORRECT).
Authorization of the Consumer Entity: OAuth 2. Password Credentials grant, (credentials previously forwarded
by e-mail.)
Token Validity: 600 seconds
7- Credentials
To get the credentials and access to the webservices, you should get in contact with our IT area. You can make the request to the following e-mail address: integraciones@oca.com.ar