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
TipoPiezaNOPossible Values 1 = Individual item, 4=Component item
NumeroPieza NO Customer’s Item Number
ClienteNOCustomer’s external code in OCA
ProductoNOIt indicates the Product Code sent by the customer
SucursalCliente NOStore code of the point of origin of the customer’s item
SucursalOCA YESOCA Store acronym to be assigned directly to the item
TipoDocumentoYESTypes of documents, e.g. ID, CUIT (Individual Taxpayer Identification Number), CUIL (Worker Identification Number),DU, PAS, LE, etc.
NumeroDocumentoYESID Number
ApellidoNOAddressee’s last name
NombreYESAddressee’s first name
SexoNOAddressee’s gender
ObservacionesYESAny observation useful to clarify about the address, for instance.
CalleNOAddressee’s street name address
NúmeroYESAddressee’s street number address
PisoYESAddressee’s floor number address
DepartamentoYESAddressee’s apartment number address
TorreYESAddressee’s tower number address
EntreCallesYESIn between which streets the addressee’s address is located
CodigoPostalNOAddressee’s Zip Code
LocalidadNOAddressee’s town
ProvinciaYESAddressee’s province
TelefonoYESAddressee’s telephone number
TelefonoLaboralYESAddressee’s work telephone number
TelefonoCelularYESAddressee’s cellphone number
EmailYESAddressee’s e-mail
CodigoRangoHorarioNOPossible values 1=8:30 – 18:00,2=8:30-13,3=13-18
CodigoAccionAutomaticaYESPossible values 19,17,32,36
VinculoConPaqueteYESItem Number related to the component.
ClavePiezaClienteYESThis field is used by those customers who inform a Password or Code Uniqueness in order not to create repeated items in the System.
DatosAdicionalesCliente YESThis 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
ProductoYESIndicates the Product Number sent by the customer
Customer’s Item Number
NumeroPieza YES OCA Item’s WEB tracking identification
IdentificadorPieza YESInternal ID of the OCA Item
IDPiezaYES
  • Example Response:
  • 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" 
                          } 
                        }
  • Errors Codes:
Code Message
1OK
2No item was found
3Blocked User
4Nonexistent User
5There is no profile assigned to this username
6An Item Number, an Item Identifier, or an Idpieza to be looked up must be specified
7The entered product does not exist
8The Idpieza number does not exist
9The Idpieza identifier does not exist
10The 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 YESOCA Item’s WEB tracking identification
IDPiezaYESInternal ID of OCA Item
NumeroPiezaYESCustomer’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
1OK
2No item was found
3Blocked User
4Nonexistent User
5There is no profile assigned to this username
6An Item Number, an Item Identifier, or an Idpieza to be looked up must be specified
7The entered product does not exist
8The Idpieza number does not exist
9The Idpieza identifier does not exist
10The 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 YESTypes of documents, e.g. ID, CUIT (Individual Taxpayer Identification Number), CUIL (Worker Identification Number),DU, PAS, LE, etc.
NumeroDocumentoNO Addressee’s ID number
ProductoYESCustomer’s Product Code
OperativaYESCode of the Commercial Operation with OCA
CantidadMesesYESQuantity 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.
EstadosNoTerminalYESSet 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
1OK
2No item was found
3Blocked User
4Nonexistent User
7The entered product does not exist
11The ID number parameter is mandatory
12The 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
ClienteNOCustomer’s Code.
ProductoNO Customer’s Product’s Code
NumeroPiezaYESCustomer’s Item Number
IdentificadorPiezaYESOCA Item identifier for WEB tracking
IdPiezaYESOCA Item’s Internal ID
IdAccionNOEntry Action Code (Check the list with all the possible actions)
FillerAccionYESVariable 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)
ObservationsCharacter100YES
18 - Retrieve (Return to the customer)
Customer’s StoreCharacter10NO
Observations Character100YES
19 – Retrieve at Head Office (Return to the customer)
Observations Character100YES
51 – Delivery at OCA Store
OCA Store Acronym Character3NOFor example: BNO Store, Belgrano’s store acronym
92 - Reschedule(Schedule a change of delivery address and new visiting time)
StreetCharacter50NOThe whole address can be indicated in this field
NumberCharacter5YESFill in the blanks
TowerCharacter1YESFill in the blanks
FloorCharacter2YESFill in the blanks
ApartmentCharacter4YESFill in the blanks
TownCharacter35NO
ProvinceCharacter20YESFill in the blanks
Zip CodeCharacter8NO4 digits Zip Code e.g. 5000
CountryCharacter30YESFill in the blanks
TelephoneCharacter30YESPreferably, inform Cellphone number. Otherwise, fill in the blanks.
MondayCharacter1YESDays of the week the delivery will be done if it is prescheduled. Otherwise, mark all the days with an "X"
TuesdayCharacter1YESDays of the week the delivery will be done if it is prescheduled. Otherwise, mark all the days with an "X"
WednesdayCharacter1YESDays of the week the delivery will be done if it is prescheduled. Otherwise, mark all the days with an "X"
ThursdayCharacter1YESDays of the week the delivery will be done if it is prescheduled. Otherwise, mark all the days with an "X"
FridayCharacter1YESDays of the week the delivery will be done if it is prescheduled. Otherwise, mark all the days with an "X"
SaturdayCharacter1YESDays of the week the delivery will be done if it is prescheduled. Otherwise, mark all the days with an "X"
Time FromCharacter5YESTime 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 ToCharacter5YESTime 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.
ObservationsCharacter100YES
Visiting Scheduled Date Character10SIThe 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 Character10SIFill in the blanks
91 - New Delivery (Schedule new visit)
MondayCharacter1YESDays of the week the delivery will be done if it is prescheduled. Otherwise, mark all the days with an "X"
TuesdayCharacter1YESDays of the week the delivery will be done if it is prescheduled. Otherwise, mark all the days with an "X"
WednesdayCharacter1YESDays of the week the delivery will be done if it is prescheduled. Otherwise, mark all the days with an "X"
ThursdayCharacter1YESDays of the week the delivery will be done if it is prescheduled. Otherwise, mark all the days with an "X"
FridayCharacter1YESDays of the week the delivery will be done if it is prescheduled. Otherwise, mark all the days with an "X"
SaturdayCharacter1YESDays of the week the delivery will be done if it is prescheduled. Otherwise, mark all the days with an "X"
Time FromCharacter5YESTime 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 ToCharacter5YESTime 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.
ObservationsCharacter100YES
Visiting Scheduled Date Character10YESThe 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 Character10YESFill in the blanks
  • Examples of FillerAccion for each action:

IDAccion FillerAccion
17RETURN URGENTLY
180000000050RETURN URGENTLY
19RETURN URGENTLY
51BNO
91X X XX10:0015:00 X 09:0018:00
18/02/2021
92Bº 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
1OK
2No item was found
3Blocked User
4Nonexistent User
6An Item Number, an Item Identifier, or an Idpieza to be looked up must be specified
7The entered product does not exist
8The Idpieza number does not exist
9The Idpieza identifier does not exist
13The Customer Attribute is mandatory
14The Customer Attribute is not valid
15The Product Code Parameter is mandatory
16The Action Code is not valid
17There is more than one item with that Product and Item Number
18There does not exist any item with that product and item number
19The Item to be executed does not exist
20The Item’s Action must be executed as Owner or Type of Package
21The item has a pending action, you must cancel it if you want to try again
22The 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