Atrato Ecommerce API

The Ecommerce API from Atrato — 7 operation(s) for ecommerce.

OpenAPI Specification

atrato-ecommerce-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Atrato Partners Ecommerce API
  version: '1.0'
  description: 'Atrato Partners API (api-partners) for buy-now-pay-later integration: in-store cash-in payment collection and ecommerce checkout order generation. Reconstructed verbatim from Atrato''s per-operation OpenAPI definitions published in the ReadMe developer reference at docs.atratopago.com.'
servers:
- url: https://api-sandbox.atratopago.com
  description: Sandbox
security:
- sec0: []
tags:
- name: Ecommerce
paths:
  /api/v4/ecommerce/integration/{partner-key}/login:
    post:
      summary: Obtener token
      description: ''
      operationId: obtener-token
      parameters:
      - name: partner-key
        in: path
        description: Código de validación de sucursal, se obtiene del dashboard de partner
        schema:
          type: string
        required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - username
              - password
              properties:
                username:
                  type: string
                  description: Usuario del partner dashboard
                password:
                  type: string
                  description: Password del partner dashboard
            examples:
              Request Example:
                value:
                  username: username
                  password: password
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n    \"token\": \"token\"\n}"
              schema:
                type: object
                properties:
                  token:
                    type: string
                    example: token
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n  \"message\": \"No se proporcionaron los parámetros necesarios\"\n}"
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: No se proporcionaron los parámetros necesarios
        '500':
          description: '500'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n  \"message\": \"Error desconocido al intentar la autenticación\"\n}"
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Error desconocido al intentar la autenticación
      deprecated: false
      security: []
      tags:
      - Ecommerce
  /api/v4/ecommerce/integration/{partner-key}/application:
    post:
      summary: Generar orden
      description: ''
      operationId: generar-orden
      parameters:
      - name: partner-key
        in: path
        description: Código de validación de sucursal, se obtiene del dashboard de partner
        schema:
          type: string
        required: true
      - name: x-auth-token
        in: header
        description: Token de autenticación
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - orderId
              - requestedAmount
              - productDescription
              - customerName
              - customerEmail
              - customerPhone
              properties:
                orderId:
                  type: string
                  description: Número de orden interna del Partner
                  default: '0000'
                requestedAmount:
                  type: number
                  description: Monto requerido
                  default: 0
                  format: float
                productDescription:
                  type: string
                  description: Descripción del producto
                  default: Producto
                customerName:
                  type: string
                  description: Nombre del cliente
                  default: Jhon Doe
                customerEmail:
                  type: string
                  description: e-mail del cliente
                  default: emailname@email.com
                customerPhone:
                  type: string
                  description: Número telefónico del cliente
                  default: '3331112233'
                successUrl:
                  type: string
                  description: Url de redirección para flujo de crédito autorizado
                  default: https://url
                failureUrl:
                  type: string
                  description: Url de redirección para flujo de solicitud cancelada
                  default: https://url
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n    \"message\": \"Información\",\n    \"url\": \"Url de solicitud\",\n    \"atrato_id\": 0000\n}"
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n    \"message\": \"Parámetros incorrectos\"\n}"
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Parámetros incorrectos
        '401':
          description: '401'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n  \"msg\": \"Token no válido\"\n}"
              schema:
                type: object
                properties:
                  msg:
                    type: string
                    example: Token no válido
        '422':
          description: '422'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n    \"message\": \"El monto no está dentro del rango permitido\"\n}"
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: El monto no está dentro del rango permitido
        '500':
          description: '500'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n  \"message\": \"Error desconocido al evaluar financiamiento\"\n}"
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Error desconocido al evaluar financiamiento
      deprecated: false
      security: []
      tags:
      - Ecommerce
  /api/v4/ecommerce/integration/{partner-key}/order/{order-id}:
    get:
      summary: Consultar orden
      description: ''
      operationId: consulta-de-orden
      parameters:
      - name: partner-key
        in: path
        description: Código de validación de sucursal, se obtiene del dashboard de partner
        schema:
          type: string
        required: true
      - name: order-id
        in: path
        description: Número de orden interna del Partner
        schema:
          type: string
        required: true
      - name: x-auth-token
        in: header
        description: Token de autenticación
        required: true
        schema:
          type: string
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n    \"event_type\": \"query\",\n    \"event_data\": {\n        \"atrato_id\": 2922,\n        \"atrato_application_id\": 8144,\n        \"status\": \"Desembolsado\",\n        \"status_id\": 19,\n        \"status_code\": \"DESEMBOLSADO\",\n        \"order_id\": \"AAAA-BBBBB-CCCC-DDDD-EEEEE70703\",\n        \"order_number\": \"AAAA-BBBBB-CCCC-DDDD-EEEEE70703\",\n        \"customer\": {\n            \"name\": \"RAMON LOPEZ PEREZ\",\n            \"email\": \"ramon.lopez@email.com\",\n            \"phone\": \"+523331230000\",\n            \"address\": {\n                \"street\": \"Calle Juarez\",\n                \"ext_number\": \"12\",\n                \"int_number\": null,\n                \"district\": \"Roma\",\n                \"postal_code\": \"28000\",\n                \"city\": \"Guadalajara\"\n            }\n        },\n        \"credit\": {\n            \"creditId\": 2818,\n            \"purchaseAmount\": 1000,\n            \"totalFinanced\": 1000,\n            \"merchantComision\": 0,\n            \"interesRate\": 75,\n            \"installments\": 6,\n            \"installmentValue\": 211.41,\n            \"biweekly\": false,\n            \"creditTotalValue\": 1268.46\n        },\n        \"disbursement\": {\n            \"transactionId\": 464,\n            \"trackingKey\": \"SUC261TX464\"\n        },\n        \"timestamp\": 1729023133264,\n        \"observations\": \"\"\n    }\n}"
              schema:
                type: object
                properties:
                  event_type:
                    type: string
                    example: query
                  event_data:
                    type: object
                    properties:
                      atrato_id:
                        type: integer
                        example: 2922
                        default: 0
                      atrato_application_id:
                        type: integer
                        example: 8144
                        default: 0
                      status:
                        type: string
                        example: Desembolsado
                      status_id:
                        type: integer
                        example: 19
                        default: 0
                      status_code:
                        type: string
                        example: DESEMBOLSADO
                      order_id:
                        type: string
                        example: AAAA-BBBBB-CCCC-DDDD-EEEEE70703
                      order_number:
                        type: string
                        example: AAAA-BBBBB-CCCC-DDDD-EEEEE70703
                      customer:
                        type: object
                        properties:
                          name:
                            type: string
                            example: RAMON LOPEZ PEREZ
                          email:
                            type: string
                            example: ramon.lopez@email.com
                          phone:
                            type: string
                            example: '+523331230000'
                          address:
                            type: object
                            properties:
                              street:
                                type: string
                                example: Calle Juarez
                              ext_number:
                                type: string
                                example: '12'
                              int_number: {}
                              district:
                                type: string
                                example: Roma
                              postal_code:
                                type: string
                                example: '28000'
                              city:
                                type: string
                                example: Guadalajara
                      credit:
                        type: object
                        properties:
                          creditId:
                            type: integer
                            example: 2818
                            default: 0
                          purchaseAmount:
                            type: integer
                            example: 1000
                            default: 0
                          totalFinanced:
                            type: integer
                            example: 1000
                            default: 0
                          merchantComision:
                            type: integer
                            example: 0
                            default: 0
                          interesRate:
                            type: integer
                            example: 75
                            default: 0
                          installments:
                            type: integer
                            example: 6
                            default: 0
                          installmentValue:
                            type: number
                            example: 211.41
                            default: 0
                          biweekly:
                            type: boolean
                            example: false
                            default: true
                          creditTotalValue:
                            type: number
                            example: 1268.46
                            default: 0
                      disbursement:
                        type: object
                        properties:
                          transactionId:
                            type: integer
                            example: 464
                            default: 0
                          trackingKey:
                            type: string
                            example: SUC261TX464
                      timestamp:
                        type: integer
                        example: 1729023133264
                        default: 0
                      observations:
                        type: string
                        example: ''
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n    \"message\": \"Parámetros incorrectos\"\n}"
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Parámetros incorrectos
        '401':
          description: '401'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n    \"msg\": \"Unauthorized\"\n}"
              schema:
                type: object
                properties:
                  msg:
                    type: string
                    example: Unauthorized
        '404':
          description: '404'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n    \"message\": \"No se encontró la orden\"\n}"
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: No se encontró la orden
        '500':
          description: '500'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n  \"message\": \"Mensaje\"\n}"
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Mensaje
      deprecated: false
      security: []
      tags:
      - Ecommerce
  /api/v4/ecommerce/integration/{partner-key}/order/{order-id}/delivery:
    post:
      summary: Registrar entrega
      description: ''
      operationId: registrar-entrega
      parameters:
      - name: partner-key
        in: path
        description: Código de validación de sucursal, se obtiene del dashboard de partner
        schema:
          type: string
        required: true
      - name: order-id
        in: path
        description: Número de orden interna del Partner
        schema:
          type: string
        required: true
      - name: x-auth-token
        in: header
        description: Token de autenticación
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - name
              - product
              - id_internal_folio_partner
              properties:
                name:
                  type: string
                  description: Nombre de usuario que registra la entrega
                product:
                  type: string
                  description: Descripción o nombre del producto entregado
                id_internal_folio_partner:
                  type: string
                  description: Folio de control interno del partner
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n  \"message\": \"Producto marcado como entregado\"\n}"
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Producto marcado como entregado
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n  \"message\": \"Parámetros incorrectos\"\n}"
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Parámetros incorrectos
        '401':
          description: '401'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n  \"msg\": \"Unauthorized\"\n}"
              schema:
                type: object
                properties:
                  msg:
                    type: string
                    example: Unauthorized
        '404':
          description: '404'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n  \"message\": \"No se encontró la orden\"\n}"
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: No se encontró la orden
        '500':
          description: '500'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n  \"message\": \"Error desconocido al entregar producto\"\n}"
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Error desconocido al entregar producto
      deprecated: false
      security: []
      tags:
      - Ecommerce
  /api/v4/ecommerce/integration/{partner-key}/order/{order-id}/cancel:
    post:
      summary: Solicitar cancelación
      description: ''
      operationId: solicitar-cancelacion
      parameters:
      - name: partner-key
        in: path
        description: Código de validación de sucursal, se obtiene del dashboard de partner
        schema:
          type: string
        required: true
      - name: order-id
        in: path
        description: Número de orden interna del Partner
        schema:
          type: string
        required: true
      - name: x-auth-token
        in: header
        description: Token de autenticación
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - name
              - reason
              properties:
                name:
                  type: string
                  description: Nombre de usuario quien solicita
                reason:
                  type: string
                  description: Motivo de cancelación
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n  \"message\": \"Solicitud de cancelación enviada\"\n}"
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Solicitud de cancelación enviada
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n  \"message\": \"Parámetros incorrectos\"\n}"
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Parámetros incorrectos
        '401':
          description: '401'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n  \"msg\": \"Unauthorized\"\n}"
              schema:
                type: object
                properties:
                  msg:
                    type: string
                    example: Unauthorized
        '404':
          description: '404'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n  \"message\": \"No se encontró la orden\"\n}"
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: No se encontró la orden
        '500':
          description: '500'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n  \"message\": \"Error desconocido al cancelar la solicitud\"\n}"
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Error desconocido al cancelar la solicitud
      deprecated: false
      security: []
      tags:
      - Ecommerce
  /api/v4/ecommerce/integration/{partner-key}/disbursement:
    get:
      summary: Consulta de desembolsos
      description: ''
      operationId: consulta-de-desembolsos
      parameters:
      - name: partner-key
        in: path
        description: Código de validación de sucursal, se obtiene del dashboard de partner
        schema:
          type: string
        required: true
      - name: startDate
        in: query
        description: Fecha inicial del periodo de consulta, formato YYYY-MM-DD
        schema:
          type: string
      - name: endDate
        in: query
        description: Fecha final del periodo de consulta, formato YYYY-MM-DD
        schema:
          type: string
      - name: page
        in: query
        description: Número de página a consultar
        schema:
          type: integer
          format: int32
      - name: recordsPerPage
        in: query
        description: Registros por página
        schema:
          type: integer
          format: int32
      - name: x-auth-token
        in: header
        description: Token de autenticación
        required: true
        schema:
          type: string
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n    \"data\": [\n        {\n            \"atrato_id\": 2660,\n            \"order_id\": \"AAAA-BBBBB-CCCC-DDDD-EEEEE18\",\n            \"atrato_application_id\": 7745,\n            \"disbursed\": 1,\n            \"transfer_date\": \"2024-09-13T22:10:56.000Z\",\n            \"amount_disbursed\": 1000,\n            \"tracking_key\": \"SUC261TX429\",\n            \"transactionId\": 429,\n            \"merchant\": \"Ecommerce merchant\",\n            \"store\": \"Ecommerce store\",\n            \"disbursement_status\": \"Aplicada\"\n        },\n        {\n            \"atrato_id\": 2662,\n            \"order_id\": \"AAAA-BBBBB-CCCC-DDDD-EEEEE21\",\n            \"atrato_application_id\": 7747,\n            \"disbursed\": 1,\n            \"transfer_date\": \"2024-09-13T22:10:56.000Z\",\n            \"amount_disbursed\": 1000,\n            \"tracking_key\": \"SUC261TX429\",\n            \"transactionId\": 429,\n            \"merchant\": \"Ecommerce merchant\",\n            \"store\": \"Ecommerce store\",\n            \"disbursement_status\": \"Aplicada\"\n        },\n        {\n            \"atrato_id\": 2658,\n            \"order_id\": \"AAAA-BBBBB-CCCC-DDDD-EEEEE16\",\n            \"atrato_application_id\": 7744,\n            \"disbursed\": 1,\n            \"transfer_date\": \"2024-09-13T21:41:37.000Z\",\n            \"amount_disbursed\": 1111,\n            \"tracking_key\": \"SUC261TX428\",\n            \"transactionId\": 428,\n            \"merchant\": \"Ecommerce merchant\",\n            \"store\": \"Ecommerce store\",\n            \"disbursement_status\": \"Aplicada\"\n        },\n        {\n            \"atrato_id\": 2657,\n            \"order_id\": \"AAAA-BBBBB-CCCC-DDDD-EEEEE15\",\n            \"atrato_application_id\": 7743,\n            \"disbursed\": 1,\n            \"transfer_date\": \"2024-09-13T17:55:28.000Z\",\n            \"amount_disbursed\": 1111,\n            \"tracking_key\": \"SUC261TX427\",\n            \"transactionId\": 427,\n            \"merchant\": \"Ecommerce merchant\",\n            \"store\": \"Ecommerce store\",\n            \"disbursement_status\": \"Aplicada\"\n        },\n        {\n            \"atrato_id\": 2656,\n            \"order_id\": \"AAAA-BBBBB-CCCC-DDDD-EEEEE14\",\n            \"atrato_application_id\": 7741,\n            \"disbursed\": 1,\n            \"transfer_date\": \"2024-09-13T14:47:16.000Z\",\n            \"amount_disbursed\": 1111,\n            \"tracking_key\": \"SUC261TX426\",\n            \"transactionId\": 426,\n            \"merchant\": \"Ecommerce merchant\",\n            \"store\": \"Ecommerce store\",\n            \"disbursement_status\": \"Aplicada\"\n        },\n        {\n            \"atrato_id\": 2649,\n            \"order_id\": \"AAAA-BBBBB-CCCC-DDDD-EEEEE12\",\n            \"atrato_application_id\": 7731,\n            \"disbursed\": 1,\n            \"transfer_date\": \"2024-09-12T16:25:11.000Z\",\n            \"amount_disbursed\": 1111,\n            \"tracking_key\": \"SUC261TX425\",\n            \"transactionId\": 425,\n            \"merchant\": \"Ecommerce merchant\",\n            \"store\": \"Ecommerce store\",\n            \"disbursement_status\": \"Aplicada\"\n        },\n        {\n            \"atrato_id\": 2648,\n            \"order_id\": \"AAAA-BBBBB-CCCC-DDDD-EEEEE11\",\n            \"atrato_application_id\": 7730,\n            \"disbursed\": 1,\n            \"transfer_date\": \"2024-09-12T16:18:38.000Z\",\n            \"amount_disbursed\": 1111,\n            \"tracking_key\": \"SUC261TX424\",\n            \"transactionId\": 424,\n            \"merchant\": \"Ecommerce merchant\",\n            \"store\": \"Ecommerce store\",\n            \"disbursement_status\": \"Aplicada\"\n        },\n        {\n            \"atrato_id\": 2647,\n            \"order_id\": \"123000001234\",\n            \"atrato_application_id\": 7729,\n            \"disbursed\": 1,\n            \"transfer_date\": \"2024-09-12T15:59:01.000Z\",\n            \"amount_disbursed\": 1111,\n            \"tracking_key\": \"SUC261TX423\",\n            \"transactionId\": 423,\n            \"merchant\": \"Ecommerce merchant\",\n            \"store\": \"Ecommerce store\",\n            \"disbursement_status\": \"Aplicada\"\n        }\n    ],\n    \"totalRecords\": 7,\n    \"recordsPerPage\": 10,\n    \"currentPage\": 1,\n    \"totalPages\": 1\n}"
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        atrato_id:
                          type: integer
                          example: 2660
                          default: 0
                        order_id:
                          type: string
                          example: AAAA-BBBBB-CCCC-DDDD-EEEEE18
                        atrato_application_id:
                          type: integer
                          example: 7745
                          default: 0
                        disbursed:
                          type: integer
                          example: 1
                          default: 0
                        transfer_date:
                          type: string
                          example: '2024-09-13T22:10:56.000Z'
                        amount_disbursed:
                          type: integer
                          example: 1000
                          default: 0
                        tracking_key:
                          type: string
                          example: SUC261TX429
                        transactionId:
                          type: integer
                          example: 429
                          default: 0
                        merchant:
                          type: string
                          example: Ecommerce merchant
                        store:
                          type: string
                          example: Ecommerce store
                        disbursement_status:
                          type: string
                          example: Aplicada
                  totalRecords:
                    type: integer
                    example: 7
                    default: 0
                  recordsPerPage:
                    type: integer
                    example: 10
                    default: 0
                  currentPage:
                    type: integer
                    example: 1
                    default: 0
                  totalPages:
                    type: integer
                    example: 1
                    default: 0
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n    \"message\": \"Valor de fechas incorrecto\"\n}"
              schema:
                oneOf:
                - type: object
                  properties:
                    message:
                      type: string
                      example: Parámetros incorrectos
                - type: object
                  properties:
                    message:
                      type: string
                      example: Valor de fechas incorrecto
        '500':
          description: '500'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n    \"message\": \"La consulta no pudo ser procesada satisfactoriamente\"\n}"
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: La consulta no pudo ser procesada satisfactoriamente
      deprecated: false
      security: []
      tags:
      - Ecommerce
  /api/v4/ecommerce/integration/{partner-key}/disbursement/{transaction-id}:
    get:
      summary: Consulta de desembolsos por número de transacción
      description: ''
      operationId: consulta-de-desembolsos-orden
      parameters:
      - name: partner-key
        in: path
        description: Código de validación de sucursal, se obtiene del dashboard de partner
        schema:
          type: string
        required: true
      - name: transaction-id
        in: path
        description: Número de transacción de desembolso
        schema:
          type: string
        required: true
      - name: x-auth-token
        in: header
        description: Token de autenticación
        required: true
        schema:
          type: string
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n    \"amou

# --- truncated at 32 KB (37 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/atrato/refs/heads/main/openapi/atrato-ecommerce-api-openapi.yml