From 996cfd514421b3b8c4a1e6fbec80f3993cf9a188 Mon Sep 17 00:00:00 2001 From: Johanna Arango <67110144+larangogon@users.noreply.github.com> Date: Tue, 16 Dec 2025 14:28:36 -0500 Subject: [PATCH 1/2] fest: ad autopay en trans and update api --- src/assets/apis/autopay/en.yaml | 1013 +++++++++++++++++ src/assets/apis/autopay/es.yaml | 188 ++- src/assets/apis/base/es.yaml | 15 + src/constants/navigations.js | 66 +- src/pages/autopay/api/cancel.mdx | 2 +- src/pages/autopay/api/search.mdx | 6 +- src/pages/autopay/api/session.mdx | 381 ++++++- src/pages/autopay/api/transactions.mdx | 2 +- src/pages/autopay/contracts/balance.mdx | 21 +- src/pages/autopay/contracts/settlement.mdx | 4 +- src/pages/en/autopay/api/cancel.mdx | 87 ++ src/pages/en/autopay/api/index.mdx | 9 + src/pages/en/autopay/api/search.mdx | 167 +++ src/pages/en/autopay/api/session.mdx | 396 +++++++ src/pages/en/autopay/api/transactions.mdx | 219 ++++ src/pages/en/autopay/authentication.mdx | 144 +++ src/pages/en/autopay/charge-types.mdx | 15 + src/pages/en/autopay/codes.mdx | 29 + .../en/autopay/contract-authentication.mdx | 65 ++ src/pages/en/autopay/contracts/balance.mdx | 117 ++ src/pages/en/autopay/contracts/index.mdx | 23 + src/pages/en/autopay/contracts/settlement.mdx | 145 +++ src/pages/en/autopay/contracts/webhook.mdx | 146 +++ src/pages/en/autopay/index.mdx | 25 +- src/pages/en/index.mdx | 8 + 25 files changed, 3240 insertions(+), 53 deletions(-) create mode 100644 src/assets/apis/autopay/en.yaml create mode 100644 src/pages/en/autopay/api/cancel.mdx create mode 100644 src/pages/en/autopay/api/index.mdx create mode 100644 src/pages/en/autopay/api/search.mdx create mode 100644 src/pages/en/autopay/api/session.mdx create mode 100644 src/pages/en/autopay/api/transactions.mdx create mode 100644 src/pages/en/autopay/authentication.mdx create mode 100644 src/pages/en/autopay/charge-types.mdx create mode 100644 src/pages/en/autopay/codes.mdx create mode 100644 src/pages/en/autopay/contract-authentication.mdx create mode 100644 src/pages/en/autopay/contracts/balance.mdx create mode 100644 src/pages/en/autopay/contracts/index.mdx create mode 100644 src/pages/en/autopay/contracts/settlement.mdx create mode 100644 src/pages/en/autopay/contracts/webhook.mdx diff --git a/src/assets/apis/autopay/en.yaml b/src/assets/apis/autopay/en.yaml new file mode 100644 index 000000000..e245bab73 --- /dev/null +++ b/src/assets/apis/autopay/en.yaml @@ -0,0 +1,1013 @@ +openapi: 3.0.0 +info: + title: BETA - AutoPay API - Balance Request + version: 1.0.0 + +paths: + /autopay/balance: + post: + summary: Get balance + operationId: post-balance + parameters: + - schema: + type: string + example: application/json;charset=UTF-8 + in: header + name: Content-Type + responses: + "200": + description: Successful response with the amount to be charged to the user + content: + application/json: + schema: + type: object + required: [ status, id, amount ] + properties: + status: + $ref: '#/components/schemas/Status' + id: + $ref: '#/components/schemas/AutoPayId' + amount: + $ref: "../base/en.yaml#/components/schemas/Amount" + min_amount: + $ref: "../base/en.yaml#/components/schemas/Amount" + "4XX": + description: Request error. + content: + application/json: + schema: + type: object + properties: + status: + $ref: '#/components/schemas/Status' + description: This endpoint returns the pending amount to be charged and the minimum amount required to execute the auto payment. + requestBody: + content: + application/json: + schema: + type: object + required: [ auth, reference, id ] + properties: + reference: + type: string + description: AutoPay reference provided by the client/merchant. This reference must be unique and active per merchant. + example: "ACC00012345" + maxLength: 32 + id: + $ref: '#/components/schemas/AutoPayId' + + /autopay/settlement: + post: + summary: Settle an AutoPay + operationId: post-settlement + parameters: + - schema: + type: string + example: application/json;charset=UTF-8 + in: header + name: Content-Type + responses: + "200": + description: AutoPay successfully registered. + content: + application/json: + schema: + type: object + required: [ status, id ] + properties: + status: + $ref: '#/components/schemas/Status' + id: + $ref: '#/components/schemas/AutoPayId' + "4XX": + description: Request error. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + description: This endpoint registers and returns only the notification (settlement) status. + requestBody: + content: + application/json: + schema: + type: object + required: [ reference, id, transaction ] + properties: + reference: + type: string + description: AutoPay reference provided by the client/merchant. This reference must be unique and active per merchant. + minLength: 32 + maxLength: 32 + example: "ACC00012345" + id: + $ref: '#/components/schemas/AutoPayId' + transaction: + description: Transaction data + type: object + properties: + status: + type: object + description: Structure that defines the AutoPay status + x-internal: false + properties: + status: + type: string + enum: [ APPROVED ] + example: APPROVED + description: AutoPay status. Only approved payments will be settled. + reason: + type: string + enum: [ '00' ] + description: Reason code of the request status. (See [Reason codes](/autopay/codes)) + example: '00' + message: + type: string + description: Message clarifying the status. + example: "Successful response" + date: + type: string + format: date-time + description: Date and time when the response was generated. + example: "2025-09-29T17:09:29-05:00" + required: + - status + - reason + - message + date: + type: "string" + format: date-time + description: "Creation date (ISO 8601 with timezone). Example: `2021-09-20T21:51:59-05:00`." + transactionDate: + type: "string" + format: date-time + description: "Processing date at the provider (may differ from date)." + internalReference: + type: "number" + description: "Internal reference." + minimum: 1 + reference: + type: "string" + description: "Merchant reference." + minLength: 1 + maxLength: 64 + paymentMethod: + type: "string" + description: "Conventional format: processor_brand (e.g. `ID_VS` for Interdin Visa, `DF_MS` for Datafast Mastercard). Exceptions may apply." + minLength: 5 + maxLength: 5 + franchise: + type: "string" + description: "Card brand / franchise." + enum: + - "visa" + - "visa_electron" + - "amex" + - "master" + - "codensa" + - "diners" + - "jbc" + - "discover" + - "ris" + - "credencial" + - "comfama" + - "colsubsidio" + - "falabella" + - "elo" + - "somos" + - "tuya" + - "exito" + - "alkosto" + - "maestro" + - "mefia" + - "ath_card" + - "ath" + - "athmv" + - "bancolombia" + - "cooperativa" + - "debito" + - "pagoefectivo" + - "cafam" + - "efecty" + - "gana" + - "masterpass" + - "ppd" + - "pse" + - "safetypay" + - "supergiros" + - "visa_checkout" + - "procesa" + - "comfandi" + - "ach" + - "telered" + - "aval" + - "dilo" + - "banco_bogota" + - "ebt" + - "alia" + - "deuna" + franchiseName: + type: "string" + description: "Displayed franchise name." + minLength: 1 + issuerName: + type: "string" + description: "Issuer name." + minLength: 1 + nullable: true + amount: + $ref: "../base/en.yaml#/components/schemas/Amount" + conversion: + $ref: "../base/en.yaml#/components/schemas/AmountConversion" + authorization: + type: "string" + description: "Authorization code." + minLength: 1 + nullable: true + receipt: + type: "string" + description: "Receipt / voucher." + maxLength: 16 + nullable: true + type: + type: "string" + description: "Operation type." + minLength: 1 + enum: + - 'AUTH_ONLY' + refunded: + type: "boolean" + description: "Refund indicator." + lastDigits: + type: "string" + description: "Last account digits." + minLength: 2 + nullable: true + provider: + type: "string" + description: "Processor / provider code." + enum: + - "CREDIBANCO" + - "REDEBAN" + - "INTERDIN" + - "DATAFAST" + - "TUYA-DIRECT" + - "BRASPAG" + - "TRANSERVER" + - "SABRE" + - "EVERTEC" + - "ACH" + - "ATH-AVALNET" + - "SUPERGIROS" + - "TECNICARD" + - "MEDIANET" + - "AUSTRO" + - "COMFANDI" + - "PAYSTUDIO" + - "FLAMINGO" + - "ATH-MOVIL" + - "EBUS" + - "BANCOLOMBIA" + - PAGOEFECTIVO, PROCESA, TELERED, AVAL, DILO, BANCO_BOGOTA, BANET, DEUNA + discount: + type: "string" + description: "Applied discount information (if any)." + processorFields: + type: "object" + description: "Raw processor fields." + properties: + id: + type: "string" + description: "Processor ID." + maxLength: 64 + b24: + type: "string" + description: "Extra field." + maxLength: 64 + additional: + type: "object" + description: | + See more at [Additional data](/gateway/additional-data) + + required: + - "status" + - "provider" + - "internalReference" + - "reference" + - "paymentMethod" + - "franchise" + - "franchiseName" + - "amount" + - "authorization" + - "receipt" + - "type" + - "refunded" + - "processorFields" + /autopay/webhook: + post: + summary: AutoPay notifications reception + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/WebhookEvent' + responses: + "200": + description: The webhook was received successfully. + content: + application/json: + schema: + type: object + properties: + status: + $ref: '#/components/schemas/Status' + "4XX": + description: An error occurred while receiving the webhook. + content: + application/json: + schema: + type: object + properties: + status: + $ref: "#/components/schemas/Status" + + /autopay/search: + post: + summary: List autopays + operationId: post-search + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - auth + properties: + auth: + $ref: '#/components/schemas/Authentication' + filters: + type: object + description: Filtering criteria for the search. + properties: + reference: + type: string + description: AutoPay reference provided by the client/merchant. This reference must be unique and active per merchant. + example: "ACC00012345" + maxLength: 32 + id: + $ref: '#/components/schemas/AutoPayId' + nullable: true + chargeTypes: + type: array + description: Filter by one or more charge types. + example: "['FIXED', 'TOTAL_BALANCE']" + items: + $ref: '#/components/schemas/ChargeType' + status: + type: array + description: AutoPay statuses included in the filter. + items: + type: string + enum: + - FAILED + - REJECTED + - APPROVED + example: "[ 'APPROVED' ]" + createdAt: + type: object + description: Creation date range (ISO 8601, date only). + properties: + from: + type: string + example: "2025-09-01" + format: date Y-m-d + to: + type: string + example: "2025-09-30" + format: date Y-m-d + pagination: + $ref: '#/components/schemas/PaginationRequest' + locale: + $ref: '#/components/schemas/Locale' + responses: + "200": + description: Successful request + content: + application/json: + schema: + type: object + required: + - status + properties: + status: + $ref: '#/components/schemas/Status' + data: + description: List of autopays that match the search criteria. + type: array + items: + $ref: '#/components/schemas/AutoPay' + pagination: + $ref: '#/components/schemas/Pagination' + + /autopay/cancel: + post: + summary: Cancel an autopay + operationId: post-search + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - auth + - id + properties: + auth: + $ref: '#/components/schemas/Authentication' + id: + $ref: '#/components/schemas/AutoPayId' + locale: + $ref: '#/components/schemas/Locale' + responses: + "200": + description: Successful request + content: + application/json: + schema: + type: object + properties: + status: + $ref: '#/components/schemas/Status' + id: + $ref: '#/components/schemas/AutoPayId' + "4XX": + description: Invalid request + content: + application/json: + schema: + type: object + properties: + status: + $ref: '#/components/schemas/Status' + + /autopay/transactions: + post: + summary: List autopay transactions + operationId: post-search + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - auth + - id + properties: + auth: + $ref: '#/components/schemas/Authentication' + id: + $ref: '#/components/schemas/AutoPayId' + filters: + type: object + description: Filtering criteria for the search. + properties: + internalReference: + type: string + description: Internal transaction reference in PlacetoPay provided by the gateway at the time of payment. + example: "ACC00012345" + maxLength: 32 + status: + type: array + description: Transaction statuses. + items: + type: string + enum: + - OK + - FAILED + - REJECTED + - APPROVED + - APPROVED_PARCIAL + example: "[ 'APPROVED' ]" + amount: + type: "object" + description: "Structure containing information about the transaction payment." + required: + - "currency" + - "total" + properties: + currency: + type: "string" + description: | + Alphabetic currency code to be used (ISO 4217 alpha code) + enum: + - "USD" + - "COP" + - "CRC" + - "EUR" + - "CAD" + - "AUD" + - "GBP" + - "MXN" + - "CLP" + example: "COP" + minLength: 3 + maxLength: 3 + total: + type: "number" + example: 2000 + description: | + Total amount in the specified base currency + createdAt: + type: object + description: Creation date range (ISO 8601, date only). + properties: + from: + type: string + example: "2025-09-01" + format: date Y-m-d + to: + type: string + example: "2025-09-30" + format: date Y-m-d + pagination: + $ref: '#/components/schemas/PaginationRequest' + locale: + $ref: '#/components/schemas/Locale' + responses: + "200": + description: Successful request + content: + application/json: + schema: + type: object + required: + - status + properties: + status: + $ref: '#/components/schemas/Status' + data: + description: List of autopay transactions that match the search criteria. + type: array + items: + $ref: '../base/en.yaml#/components/schemas/Transaction' + pagination: + $ref: '#/components/schemas/Pagination' + + /autopay/session: + post: + summary: Create session (CreateRequest) + operationId: post-autopay-session + description: Requests the creation of a session and returns the identifier and the processing URL. + x-internal: false + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RedirectRequest' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + status: + $ref: '#/components/schemas/Status' + requestId: + type: integer + processUrl: + type: string + '401': + description: Unauthorized + content: + application/json: + schema: + type: object + properties: + status: + $ref: '#/components/schemas/Status' + + /autopay/session/{requestId}: + parameters: + - schema: + type: string + name: requestId + in: path + required: true + post: + summary: Get session information (getSessionInformation) + operationId: post-autopay-session-requestId + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/RedirectInformation' + description: | + Retrieves the session information. If the session contains transactions, their details are included. + requestBody: + content: + application/json: + schema: + type: object + required: + - auth + properties: + auth: + $ref: '#/components/schemas/Authentication' + +components: + schemas: + AutoPay: + type: object + required: + - id + - status + - subscription + - createdAt + properties: + id: + $ref: '#/components/schemas/AutoPayId' + status: + $ref: '#/components/schemas/StatusAutoPay' + payer: + $ref: '../base/es.yaml#/components/schemas/Person' + buyer: + $ref: '../base/es.yaml#/components/schemas/Person' + subscription: + type: object + required: + - reference + - description + - recurring + description: Structure containing information about the subscription associated with the AutoPay. + properties: + reference: + type: "string" + minLength: 1 + maxLength: 32 + description: Reference + description: + type: "string" + maxLength: 250 + description: Description + amount: + $ref: "../base/en.yaml#/components/schemas/Amount" + description: | + Only present when the charge type is `FIXED`. + - `FIXED`: recurring amount to be charged. + recurring: + $ref: "#/components/schemas/Recurring" + dueDay: + type: integer + description: Cut-off or due day (1–28 to avoid short months). + minimum: 1 + maximum: 28 + example: 15 + additional: + type: object + description: Additional information. + properties: + customerAccountNumber: + type: string + description: Unique identifier assigned by the merchant to a customer to identify their internal account. + example: "12345" + createdAt: + type: string + format: date-time + description: AutoPay creation date. + example: "2021-09-24T10:02:17-05:00" + updatedAt: + type: string + format: date-time + description: AutoPay last update date. + example: "2021-09-24T10:02:17-05:00" + + ChargeType: + type: string + enum: + - TOTAL_BALANCE + - MINIMUM_BALANCE + - FIXED + example: TOTAL_BALANCE + description: AutoPay charge type. See more at [Charge types](/autopay/charge-types). + + AutoPayId: + type: string + format: uuid + description: Unique identifier of the confirmed AutoPay registered in the notification record. + minLength: 36 + maxLength: 36 + example: "2972c13d-6315-4da3-80d7-64c24eb232ad" + + Recurring: + type: object + description: Recurrence parameters. If not provided in the creation request, the system may request them from the user during redirection. + required: + - type + properties: + type: + $ref: '#/components/schemas/ChargeType' + periodicity: + type: string + description: Charge frequency. D=Daily, W=Weekly, M=Monthly, Y=Yearly. + enum: [ D, W, M, Y ] + example: M + interval: + type: string + description: Number of periods between charges (e.g. "1" = every month if periodicity=M). + pattern: '^[1-9][0-9]*$' + example: "1" + maxPeriods: + type: integer + description: Maximum number of periods to be charged. + minimum: 1 + example: 12 + dueDate: + type: string + format: date Y-m-d + description: Recurrence due date. + example: '2019-09-24' + nextPayment: + type: string + description: Date from which the charge starts. + format: date Y-m-d + example: "2025-11-30" + WebhookEvent: + type: object + required: [ id, type, date, signature, reference ] + x-conditional: [ additional ] + properties: + id: + type: string + format: uuid + description: Unique identifier of the AutoPay. + minLength: 36 + maxLength: 36 + example: "2972c13d-6315-4da3-80d7-64c24eb232ad" + type: + type: string + enum: + - AUTOPAY_CREATED + - AUTOPAY_UPDATED + - AUTOPAY_CANCELED + - AUTOPAY_TRANSACTION_FAILED + description: "Type of notified event. See more at [Webhook events](/autopay/contracts/webhook#event-types)." + date: + type: string + format: date-time + description: Date and time when the event was triggered for the first time, in ISO 8601 format. + example: "2025-09-29T17:09:29-05:00" + signature: + type: string + description: Digital signature of the webhook payload for validation. See more at [Webhook validation](/autopay/contracts/webhook#validating-webhooks). + example: "sha256:a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s" + reference: + type: string + description: AutoPay reference provided by the client/merchant. This reference must be unique and active per merchant. + example: "ACC00012345" + maxLength: 32 + additional: + type: object + description: Object containing relevant information to identify the AutoPay and event-related details. + x-conditional: + transactionID + properties: + transactionID: + type: string + minLength: 32 + description: Executed payment identifier. It may be present when the event is AUTOPAY_TRANSACTION_FAILED. + example: "CFed8XTioVhyG3CGHhJrpgpyM8k1phj3" + + Status: + title: Status + type: object + description: Structure used to define response statuses. + x-internal: false + properties: + status: + type: string + enum: + - OK + - FAILED + - REJECTED + description: Request status. + reason: + type: string + enum: + - 100 + - 101 + - 102 + - 103 + - 104 + - '00' + - BR + - X3 + - XH + - ?- + - '05' + - NF + description: Reason code of the request status. (See [Reason codes](/autopay/codes)) + example: '00' + message: + type: string + description: Message clarifying the status. + example: "Successful response" + date: + type: string + format: date-time + description: Date and time when the response was generated. + example: "2025-09-29T17:09:29-05:00" + required: + - status + - reason + - message + + StatusAutoPay: + title: Status + type: object + description: Structure used to define the AutoPay status. + x-internal: false + properties: + status: + type: string + enum: [ APPROVED, REJECTED, FAILED ] + example: APPROVED + description: AutoPay status. + reason: + type: string + enum: + - 100 + - 101 + - 102 + - 103 + - 104 + - '00' + - BR + - X3 + - XH + - ?- + - '05' + - NF + description: Reason code of the request status. (See [Reason codes](/autopay/codes)) + example: '00' + message: + type: string + description: Message clarifying the status. + example: "Successful response" + date: + type: string + format: date-time + description: Date and time when the response was generated. + example: "2025-09-29T17:09:29-05:00" + required: + - status + - reason + - message + + Pagination: + title: Pagination + type: object + description: Structure containing pagination information. + required: + - total + - perPage + - currentPage + - lastPage + properties: + total: + type: integer + example: 30 + minimum: 1 + description: Total number of records found in the query. + perPage: + type: integer + default: 15 + example: 10 + minimum: 1 + description: Number of records per page. + currentPage: + type: integer + default: 1 + minimum: 1 + example: 1 + description: Current page. + lastPage: + type: integer + minimum: 1 + example: 1 + description: Last available page. + + Locale: + type: "string" + description: "Response language." + example: "es_ES" + + PaginationRequest: + title: Pagination + type: object + description: Structure containing pagination information. + properties: + perPage: + type: integer + default: 15 + example: 10 + minimum: 1 + description: Number of records per page. + currentPage: + type: integer + default: 1 + minimum: 1 + example: 1 + description: Current page. + + Authentication: + required: + - login + - tranKey + - nonce + - seed + title: "Authentication" + type: "object" + properties: + login: + type: "string" + description: Site identifier. + tranKey: + type: "string" + description: Generated **tranKey** credential. See more at [Authentication](/autopay/authentication/#how-to-generate-your-authentication) + nonce: + type: "string" + description: Random - value for each request encoded in **Base64**. + seed: + type: "string" + description: Current - date generated in **ISO 8601** format. + description: > + Structure containing the *site* authentication information generated according to the WSSE + UsernameToken Profile 1.1. See more at [Authentication](/autopay/authentication). + + RedirectRequest: + title: CreateSessionRequest + type: object + description: | + Information required to create a session. + required: + - auth + - ipAddress + - userAgent + - returnUrl + properties: + auth: + $ref: '#/components/schemas/Authentication' + type: + type: string + description: | + Parameter used for additional session types. + Use `autopay` to generate an AutoPay session. + enum: + - autopay + example: autopay + autopay: + $ref: '../checkout/en.yaml#/components/schemas/AutopayRequest' + x-conditional: + - id + ipAddress: + $ref: '../checkout/en.yaml#/components/schemas/IpAddress' + userAgent: + $ref: '../checkout/en.yaml#/components/schemas/UserAgent' + returnUrl: + $ref: '../checkout/en.yaml#/components/schemas/ReturnUrl' + locale: + $ref: '../checkout/en.yaml#/components/schemas/Locale' + + RedirectInformation: + title: RedirectInformation + type: object + description: | + Response structure for a transaction information request. + properties: + status: + $ref: '#/components/schemas/Status' + requestId: + type: string + example: 1 + description: Request identifier. + request: + $ref: '../checkout/en.yaml#/components/schemas/RedirectRequest' + autopay: + oneOf: + - type: array + title: "array[Autopay]" + items: + $ref: '../checkout/en.yaml#/components/schemas/Autopay' + payment: + type: array + items: + $ref: '../checkout/en.yaml#/components/schemas/Transaction' + subscription: + $ref: '../checkout/en.yaml#/components/schemas/SubscriptionResponse' diff --git a/src/assets/apis/autopay/es.yaml b/src/assets/apis/autopay/es.yaml index 99b94a16f..6846b22e8 100644 --- a/src/assets/apis/autopay/es.yaml +++ b/src/assets/apis/autopay/es.yaml @@ -114,20 +114,20 @@ paths: example: APPROVED description: Estado del autopago. Solo se asentarán los pagos aprobados. reason: - type: string - enum: - - '00' - description: Razón del estado de la petición. (consulte en [Códigos de razón](/autopay/codes)) - example: '00' + type: string + enum: + - '00' + description: Razón del estado de la petición. (consulte en [Códigos de razón](/autopay/codes)) + example: '00' message: - type: string - description: Mensaje para aclarar el estado. - example: "Respuesta satisfactoria" + type: string + description: Mensaje para aclarar el estado. + example: "Respuesta satisfactoria" date: - type: string - format: date-time - description: Fecha y hora en la que se generó la respuesta. - example: "2025-09-29T17:09:29-05:00" + type: string + format: date-time + description: Fecha y hora en la que se generó la respuesta. + example: "2025-09-29T17:09:29-05:00" required: - status - reason @@ -203,6 +203,7 @@ paths: - "banco_bogota" - "ebt" - "alia" + - "deuna" franchiseName: type: "string" description: "Nombre mostrado de la franquicia." @@ -265,6 +266,14 @@ paths: - "ATH-MOVIL" - "EBUS" - "BANCOLOMBIA" + - "PAGOEFECTIVO" + - "PROCESA" + - "TELERED" + - "AVAL" + - "DILO" + - "BANCO_BOGOTA" + - "BANET" + - "DEUNA" discount: type: "string" description: "Información de descuento aplicada (si existe)." @@ -352,9 +361,11 @@ paths: maxLength: 32 id: $ref: '#/components/schemas/AutoPayId' + nullable: true chargeTypes: type: array description: Filtrar por uno o varios tipos de cargo. + example: "['FIXED', 'TOTAL_BALANCE']" items: $ref: '#/components/schemas/ChargeType' status: @@ -366,7 +377,7 @@ paths: - FAILED - REJECTED - APPROVED - example: [ "APPROVED"] + example: "[ 'APPROVED' ]" createdAt: type: object description: Rango de fechas de creación (ISO 8601, solo fecha). @@ -374,9 +385,12 @@ paths: from: type: string example: "2025-09-01" + format: date Y-m-d + to: type: string example: "2025-09-30" + format: date Y-m-d pagination: $ref: '#/components/schemas/PaginationRequest' locale: @@ -479,7 +493,7 @@ paths: - REJECTED - APPROVED - APPROVED_PARCIAL - example: [ "APPROVED" ] + example: "[ 'APPROVED' ]" amount: type: "object" description: "Estructura que contiene la información acerca del pago de la transacción." @@ -516,9 +530,11 @@ paths: from: type: string example: "2025-09-01" + format: date Y-m-d to: type: string example: "2025-09-30" + format: date Y-m-d pagination: $ref: '#/components/schemas/PaginationRequest' locale: @@ -539,10 +555,73 @@ paths: description: Lista de transacciones del autopago que cumplen con los criterios de búsqueda. type: array items: - title: Transaction $ref: '../base/es.yaml#/components/schemas/Transaction' pagination: $ref: '#/components/schemas/Pagination' + /autopay/session: + post: + summary: Crear sesión (CreateRequest) + operationId: post-autopay-session + description: Solicita la creación de la sesión, retorna el identificador y la URL de procesamiento. + x-internal: false + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RedirectRequest' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + status: + $ref: '#/components/schemas/Status' + requestId: + type: integer + processUrl: + type: string + '401': + description: Unauthorized + content: + application/json: + schema: + type: object + properties: + status: + $ref: '#/components/schemas/Status' + /autopay/session/{requestId}: + parameters: + - schema: + type: string + name: requestId + in: path + required: true + post: + summary: Consultar sesión (getSessionInformation) + operationId: post-autopay-session-requestId + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/RedirectInformation' + description: | + Obtiene la información de la sesión, si en la sesión hay transacciones se muestra el detalle de las mismas. + requestBody: + content: + application/json: + schema: + type: object + required: + - auth + properties: + auth: + $ref: '#/components/schemas/Authentication' + components: schemas: AutoPay: @@ -573,9 +652,11 @@ components: type: "string" minLength: 1 maxLength: 32 + description: Referencia description: type: "string" maxLength: 250 + description: Descripción amount: $ref: "../base/es.yaml#/components/schemas/Amount" description: | @@ -595,12 +676,8 @@ components: properties: customerAccountNumber: type: string + description: Identificador único que el comercio asigna a un cliente para identificar su cuenta interna example: "12345" - acceptedAt: - type: string - format: date-time - description: Fecha en la que el usuario aceptó el AutoPago. - example: "2021-09-24T10:02:17-05:00" createdAt: type: string format: date-time @@ -617,6 +694,7 @@ components: - TOTAL_BALANCE - MINIMUM_BALANCE - FIXED + example: TOTAL_BALANCE description: Tipo de cargo del autopago. Ver más en [Tipos de cargo](/autopay/charge-types). AutoPayId: type: string @@ -648,20 +726,15 @@ components: description: Número máximo de períodos a cobrar. minimum: 1 example: 12 - startDate: - type: string - format: date-time - description: Fecha en la iniciará o inició la recurrencia. - example: "2021-09-24" dueDate: type: string - format: date + format: date Y-m-d description: Fecha de vencimiento de la recurrencia example: '2019-09-24' nextPayment: type: string description: Fecha a partir de la cual inicia el cobro. - format: date + format: date Y-m-d example: "2025-11-30" WebhookEvent: type: object @@ -867,4 +940,63 @@ components: type: "string" description: Fecha **actual**, la cual se genera en formato **ISO 8601**. description: "Estructura que contiene la información de autenticación del *sitio* generada de acuerdo al WSSE - UsernameToken Profile 1.1. Ver más en [Autenticación](/autopay/authentication)." \ No newline at end of file + UsernameToken Profile 1.1. Ver más en [Autenticación](/autopay/authentication)." + RedirectRequest: + title: CreateSessionRequest + type: object + description: | + Información para crear una sesión. + required: + - auth + - ipAddress + - userAgent + - returnUrl + properties: + auth: + $ref: '#/components/schemas/Authentication' + type: + type: string + description: | + Parámetro usado para sesiones de tipos adicionales + Usar `autopay` para generar una sesión de Autopago. + enum: + - autopay + example: autopay + autopay: + $ref: '../checkout/es.yaml#/components/schemas/AutopayRequest' + x-conditional: + - id + ipAddress: + $ref: '../checkout/es.yaml#/components/schemas/IpAddress' + userAgent: + $ref: '../checkout/es.yaml#/components/schemas/UserAgent' + returnUrl: + $ref: '../checkout/es.yaml#/components/schemas/ReturnUrl' + locale: + $ref: '../checkout/es.yaml#/components/schemas/Locale' + RedirectInformation: + title: RedirectInformation + type: object + description: | + Estructura de respuesta a una solicitud para una información de transacción. + properties: + status: + $ref: '#/components/schemas/Status' + requestId: + type: string + example: 1 + description: Id de la petición + request: + $ref: '../checkout/es.yaml#/components/schemas/RedirectRequest' + autopay: + oneOf: + - type: array + title: "array[Autopay]" + items: + $ref: '../checkout/es.yaml#/components/schemas/Autopay' + payment: + type: array + items: + $ref: '../checkout/es.yaml#/components/schemas/Transaction' + subscription: + $ref: '../checkout/es.yaml#/components/schemas/SubscriptionResponse' \ No newline at end of file diff --git a/src/assets/apis/base/es.yaml b/src/assets/apis/base/es.yaml index 623d825a6..2f5e33e0e 100644 --- a/src/assets/apis/base/es.yaml +++ b/src/assets/apis/base/es.yaml @@ -244,6 +244,11 @@ components: - "banco_bogota" - "ebt" - "alia" + - "dilo" + - "banco_bogota" + - "ebt" + - "alia" + - "deuna" franchiseName: type: "string" description: "Nombre mostrado de la franquicia." @@ -294,6 +299,7 @@ components: refunded: type: "boolean" description: "Indicador reembolsada." + example: false lastDigits: type: "string" description: "Últimos dígitos de cuenta." @@ -324,6 +330,14 @@ components: - "ATH-MOVIL" - "EBUS" - "BANCOLOMBIA" + - "PAGOEFECTIVO" + - "PROCESA" + - "TELERED" + - "AVAL" + - "DILO" + - "BANCO_BOGOTA" + - "BANET" + - "DEUNA" discount: type: "string" description: "Información de descuento aplicada (si existe)." @@ -403,6 +417,7 @@ components: refunded: type: "boolean" description: "Dispersión reembolsada." + example: false paymentMethod: type: "string" description: "Código del método de pago." diff --git a/src/constants/navigations.js b/src/constants/navigations.js index 3eec8fb08..71577839c 100644 --- a/src/constants/navigations.js +++ b/src/constants/navigations.js @@ -2285,7 +2285,71 @@ export const TAB_NAVIGATION = { ], }, ], - [LANGUAGES_CODES.EN]: [], + [LANGUAGES_CODES.EN]: [ + { + title: 'Documentation', + identifier: 'autopay', + href: '/en/autopay', + icon: Book, + links: [ + { + title: '', + links: [ + { title: 'Introduction', href: '/autopay' }, + { title: 'Authentication', href: '/autopay/authentication' }, + { title: 'Response Codes', href: '/autopay/codes' }, + { title: 'AutoPay Charges', href: '/autopay/charge-types' }, + { title: 'Contract Authentication', href: '/autopay/contract-authentication' }, + ], + }, + ], + }, + { + title: 'API', + identifier: '/autopay/api', + href: '/en/autopay/api', + icon: DocumentCode, + links: [ + { + title: 'General', + links: [ + { title: 'Introduction', href: '/autopay/api' }, + ] + }, + { + title: 'API', + links: [ + { title: 'Create or Update an AutoPay Session', href: '/autopay/api/session' }, + { title: 'Cancel AutoPay', href: '/autopay/api/cancel' }, + { title: 'AutoPay Search', href: '/autopay/api/search' }, + { title: 'AutoPay Transactions', href: '/autopay/api/transactions' }, + ], + }, + ], + }, + { + title: 'Contracts', + identifier: '/autopay/contracts', + href: '/en/autopay/contracts', + icon: DocumentCode, + links: [ + { + title: 'Documents', + links: [ + { title: 'Introduction', href: '/autopay/contracts' }, + ], + }, + { + title: 'Services', + links: [ + { title: 'Get Charge Amount', href: '/autopay/contracts/balance' }, + { title: 'Settlement', href: '/autopay/contracts/settlement' }, + { title: 'Notifications (Webhook)', href: '/autopay/contracts/webhook' }, + ], + }, + ], + }, + ], }, selfdeclarations: { [LANGUAGES_CODES.ES]: [ diff --git a/src/pages/autopay/api/cancel.mdx b/src/pages/autopay/api/cancel.mdx index 96422e97b..e1b43cd32 100644 --- a/src/pages/autopay/api/cancel.mdx +++ b/src/pages/autopay/api/cancel.mdx @@ -72,7 +72,7 @@ Su función es cancelar/deshabilitar un autopago para que no se realicen los cob } ``` - ```json {{ title: '401: Autenticación fallida' }} + ```json {{ title: '400: Autenticación fallida' }} { "status": { "status": "FAILED", diff --git a/src/pages/autopay/api/search.mdx b/src/pages/autopay/api/search.mdx index bd618f708..1d9742fbf 100644 --- a/src/pages/autopay/api/search.mdx +++ b/src/pages/autopay/api/search.mdx @@ -107,14 +107,12 @@ Este servicio permite listar los AutoPagos registrados por un comercio y filtrar "type": "FIXED", "periodicity": "M", "interval": "1", - "startDate": "2025-08-24", "nextPayment": "2025-08-24", "dueDate": "2025-09-24", "maxPeriods": 2 }, }, "dueDay": "25", - "acceptedAt": "2021-09-24T10:02:17-05:00", "createdAt": "2021-09-24T10:02:17-05:00", "updatedAt": "2021-09-24T10:02:17-05:00" }, @@ -140,7 +138,6 @@ Este servicio permite listar los AutoPagos registrados por un comercio y filtrar "type": "TOTAL_BALANCE", "periodicity": "D", "interval": "1", - "startDate": "2025-08-24", "nextPayment": "2025-08-24", "dueDate": "2025-09-24", "maxPeriods": 1 @@ -149,14 +146,13 @@ Este servicio permite listar los AutoPagos registrados por un comercio y filtrar "additional": { "customerAccountNumber": "1232312323" }, - "acceptedAt": "2021-09-24T10:02:17-05:00", "createdAt": "2021-09-24T10:02:17-05:00", "updatedAt": "2021-09-24T10:02:17-05:00" } ] } ``` - ```json {{ title: '401: Autenticación fallida' }} + ```json {{ title: '400: Autenticación fallida' }} { "status": { "status": "FAILED", diff --git a/src/pages/autopay/api/session.mdx b/src/pages/autopay/api/session.mdx index bb685c482..8264c1f86 100644 --- a/src/pages/autopay/api/session.mdx +++ b/src/pages/autopay/api/session.mdx @@ -2,6 +2,9 @@ import { HeroPattern } from '@/components/HeroPattern' +export const apiRefs = ['/autopay/session','/autopay/session/{requestId}'] + + ## Crear o actualizar sessión de AutoPago {{ id: 'session-autopay', tag: 'POST', label: '/autopay/session' }} El flujo de creación y actualización de un autopago comienza con esta solicitud que genera una sessión. Este proceso permite configurar pagos programados y/o recurrentes de forma automatizada, proporcionando enlace para dirigirse a la interfaz gráfica para que el tarjeta habiente autorice el inicio o actualización del autopago y seleccione el medio de pago. @@ -18,6 +21,378 @@ El flujo de creación y actualización de un autopago comienza con esta solicitu 3. **Activación**: Una vez completado el proceso, recibirá una notificación mediante webhook indicando la creación del autopago. Alternativamente, puede consultar el estado usando el endpoint de consulta de sesión para verificar si el autopago ya está creado. - - Está api se encuentra en proceso de construcción. Una vez finalizada la misma, se actualizará la documentación con ejemplos de solicitud y respuesta. Por favor, contacta a soporte para más información. - \ No newline at end of file + + +--- + +## Crear una sesión {{ id: 'create-a-session', tag: 'POST', label: '/autopay/session' }} + + + + Este endpoint te permite crear una nueva sesión. En la sesión el usuario podrá completar una suscripción. + + + + + + + +```bash {{ title: 'Sesión para crear autopago - Monto Fijo' }} +curl -X "POST" https://test.placetopay.com/autopay/session \ + -H "Content-Type: application/json" \ + -d '{ + "auth": { + "login": "aabbccdd1234567890aabbccdd123456", + "tranKey": "ABC123example456trankey+789abc012def3456ABC=", + "nonce": "NjE0OWVkODgwYjNhNw==", + "seed": "2021-09-21T09:34:48-05:00" + }, + "type": "autopay", + "autopay": { + "action": "CREATE", + "reference": "12345", + "description": "Inscripción autopago monto fijo", + "dueDay": 15, + "recurring": { + "type": "FIXED", + "periodicity": "M", + "interval": "1", + "maxPeriods": 12, + "startDate": "2026-11-26", + "nextPayment": "2026-12-05", + "dueDate": "2027-11-26", + "notificationUrl": "https://merchant.test/notification", + }, + "amount": { + "currency": "USD", + "total": 100 + } + }, + "returnUrl": "https://merchant.test/return", + "ipAddress": "127.0.0.1", + "userAgent": "PlacetoPay Sandbox", + }' +``` + +```bash {{ title: 'Sesión para crear autopago - Monto Total' }} +curl -X "POST" https://test.placetopay.com/autopay/session \ + -H "Content-Type: application/json" \ + -d '{ + "auth": { + "login": "aabbccdd1234567890aabbccdd123456", + "tranKey": "ABC123example456trankey+789abc012def3456ABC=", + "nonce": "NjE0OWVkODgwYjNhNw==", + "seed": "2021-09-21T09:34:48-05:00" + }, + "type": "autopay", + "autopay": { + "action": "CREATE", + "reference": "12345", + "description": "Inscripción autopago monto fijo", + "dueDay": 15 + "recurring": { + "type": "TOTAL_BALANCE", + "periodicity": "M", + "interval": "1", + "maxPeriods": 12, + "startDate": "2026-11-26", + "nextPayment": "2026-12-05", + "dueDate": "2027-11-26", + "notificationUrl": "https://merchant.test/notification", + } + }, + "returnUrl": "https://merchant.test/return", + "ipAddress": "127.0.0.1", + "userAgent": "PlacetoPay Sandbox", + }' +``` + +```bash {{ title: 'Sesión para crear autopago - Monto Mínimo' }} +curl -X "POST" https://test.placetopay.com/autopay/session \ + -H "Content-Type: application/json" \ + -d '{ + "auth": { + "login": "aabbccdd1234567890aabbccdd123456", + "tranKey": "ABC123example456trankey+789abc012def3456ABC=", + "nonce": "NjE0OWVkODgwYjNhNw==", + "seed": "2021-09-21T09:34:48-05:00" + }, + "type": "autopay", + "autopay": { + "action": "CREATE", + "reference": "12345", + "description": "Inscripción autopago monto fijo", + "dueDay": 15 + "recurring": { + "type": "MINIMUM_BALANCE", + "periodicity": "M", + "interval": "1", + "maxPeriods": 12, + "startDate": "2026-11-26", + "nextPayment": "2026-12-05", + "dueDate": "2027-11-26", + "notificationUrl": "https://merchant.test/notification", + } + }, + "returnUrl": "https://merchant.test/return", + "ipAddress": "127.0.0.1", + "userAgent": "PlacetoPay Sandbox", + }' +``` + +```bash {{ title: 'Sesión para editar autopago' }} +curl -X "POST" https://test.placetopay.com/autopay/session \ + -H "Content-Type: application/json" \ + -d '{ + "auth": { + "login": "aabbccdd1234567890aabbccdd123456", + "tranKey": "ABC123example456trankey+789abc012def3456ABC=", + "nonce": "NjE0OWVkODgwYjNhNw==", + "seed": "2021-09-21T09:34:48-05:00" + }, + "type": "autopay", + "autopay": { + "action": "EDIT", + "reference": "12345", + "description": "Inscripción autopago monto fijo", + "id": "f7b347d7-c922-4c68-8750-99fb43c9e5ff" + }, + "returnUrl": "https://merchant.test/return", + "ipAddress": "127.0.0.1", + "userAgent": "PlacetoPay Sandbox", + }' +``` + + + + + + + + + + +
+ +```json {{ title: '200' }} +{ + "status": { + "status": "OK", + "reason": "PC", + "message": "La petición se ha procesado correctamente", + "date": "2021-11-30T15:08:27-05:00" + }, + "requestId": 1, + "processUrl": "https://checkout-co.placetopay.com/session/1/cc9b8690b1f7228c78b759ce27d7e80a", +} +``` +```json {{ title: '400' }} +{ + "status": { + "status": "FAILED", + "reason": 401, + "message": "Autenticación fallida 102", + "date": "2021-11-30T15:12:25-05:00" + }, +} +``` + + +
+ + +--- + +--- + +## Consultar una sesión {{ id: 'query-a-session', tag: 'POST', label: '/autopay/session/:requestId' }} + + + + Este endpoint te permite obtener la información de la sesión, si en la sesión hay transacciones se muestra el detalle de las mismas. + + + + + +
+ + + + + + + + +```bash {{ title: 'cURL' }} +curl -X "POST" https://test.placetopay.com/autopay/session/000000 \ + -H "Content-Type: application/json" \ + -d '{ + "auth": { + "login": "aabbccdd1234567890aabbccdd123456", + "tranKey": "ABC123example456trankey+789abc012def3456ABC=", + "nonce": "NjE0OWVkODgwYjNhNw==", + "seed": "2021-09-21T09:34:48-05:00" + } + }' +``` + + + + + + + + + + +
+ + +```json {{ title: '200: Autopago Registrado'}} +{ + "status": { + "status": "APPROVED", + "reason": "00", + "message": "La petición ha sido aprobada exitosamente", + "date": "2022-07-27T14:51:27-05:00" + }, + "requestId": 100, + "request": { + "locale": "es_CO", + "payer": { + "document": "111111111", + "documentType": "CC", + "name": "Antonino", + "surname": "Pan y queso", + "email": "root13@app.com", + "mobile": "+573111111111" + }, + "type": "autopay", + "autopay": { + "action": "CREATE", + "reference": "12345", + "description": "Inscripción autopago monto fijo", + "recurring": { + "type": "FIXED", + "periodicity": "M", + "interval": "1", + "maxPeriods": 12, + "startDate": "2026-11-26", + "nextPayment": "2026-12-05", + "dueDate": "2027-11-26", + "notificationUrl": "https://merchant.test/notification", + }, + "dueDay": 15, + "amount": { + "currency": "USD", + "total": 100 + } + }, + "fields": [ + { + "keyword": "customerAccountNumber", + "value": "112233", + "displayOn": "none" + } + ], + "returnUrl": "https://mysite.com/response/32120", + "ipAddress": "127.0.0.1", + "userAgent": "PlacetoPay Sandbox", + "expiration": "2023-03-09T23:28:43.775Z" + }, + "autopay": [ + { + "status": { + "status": "APPROVED", + "reason": "00", + "date":"2023-06-21T09:56:06-05:00" + }, + "siteId": "100200300", + "id": "328eb09a-363f-48a6-a16e-51c5a58b89ec", + "buyer": null, + "payer": { + "document": "111111111", + "documentType": "CC", + "name": "Antonino", + "surname": "Pan y queso", + "email": "root13@app.com", + "mobile": "+573111111111" + }, + "subscription": { + "reference": "12345", + "description": "Inscripción autopago monto fijo", + "amount": { + "currency": "USD", + "total": 100 + }, + "recurring": { + "type": "FIXED", + "periodicity": "M", + "interval": "1", + "maxPeriods": 12, + "startDate": "2026-11-26", + "nextPayment": "2026-12-05", + "dueDate": "2027-11-26", + "notificationUrl": "https://merchant.test/notification", + }, + }, + "instrument": { + "token": { + "token": "faketoken12f233bd8f5d42138d681bf07ea8295429df07a4af287703e30c891", + "subtoken": "fakesubtoken00000", + "franchise": "master", + "franchiseName": "Mastercard", + "lastDigits": "0000", + "validUntil": "2018-12-31" + } + }, + "additional": { + "customerAccountNumber": "1232312323", + "dueDay": "25", + }, + "acceptedAt": "2021-09-24T10:02:17-05:00" + }, + ], + "payment": null, + "subscription": null, +} +``` + +```json {{ title: '401' }} +{ + "status": { + "status": "FAILED", + "reason": 401, + "message": "Autenticación fallida 102", + "date": "2021-11-30T15:12:25-05:00" + }, +} +``` + + +
+ +--- \ No newline at end of file diff --git a/src/pages/autopay/api/transactions.mdx b/src/pages/autopay/api/transactions.mdx index cc2bcddbd..ae4452c79 100644 --- a/src/pages/autopay/api/transactions.mdx +++ b/src/pages/autopay/api/transactions.mdx @@ -204,7 +204,7 @@ Este servicio permite listar las transacciones de un AutoPago y filtrarlas segú ] } ``` - ```json {{ title: '401: Autenticación fallida' }} + ```json {{ title: '400: Autenticación fallida' }} { "status": { "status": "FAILED", diff --git a/src/pages/autopay/contracts/balance.mdx b/src/pages/autopay/contracts/balance.mdx index 9fd26c2df..24e877829 100644 --- a/src/pages/autopay/contracts/balance.mdx +++ b/src/pages/autopay/contracts/balance.mdx @@ -31,17 +31,16 @@ export const apiRefs = ['/autopay/balance'] /> - - ```bash {{ title: 'Obtener balance' }} - curl -X "POST" {{baseURl}}/autopay/balance \ - -H "Content-Type: application/json" \ - -H "Authorization: Basic " \ - -d '{ + + ```bash {{ title: 'Obtener balance' }} + curl -X "POST" {{baseURl}}/autopay/balance \ + -H "Content-Type: application/json" \ + -H "Authorization: Basic " \ + -d '{ "reference": "ACC00012345", "id": "2972c13d-6315-4da3-80d7-64c24eb232ad" - } - ' - ``` + }' + ``` @@ -87,7 +86,7 @@ export const apiRefs = ['/autopay/balance'] } } ``` - ```json {{ title: '401: Autenticación invalida' }} + ```json {{ title: '400: Autenticación invalida' }} { "status": { "status": "FAILED", @@ -97,7 +96,7 @@ export const apiRefs = ['/autopay/balance'] } } ``` - ```json {{ title: '401: Autenticación invalida - Credenciales incorrectas' }} + ```json {{ title: '400: Autenticación invalida - Credenciales incorrectas' }} { "status": { "status": "FAILED", diff --git a/src/pages/autopay/contracts/settlement.mdx b/src/pages/autopay/contracts/settlement.mdx index 885226421..096188132 100644 --- a/src/pages/autopay/contracts/settlement.mdx +++ b/src/pages/autopay/contracts/settlement.mdx @@ -120,7 +120,7 @@ curl -X POST {{baseURl}}/autopay/settlement \ } } ``` -```json {{ title: '401: Autenticación invalida' }} +```json {{ title: '400: Autenticación invalida' }} { "status": { "status": "FAILED", @@ -130,7 +130,7 @@ curl -X POST {{baseURl}}/autopay/settlement \ } } ``` -```json {{ title: '401: Autenticación invalida - Credenciales incorrectas' }} +```json {{ title: '400: Autenticación invalida - Credenciales incorrectas' }} { "status": { "status": "FAILED", diff --git a/src/pages/en/autopay/api/cancel.mdx b/src/pages/en/autopay/api/cancel.mdx new file mode 100644 index 000000000..bf98a9aa9 --- /dev/null +++ b/src/pages/en/autopay/api/cancel.mdx @@ -0,0 +1,87 @@ +import { HeroPattern } from '@/components/HeroPattern' + + + +export const apiRefs = ['/autopay/cancel'] + +## Cancel an AutoPay {{ id: 'cancel-autopay', tag: 'POST', label: '/autopay/cancel'}} +Its purpose is to cancel/disable an autopay so that previously scheduled automatic/recurring charges are not executed. + + Once the autopay is canceled, it cannot be reactivated. If an autopay is needed again, a new one must be created. + + + + + + +
+ + ```bash {{ title: 'cURL' }} + curl -X "POST" {{baseURl}}/autopay/cancel \ + -H "Content-Type: application/json" \ + -d '{ + "auth": { + "login":"aabbccdd1234567890aabbccdd123456", + "tranKey":"ABC123example456trankey+789abc012def3456ABC=", + "nonce":"enQ4dXh3YWhkMWM=", + "seed":"2023-06-21T09:56:06-05:00" + }, + "id": "ac1cc9ce-83fe-42d7-9708-f6dd5461c89e", + "locale": "es_ES" + }' + ``` + + +
+ + + + + + +
+ + ```json {{ title: '200' }} + { + "status": { + "status": "OK", + "reason": "00", + "description": "The request has been processed successfully", + "date":"2023-06-21T09:56:06-05:00" + }, + "id": "ac1cc9ce-83fe-42d7-9708-f6dd5461c89e", + } + ``` + ```json {{ title: '400: Failed response' }} + { + "status": { + "status": "FAILED", + "reason": "BR", + "message": "The id field is required.", + "date":"2023-06-21T09:56:06-05:00" + } + } + ``` + + ```json {{ title: '400: Authentication failed' }} + { + "status": { + "status": "FAILED", + "reason": "401", + "message": "authentication does not contain all required parameters (login, tranKey, seed, nonce)", + "date": "2021-09-21T09:34:48-05:00" + } + } + ``` + + +
diff --git a/src/pages/en/autopay/api/index.mdx b/src/pages/en/autopay/api/index.mdx new file mode 100644 index 000000000..7f696102a --- /dev/null +++ b/src/pages/en/autopay/api/index.mdx @@ -0,0 +1,9 @@ +import { HeroPattern } from '@/components/HeroPattern' + + + +## API to Integrate with AutoPay + +To operate AutoPay end to end, AutoPay exposes a set of endpoints so that the client/merchant can interact with them and perform actions on their users’ autopays, such as creation, retrieval, update, and deactivation. + +In this section, you can find more information about the APIs and examples for each of the services. diff --git a/src/pages/en/autopay/api/search.mdx b/src/pages/en/autopay/api/search.mdx new file mode 100644 index 000000000..f3be1d5a2 --- /dev/null +++ b/src/pages/en/autopay/api/search.mdx @@ -0,0 +1,167 @@ +import { HeroPattern } from '@/components/HeroPattern' + + + +export const apiRefs = ['/autopay/search'] + +## AutoPay Search {{ id: 'search-autopay', tag: 'POST', label: '/autopay/search' }} +This service allows listing the AutoPays registered by a merchant and filtering them according to operational and audit criteria. It is intended for administrative queries, reconciliation, and monitoring of the autopay contract lifecycle. + + + + + + +
+ + ```bash {{ title: 'General' }} + curl -X "POST" {{baseURl}}/autopay/search \ + -H "Content-Type: application/json" \ + -d '{ + "auth": { + "login":"aabbccdd1234567890aabbccdd123456", + "tranKey":"ABC123example456trankey+789abc012def3456ABC=", + "nonce":"enQ4dXh3YWhkMWM=", + "seed":"2023-06-21T09:56:06-05:00" + }, + "filters": { + "reference": "PAYMENT_1", + "id": "328eb09a-363f-48a6-a16e-51c5a58b89ec", + "chargeTypes": ["FIXED", "TOTAL_BALANCE"], + "status": ["APPROVED", "REJECTED"], + "createdAt": { + "from": "2025-09-01", + "to": "2025-09-30" + } + }, + "pagination": { + "perPage": 15, + "currentPage": 1 + }, + "locale": "es_ES" + }' + ``` + + +
+ + + + + + +
+ + ```json {{ title: '200' }} + { + "status": { + "status": "OK", + "reason": "00", + "description": "The request has been processed successfully", + "date":"2023-06-21T09:56:06-05:00" + }, + "pagination": { + "total": 3, + "perPage": 15, + "currentPage": 1, + "lastPage": 1 + }, + "data": [ + { + "status": { + "status": "APPROVED", + "reason": "00", + "date":"2023-06-21T09:56:06-05:00" + }, + "id": "328eb09a-363f-48a6-a16e-51c5a58b89ec", + "payer": { + "document": "911111111", + "documentType": "CC", + "name": "john", + "surname": "doe", + "email": "john@doe.com", + "mobile": "+573111111111" + }, + "buyer": { + "name": "john", + "surname": "doe", + "email": "john@doe.com", + }, + "subscription": { + "reference": "12345", + "description": "Example description", + "amount": { + "currency": "USD", + "total": 10 + }, + "recurring": { + "type": "FIXED", + "periodicity": "M", + "interval": "1", + "nextPayment": "2025-08-24", + "dueDate": "2025-09-24", + "maxPeriods": 2 + }, + }, + "dueDay": "25", + "createdAt": "2021-09-24T10:02:17-05:00", + "updatedAt": "2021-09-24T10:02:17-05:00" + }, + { + "status": { + "status": "REJECTED", + "reason": "?C", + "date":"2023-06-21T09:56:06-05:00" + }, + "id": "328eb09a-363f-48a6-a16e-51c5a58b89ec", + "payer": { + "document": "911111111", + "documentType": "CC", + "name": "john", + "surname": "doe", + "email": "john@doe.com", + "mobile": "+573111111111" + }, + "subscription": { + "reference": "MyReference", + "description": "Example description", + "recurring": { + "type": "TOTAL_BALANCE", + "periodicity": "D", + "interval": "1", + "nextPayment": "2025-08-24", + "dueDate": "2025-09-24", + "maxPeriods": 1 + }, + }, + "additional": { + "customerAccountNumber": "1232312323" + }, + "createdAt": "2021-09-24T10:02:17-05:00", + "updatedAt": "2021-09-24T10:02:17-05:00" + } + ] + } + ``` + ```json {{ title: '400: Authentication failed' }} + { + "status": { + "status": "FAILED", + "reason": "401", + "message": "authentication does not contain all required parameters (login, tranKey, seed, nonce)", + "date": "2021-09-21T09:34:48-05:00" + } + } + ``` + + +
diff --git a/src/pages/en/autopay/api/session.mdx b/src/pages/en/autopay/api/session.mdx new file mode 100644 index 000000000..0b7ee3c43 --- /dev/null +++ b/src/pages/en/autopay/api/session.mdx @@ -0,0 +1,396 @@ +import { HeroPattern } from '@/components/HeroPattern' + + + +export const apiRefs = ['/autopay/session','/autopay/session/{requestId}'] + + +## Create or update an AutoPay session {{ id: 'session-autopay', tag: 'POST', label: '/autopay/session' }} + +The AutoPay creation and update flow begins with this request, which generates a session. This process allows configuring scheduled and/or recurring payments in an automated manner, providing a link to redirect to the graphical interface so that the cardholder can authorize the start or update of the autopay and select the payment method. + +## Creation flow + +1. **Initial request**: When the creation request is made, the system generates an AutoPay session and returns a redirect URL. + +2. **AutoPay interface**: The URL redirects the user to a graphical interface where they must: +- Accept the autopay terms and conditions +- Select their preferred payment method +- Complete the payment method subscription process +- Pass the required security validations + +3. **Activation**: Once the process is completed, you will receive a notification via webhook indicating the creation of the autopay. Alternatively, you can check the status using the session query endpoint to verify whether the autopay has already been created. + + + +--- + +## Create a session {{ id: 'create-a-session', tag: 'POST', label: '/autopay/session' }} + + + + This endpoint allows you to create a new session. Within the session, the user will be able to complete a subscription. + + + + + + +```bash {{ title: 'Session to create auto-payment - Fixed Amount' }} +curl -X "POST" https://test.placetopay.com/autopay/session \ + -H "Content-Type: application/json" \ + -d '{ + "auth": { + "login": "aabbccdd1234567890aabbccdd123456", + "tranKey": "ABC123example456trankey+789abc012def3456ABC=", + "nonce": "NjE0OWVkODgwYjNhNw==", + "seed": "2021-09-21T09:34:48-05:00" + }, + "type": "autopay", + "autopay": { + "action": "CREATE", + "reference": "12345", + "description": "Inscripción autopago monto fijo", + "dueDay": 15, + "recurring": { + "type": "FIXED", + "periodicity": "M", + "interval": "1", + "maxPeriods": 12, + "startDate": "2026-11-26", + "nextPayment": "2026-12-05", + "dueDate": "2027-11-26", + "notificationUrl": "https://merchant.test/notification", + }, + "amount": { + "currency": "USD", + "total": 100 + } + }, + "returnUrl": "https://merchant.test/return", + "ipAddress": "127.0.0.1", + "userAgent": "PlacetoPay Sandbox", + }' +``` + +```bash {{ title: 'Session to create auto-payment - Total Amount' }} +curl -X "POST" https://test.placetopay.com/autopay/session \ + -H "Content-Type: application/json" \ + -d '{ + "auth": { + "login": "aabbccdd1234567890aabbccdd123456", + "tranKey": "ABC123example456trankey+789abc012def3456ABC=", + "nonce": "NjE0OWVkODgwYjNhNw==", + "seed": "2021-09-21T09:34:48-05:00" + }, + "type": "autopay", + "autopay": { + "action": "CREATE", + "reference": "12345", + "description": "Inscripción autopago monto fijo", + "dueDay": 15 + "recurring": { + "type": "TOTAL_BALANCE", + "periodicity": "M", + "interval": "1", + "maxPeriods": 12, + "startDate": "2026-11-26", + "nextPayment": "2026-12-05", + "dueDate": "2027-11-26", + "notificationUrl": "https://merchant.test/notification", + } + }, + "returnUrl": "https://merchant.test/return", + "ipAddress": "127.0.0.1", + "userAgent": "PlacetoPay Sandbox", + }' +``` + +```bash {{ title: 'Session to create auto-payment - Minimum Amount' }} +curl -X "POST" https://test.placetopay.com/autopay/session \ + -H "Content-Type: application/json" \ + -d '{ + "auth": { + "login": "aabbccdd1234567890aabbccdd123456", + "tranKey": "ABC123example456trankey+789abc012def3456ABC=", + "nonce": "NjE0OWVkODgwYjNhNw==", + "seed": "2021-09-21T09:34:48-05:00" + }, + "type": "autopay", + "autopay": { + "action": "CREATE", + "reference": "12345", + "description": "Inscripción autopago monto fijo", + "dueDay": 15 + "recurring": { + "type": "MINIMUM_BALANCE", + "periodicity": "M", + "interval": "1", + "maxPeriods": 12, + "startDate": "2026-11-26", + "nextPayment": "2026-12-05", + "dueDate": "2027-11-26", + "notificationUrl": "https://merchant.test/notification", + } + }, + "returnUrl": "https://merchant.test/return", + "ipAddress": "127.0.0.1", + "userAgent": "PlacetoPay Sandbox", + }' +``` + +```bash {{ title: 'Session to edit self-checkout' }} +curl -X "POST" https://test.placetopay.com/autopay/session \ + -H "Content-Type: application/json" \ + -d '{ + "auth": { + "login": "aabbccdd1234567890aabbccdd123456", + "tranKey": "ABC123example456trankey+789abc012def3456ABC=", + "nonce": "NjE0OWVkODgwYjNhNw==", + "seed": "2021-09-21T09:34:48-05:00" + }, + "type": "autopay", + "autopay": { + "action": "EDIT", + "reference": "12345", + "description": "Inscripción autopago monto fijo", + "id": "f7b347d7-c922-4c68-8750-99fb43c9e5ff" + }, + "returnUrl": "https://merchant.test/return", + "ipAddress": "127.0.0.1", + "userAgent": "PlacetoPay Sandbox", + }' +``` + + + + + + + + + + +
+ +```json {{ title: '200' }} +{ + "status": { + "status": "OK", + "reason": "PC", + "message": "The request has been processed successfully", + "date": "2021-11-30T15:08:27-05:00" + }, + "requestId": 1, + "processUrl": "https://checkout-co.placetopay.com/session/1/cc9b8690b1f7228c78b759ce27d7e80a", +} +``` +```json {{ title: '400' }} +{ + "status": { + "status": "FAILED", + "reason": 401, + "message": "Autenticación fallida 102", + "date": "2021-11-30T15:12:25-05:00" + }, +} +``` + + +
+ + +--- + +--- + +## Query a session {{ id: 'query-a-session', tag: 'POST', label: '/autopay/session/:requestId' }} + + + + This endpoint allows you to obtain session information; if there are transactions in the session, the details of those transactions are displayed. + + + + +
+ + + + + + + + +```bash {{ title: 'cURL' }} +curl -X "POST" https://test.placetopay.com/autopay/session/000000 \ + -H "Content-Type: application/json" \ + -d '{ + "auth": { + "login": "aabbccdd1234567890aabbccdd123456", + "tranKey": "ABC123example456trankey+789abc012def3456ABC=", + "nonce": "NjE0OWVkODgwYjNhNw==", + "seed": "2021-09-21T09:34:48-05:00" + } + }' +``` + + + + + + + + + + +
+ + +```json {{ title: '200: Registered Self-Pay'}} +{ + "status": { + "status": "APPROVED", + "reason": "00", + "message": "La petición ha sido aprobada exitosamente", + "date": "2022-07-27T14:51:27-05:00" + }, + "requestId": 100, + "request": { + "locale": "es_CO", + "payer": { + "document": "111111111", + "documentType": "CC", + "name": "Antonino", + "surname": "Pan y queso", + "email": "root13@app.com", + "mobile": "+573111111111" + }, + "type": "autopay", + "autopay": { + "action": "CREATE", + "reference": "12345", + "description": "Inscripción autopago monto fijo", + "recurring": { + "type": "FIXED", + "periodicity": "M", + "interval": "1", + "maxPeriods": 12, + "startDate": "2026-11-26", + "nextPayment": "2026-12-05", + "dueDate": "2027-11-26", + "notificationUrl": "https://merchant.test/notification", + }, + "dueDay": 15, + "amount": { + "currency": "USD", + "total": 100 + } + }, + "fields": [ + { + "keyword": "customerAccountNumber", + "value": "112233", + "displayOn": "none" + } + ], + "returnUrl": "https://mysite.com/response/32120", + "ipAddress": "127.0.0.1", + "userAgent": "PlacetoPay Sandbox", + "expiration": "2023-03-09T23:28:43.775Z" + }, + "autopay": [ + { + "status": { + "status": "APPROVED", + "reason": "00", + "date":"2023-06-21T09:56:06-05:00" + }, + "siteId": "100200300", + "id": "328eb09a-363f-48a6-a16e-51c5a58b89ec", + "buyer": null, + "payer": { + "document": "111111111", + "documentType": "CC", + "name": "Antonino", + "surname": "Pan y queso", + "email": "root13@app.com", + "mobile": "+573111111111" + }, + "subscription": { + "reference": "12345", + "description": "Inscripción autopago monto fijo", + "amount": { + "currency": "USD", + "total": 100 + }, + "recurring": { + "type": "FIXED", + "periodicity": "M", + "interval": "1", + "maxPeriods": 12, + "startDate": "2026-11-26", + "nextPayment": "2026-12-05", + "dueDate": "2027-11-26", + "notificationUrl": "https://merchant.test/notification", + }, + }, + "instrument": { + "token": { + "token": "faketoken12f233bd8f5d42138d681bf07ea8295429df07a4af287703e30c891", + "subtoken": "fakesubtoken00000", + "franchise": "master", + "franchiseName": "Mastercard", + "lastDigits": "0000", + "validUntil": "2018-12-31" + } + }, + "additional": { + "customerAccountNumber": "1232312323", + "dueDay": "25", + }, + "acceptedAt": "2021-09-24T10:02:17-05:00" + }, + ], + "payment": null, + "subscription": null, +} +``` + +```json {{ title: '401' }} +{ + "status": { + "status": "FAILED", + "reason": 401, + "message": "Autenticación fallida 102", + "date": "2021-11-30T15:12:25-05:00" + }, +} +``` + + +
+ +--- \ No newline at end of file diff --git a/src/pages/en/autopay/api/transactions.mdx b/src/pages/en/autopay/api/transactions.mdx new file mode 100644 index 000000000..77e024435 --- /dev/null +++ b/src/pages/en/autopay/api/transactions.mdx @@ -0,0 +1,219 @@ +import { HeroPattern } from '@/components/HeroPattern' + + + +export const apiRefs = ['/autopay/transactions'] + +## AutoPay Transactions {{ id: 'transactions-autopay', tag: 'POST', label: '/autopay/transactions' }} +This service allows listing the transactions of an AutoPay and filtering them according to operational and audit criteria. It is intended for administrative queries, reconciliation, and monitoring of the autopay lifecycle. + + + + + + +
+ + ```bash {{ title: 'General' }} + curl -X "POST" {{baseURl}}/autopay/transactions \ + -H "Content-Type: application/json" \ + -d '{ + "auth": { + "login":"aabbccdd1234567890aabbccdd123456", + "tranKey":"ABC123example456trankey+789abc012def3456ABC=", + "nonce":"enQ4dXh3YWhkMWM=", + "seed":"2023-06-21T09:56:06-05:00" + }, + "id": "328eb09a-363f-48a6-a16e-51c5a58b89ec", + "filters": { + "internalReference": "123", + "status": ["APPROVED", "REJECTED"], + "amount": [ + "total": "10", + "currency": "USD" + ], + "createdAt": { + "from": "2025-09-01", + "to": "2025-09-30" + } + }, + "pagination": { + "perPage": 15, + "currentPage": 1 + }, + "locale": "es_ES" + }' + ``` + + +
+ + + + + + +
+ + ```json {{ title: '200' }} + { + "status": { + "status": "OK", + "reason": "00", + "description": "The request has been processed successfully", + "date":"2023-06-21T09:56:06-05:00" + }, + "pagination": { + "total": 2, + "perPage": 15, + "currentPage": 1, + "lastPage": 1 + }, + "data": [ + { + "status": { + "status": "APPROVED", + "reason": "00", + "message": "Approved", + "date": "2024-12-04T00:09:40-05:00" + }, + "date": "2021-09-24T10:02:17-05:00", + "transactionDate": "2021-09-24T10:02:18-05:00", + "internalReference": 230364, + "reference": "800166551", + "paymentMethod": "ID_DN", + "franchise": "diners", + "franchiseName": "Diners", + "issuerName": "Diners", + "amount": { + "currency": "USD", + "total": 120 + }, + "conversion": { + "from": { + "currency": "USD", + "total": 120 + }, + "to": { + "currency": "USD", + "total": 120 + }, + "factor": 1 + }, + "authorization": "999999", + "receipt": "230364", + "type": "AUTH_ONLY", + "refunded": false, + "lastDigits": "0008", + "provider": "INTERDIN", + "discount": null, + "processorFields": { + "id": "cf3e77878a07d6e3ee667c60081dc39d", + "b24": "00" + }, + "additional": { + "merchantCode": "1065152", + "terminalNumber": "00990099", + "credit": { + "code": 1, + "type": "03", + "groupCode": "X", + "installments": 3 + }, + "totalAmount": 120, + "interestAmount": 0, + "installmentAmount": 40, + "iceAmount": 0, + "batch": null, + "line": null, + "bin": "365454", + "expiration": "1122" + }, + "notificationURL": "https://test.placetopay.ec/redirection/api/notify" + }, + { + "status": { + "status": "APPROVED", + "reason": "00", + "message": "Approved", + "date": "2025-01-24T00:09:40-05:00" + }, + "date": "2025-01-24T10:02:17-05:00", + "transactionDate": "2025-01-24T10:02:17-05:00", + "internalReference": 230389, + "reference": "800166551", + "paymentMethod": "ID_DN", + "franchise": "diners", + "franchiseName": "Diners", + "issuerName": "Diners", + "amount": { + "currency": "USD", + "total": 120 + }, + "conversion": { + "from": { + "currency": "USD", + "total": 120 + }, + "to": { + "currency": "USD", + "total": 120 + }, + "factor": 1 + }, + "authorization": "999999", + "receipt": "230364", + "type": "AUTH_ONLY", + "refunded": false, + "lastDigits": "0008", + "provider": "INTERDIN", + "discount": null, + "processorFields": { + "id": "cf3e77878a07d6e3ee667c60081dc39d", + "b24": "00" + }, + "additional": { + "merchantCode": "1065152", + "terminalNumber": "00990099", + "credit": { + "code": 1, + "type": "03", + "groupCode": "X", + "installments": 3 + }, + "totalAmount": 120, + "interestAmount": 0, + "installmentAmount": 40, + "iceAmount": 0, + "batch": null, + "line": null, + "bin": "365454", + "expiration": "1122" + }, + "notificationURL": "https://test.placetopay.ec/redirection/api/notify" + } + ] + } + ``` + ```json {{ title: '400: Authentication failed' }} + { + "status": { + "status": "FAILED", + "reason": "401", + "message": "authentication does not contain all required parameters (login, tranKey, seed, nonce)", + "date": "2021-09-21T09:34:48-05:00" + } + } + ``` + + +
diff --git a/src/pages/en/autopay/authentication.mdx b/src/pages/en/autopay/authentication.mdx new file mode 100644 index 000000000..0e6b69bff --- /dev/null +++ b/src/pages/en/autopay/authentication.mdx @@ -0,0 +1,144 @@ +import { HeroPattern } from '@/components/HeroPattern' + + + +# Authentication + +To interact with the AutoPay API, you must authenticate your requests. This allows us to identify and validate the information so your operations remain secure. The API uses *Web Services Security UsernameToken Profile 1.1*. + +## API Credentials + +To integrate with AutoPay, you must have the consumer credentials: `login` and `secretKey`. + +- **login:** Site identifier. It can be considered public, as it is sent as plain data in API requests. +- **secretKey:** Site secret key. This must remain private. A new `tranKey` will be generated from this value and sent with each request. + + + These credentials belong to the site and must be handled securely. Do not share your credentials in public-access areas such as GitHub, client-side code, or other locations easily accessible to third parties. + + +## Authentication Object {{ id: 'authentication-object' }} + +The `auth` parameter must be sent in all API requests and contains the set of properties required to verify authentication. + + + + + + Identificador del sitio + + + Credencial tranKey generado. A continuación se explica en detalle. + + + Valor aleatorio para cada solicitud codificado en Base64. + + + Fecha actual, la cual se genera en formato ISO 8601. + + + + + + ```json {{ 'title': 'Autenticación de Ejemplo' }} + { + "auth": { + "login":"aabbccdd1234567890aabbccdd123456", + "tranKey":"ABC123example456trankey+789abc012def3456ABC=", + "nonce":"enQ4dXh3YWhkMWM=", + "seed":"2023-06-21T09:56:06-05:00" + }, + ... + } + + ``` + + + + + +## How to generate your authentication {{ id: 'how-to-generate-your-authentication' }} + +You must know and prepare the following data: + +**login:** The `login` credential provided when starting your integration. Site identifier. + +**secretKey:** The `secretKey` credential provided when starting your integration. Site secret key. + +**seed:** The date when the authentication was generated. The date must be in ISO 8601 format. +Example: `2023-06-21T09:56:06-05:00` + +**nonce:** An arbitrary value that uniquely identifies a request. +It is generated and used for other operations. +When sending it, it must be Base64-encoded. +Example: `base64('927342197')` + +**tranKey:** Generated programmatically for each request. +It is generated using the following formula: +`Base64(SHA-256(nonce + seed + secretKey))` +This formula must be implemented according to the programming language used. + + + + ```php + $login = "siteLogin"; + $secretKey = "siteSecretKey"; + $seed = date('c'); + $rawNonce = rand(); + + $tranKey = base64_encode(hash('sha256', $rawNonce.$seed.$secretKey, true)); + $nonce = base64_encode($rawNonce); + + $body = [ + "auth" => [ + "login" => $login, + "tranKey" => $tranKey, + "nonce" => $nonce, + "seed" => $seed, + ], + // ... other params + ]; + ``` + + ```js + const crypto = require('crypto'); + + const login = "siteLogin"; + const secretKey = "siteSecretKey"; + const seed = new Date().toISOString(); + const rawNonce = Math.floor(Math.random() * 1000000); + + const tranKey = Buffer.from(crypto.createHash('sha256').update(rawNonce + seed + secretKey).digest(), 'binary').toString('base64'); + const nonce = Buffer.from(rawNonce.toString()).toString('base64'); + + const body = { + auth: { + login: login, + tranKey: tranKey, + nonce: nonce, + seed: seed, + }, + // ... other params + }; + ``` + + ```python + import base64, hashlib, random, datetime + + login = "siteLogin" + secret_key = "siteSecretKey" + + seed = datetime.datetime.now(datetime.timezone.utc).isoformat() + raw_nonce = random.getrandbits(128).to_bytes(16, byteorder="big") + nonce = base64.b64encode(raw_nonce).decode("utf-8") + tran_key = base64.b64encode(hashlib.sha256(raw_nonce + seed.encode() + secret_key.encode()).digest()).decode("utf-8") + + return { + "login": login, + "tranKey": tran_key, + "nonce": nonce, + "seed": seed, + } + ``` + + diff --git a/src/pages/en/autopay/charge-types.mdx b/src/pages/en/autopay/charge-types.mdx new file mode 100644 index 000000000..7e773fc13 --- /dev/null +++ b/src/pages/en/autopay/charge-types.mdx @@ -0,0 +1,15 @@ +import { HeroPattern } from '@/components/HeroPattern' + + + +# Charges in AutoPay +A charge in **AutoPay** refers to the amount that is attempted to be collected on each scheduled date of the autopay. There are several ways in which the amount to be charged can be defined, known as **“Charge Types.”** + +## Charge types +The charge type defines the charging modality, that is, how the amount to be charged is determined in each autopay execution (for example, total balance, minimum payment, etc.). Below are the charge types available in the AutoPay system and how they operate within the general flow. + +| Charge type | What it charges | Source of the amount at execution | +|------------------------|----------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `TOTAL_BALANCE` | The **total balance** required for the period (total to pay according to recurrence). | The [**balance**](/autopay/contracts/balance) of the obligation is queried via the merchant API if it is enabled for each payment to be executed. | +| `MINIMUM_BALANCE` | The **minimum payment** required for the period. | The [**balance**](/autopay/contracts/balance) is queried to obtain the minimum amount for the period for each payment to be executed. | +| `FIXED` | A **fixed amount** specified by the merchant/user. | The amount is provided in the request or, if not, it will be selected by the user at the time of autopay confirmation. | diff --git a/src/pages/en/autopay/codes.mdx b/src/pages/en/autopay/codes.mdx new file mode 100644 index 000000000..bcbdbe50e --- /dev/null +++ b/src/pages/en/autopay/codes.mdx @@ -0,0 +1,29 @@ +import { HeroPattern } from '@/components/HeroPattern' + + + +# Response codes + +## Possible authentication errors + +| Code | Cause | +|------|-----------------------------------------------------------------------| +| 100 | Authentication not provided (Authorization header is malformed). | +| 101 | The consumer identifier does not exist. | +| 102 | The TranKey hash does not match; it may be incorrect or malformed. | +| 103 | Seed date is older than 5 minutes. | +| 104 | Inactive consumer. | + + +## Possible failure reasons + +| Code | Cause | +|------|------------------------------------------------------------------------------------------------------------------------------------------| +| 00 | Successful operation. Indicates that the flow was processed correctly without errors. | +| BR | The request contains errors; it may include invalid data, violate validation rules, or reference unauthorized resources. | +| X3 | Error in the request sent to external services; it may be due to incorrect format, invalid fields, or incomplete data. | +| XH | Unexpected internal system error that prevented processing the operation. | +| ?- | The operation is in a pending state; applies to asynchronous flows that have not yet completed. | +| 05 | An error occurred during processing with the external service. | +| NF | The resource was not found or does not exist. | +| XA | Amount not authorized; the value exceeds the allowed limit or the available balance. | diff --git a/src/pages/en/autopay/contract-authentication.mdx b/src/pages/en/autopay/contract-authentication.mdx new file mode 100644 index 000000000..2b9e02065 --- /dev/null +++ b/src/pages/en/autopay/contract-authentication.mdx @@ -0,0 +1,65 @@ +import { HeroPattern } from '@/components/HeroPattern' + + + +# Contract authentication + +For the AutoPay service to interact with your API following the defined contracts, you must authenticate incoming requests. This allows you to identify AutoPay and validate the information so your operations remain secure. The API must use **HTTP Basic Authentication (Basic Auth)**. + +## API credentials + +When integrating with AutoPay, you must have the merchant’s `username` and `password` credentials. + +- **username:** User that the implementing merchant must **provide to AutoPay** during site configuration. Maximum 60 characters. +- **password:** Password that the implementing merchant must **provide to AutoPay** during site configuration. Maximum 60 characters. + +These credentials will be used by AutoPay to authenticate **against the merchant’s contracts/services**, therefore **the merchant must validate them** on every incoming request. + + + These credentials belong to the merchant and must be handled securely. Do not share your credentials in publicly accessible areas such as GitHub, client-side code, or other locations easily accessible to third parties. + + +## Authentication object {{ id: 'authentication-object' }} + +Authentication is sent in the **headers** of every request that AutoPay makes to the merchant’s contracts. + + + + + + Required header. It is sent in the following format: Basic base64(username:password) + + + + + + ```bash {{ 'title': 'Authentication Example (Header)' }} + Authorization: Basic bWVyY2hhbnRVc2VyOm1lcmNoYW50UGFzcw== + ``` + + + + +## How to validate authentication {{ id: 'how-to-validate-authentication' }} + +You must know and prepare the following data: + +**username:** The user you configured for AutoPay to consume your contracts. Maximum 60 characters. + +**password:** The password you configured for AutoPay to consume your contracts. Maximum 60 characters. + +**Authorization:** Header received in the request, with the following format: +`Authorization: Basic base64(username:password)` + +### Basic validation rules + +1. Verify that the `Authorization` header exists. +2. Verify that the scheme is `Basic`. +3. Decode the Base64 token and obtain the text `username:password`. +4. Split `username` and `password`. +5. Compare them against your configured credentials. +6. If validation fails, respond with `401 Unauthorized` (optionally with `WWW-Authenticate`). + + + Basic authentication must always be sent over HTTPS. Base64 does not encrypt, it only encodes. + diff --git a/src/pages/en/autopay/contracts/balance.mdx b/src/pages/en/autopay/contracts/balance.mdx new file mode 100644 index 000000000..0de954932 --- /dev/null +++ b/src/pages/en/autopay/contracts/balance.mdx @@ -0,0 +1,117 @@ +import { HeroPattern } from '@/components/HeroPattern' + + + +export const apiRefs = ['/autopay/balance'] + +## Check amount to be charged {{ id: 'balance', tag: 'POST', label: '{{baseURL}}/autopay/balance' }} + + + **baseURL**: This is the base URL of the client/merchant application, which must be provided by the merchant and configured during the AutoPay onboarding process. + + + + **Authentication (Basic Authentication):** This endpoint requires authentication via the `Authorization` header. + The merchant must validate the credentials configured for AutoPay on each incoming request. See more at [**Contract authentication**](/autopay/contract-authentication). + + + + + This endpoint allows retrieving the amount that must be charged for an AutoPay. + It returns two values: + + - **amount:** total amount to be charged in the current cycle. + - **min_amount:** minimum amount required to execute the charge. + + It can be used to validate whether there are pending amounts before starting a payment or automatic reconciliation process. + + + + + ```bash {{ title: 'Obtener balance' }} + curl -X "POST" {{baseURl}}/autopay/balance \ + -H "Content-Type: application/json" \ + -H "Authorization: Basic " \ + -d '{ + "reference": "ACC00012345", + "id": "2972c13d-6315-4da3-80d7-64c24eb232ad" + }' + ``` + + + + + + + + + +
+ + ```json {{ title: '200: Respuesta exitosa' }} + { + "status": { + "status": "OK", + "reason": "00", + "message": "Respuesta exitosa", + "date": "2025-09-29T17:09:29-05:00" + }, + "id": "2972c13d-6315-4da3-80d7-64c24eb232ad", + "amount": { + "currency": "USD", + "total": 10 + }, + "min_amount": { + "currency": "USD", + "total": 5 + } + } + ``` + ```json {{ title: '400: No encontrado' }} + { + "status": { + "status": "FAILED", + "reason": "404", + "message": "Balance no encontrado", + "date": "2025-09-29T17:09:29-05:00" + } + } + ``` + ```json {{ title: '400: Autenticación invalida' }} + { + "status": { + "status": "FAILED", + "reason": "BR", + "message": "Autenticación no proporcionada o encabezado Authorization mal formado.", + "date": "2025-09-29T17:09:29-05:00" + } + } + ``` + ```json {{ title: '400: Autenticación invalida - Credenciales incorrectas' }} + { + "status": { + "status": "FAILED", + "reason": "101", + "message": "Credenciales inválidas.", + "date": "2025-09-29T17:09:29-05:00" + } + } + ``` + + +
+ + + + + + diff --git a/src/pages/en/autopay/contracts/index.mdx b/src/pages/en/autopay/contracts/index.mdx new file mode 100644 index 000000000..ab2c8bc1f --- /dev/null +++ b/src/pages/en/autopay/contracts/index.mdx @@ -0,0 +1,23 @@ +import { HeroPattern } from '@/components/HeroPattern' +import { Note } from "@/components/Note"; + + + +## Client API contracts when integrating AutoPay + + + **baseURL**: This is the base URL of the client/merchant application, which must be provided by the merchant and configured during the AutoPay onboarding process. + + +To operate AutoPay end to end, the client/merchant must expose a set of their own endpoints that follow the contracts defined in this documentation. + +These endpoints allow Placetopay to: +- Query the balance/amount to be charged. +- Confirm the application of a payment. +- Receive notifications about the AutoPay lifecycle (activation, update, deactivation, execution results). + +In this section, you can find more information about the contracts and examples of each of the services you must implement. + + + As a client, when implementing these contracts you must implement authentication based on *Basic Authentication*. This allows you to identify us and validate the information so your operations remain secure. See more at [**Contract authentication**](/autopay/contract-authentication). + diff --git a/src/pages/en/autopay/contracts/settlement.mdx b/src/pages/en/autopay/contracts/settlement.mdx new file mode 100644 index 000000000..b43bb5255 --- /dev/null +++ b/src/pages/en/autopay/contracts/settlement.mdx @@ -0,0 +1,145 @@ +import { HeroPattern } from '@/components/HeroPattern' + + + +export const apiRefs = ['/autopay/settlement'] + +## Settle/Confirm a payment {{ id: 'settlement', tag: 'POST', label: '{{baseURl}}/autopay/settlement' }} + + **baseURL**: This is the base URL of the client/merchant application, which must be provided by the merchant and configured during the AutoPay onboarding process. + + + + **Authentication (Basic Authentication):** This endpoint requires authentication via the `Authorization` header. + The merchant must validate the credentials configured for AutoPay on each incoming request. Learn more at [**Contract authentication**](/autopay/contract-authentication). + + + + Settlement is performed only for transactions that have been successfully processed and are in **APPROVED** status. + + + + This endpoint is used to confirm a previously processed payment by sending the transaction details. + + + + +```bash {{ title: 'Settle a payment' }} +curl -X POST {{baseURl}}/autopay/settlement \ + -H "Content-Type: application/json" \ + -H "Authorization: Basic " \ + -d '{ + "reference": "ACC00012345", + "id": "2972c13d-6315-4da3-80d7-64c24eb232ad", + "transaction": { + "status": { + "status": "APPROVED", + "reason": "00", + "message": "Aprobada", + "date": "2021-09-24T11:51:31-05:00" + }, + "date": "2021-09-24T11:51:31-05:00", + "transactionDate": "2021-09-24T11:51:31-05:00", + "internalReference": 41, + "reference": "ON1434012-PN1433129", + "paymentMethod": "CR_VS", + "franchise": "visa", + "franchiseName": "Visa", + "issuerName": "BANCO DE GUAYAQUIL, S.A.", + "amount": { + "taxes": [ + { "kind": "airportTax", "amount": 63, "base": 0 }, + { "kind": "valueAddedTax", "amount": 158.47, "base": 0 } + ], + "currency": "USD", + "total": 1161.12 + }, + "conversion": { + "from": { "currency": "USD", "total": 1161.12 }, + "to": { "currency": "USD", "total": 1161 }, + "factor": 1 + }, + "authorization": "739877", + "receipt": "713329175945", + "type": "AUTH_ONLY", + "refunded": false, + "lastDigits": "0032", + "provider": "CREDIBANCO", + "discount": null, + "processorFields": { + "id": "08c0284b20510c8db8dcb29137374718", + "b24": "XX" + }, + "additional": { + "merchantCode": "123456", + "terminalNumber": "12345678", + "bin": "411076", + "expiration": "1220" + } + } + }' +``` + + + + + + + + + +
+ +```json {{ title: '200: Respuesta exitosa' }} +{ + "status": { + "status": "OK", + "reason": "00", + "message": "Respuesta sactisfactoria", + "date": "2025-09-29T17:09:29-05:00" + }, + "id": "2972c13d-6315-4da3-80d7-64c24eb232ad" +} +``` +```json {{ title: '404: Transacción no encontrada' }} +{ + "status": { + "status": "FAILED", + "reason": "404", + "message": "Transacción no encontrada", + "date": "2025-09-29T17:09:29-05:00" + } +} +``` +```json {{ title: '400: Autenticación invalida' }} +{ + "status": { + "status": "FAILED", + "reason": "BR", + "message": "Autenticación no proporcionada o encabezado Authorization mal formado.", + "date": "2025-09-29T17:09:29-05:00" + } +} +``` +```json {{ title: '400: Autenticación invalida - Credenciales incorrectas' }} +{ + "status": { + "status": "FAILED", + "reason": "101", + "message": "Credenciales inválidas.", + "date": "2025-09-29T17:09:29-05:00" + } +} +``` + + +
diff --git a/src/pages/en/autopay/contracts/webhook.mdx b/src/pages/en/autopay/contracts/webhook.mdx new file mode 100644 index 000000000..bb120a34e --- /dev/null +++ b/src/pages/en/autopay/contracts/webhook.mdx @@ -0,0 +1,146 @@ +import { HeroPattern } from '@/components/HeroPattern' + + + +export const apiRefs = ['/autopay/webhook'] + +# Notifications + +**AutoPay** sends notifications when events occur on the autopays associated with your merchant account. + +To receive notifications, the merchant must expose a **POST** endpoint following the contract described in this documentation, and the merchant must be registered on the platform. + +### Event types {{ id: 'event-types' }} +Currently, AutoPay sends notifications for the following events: + +| Event | Description | +|----------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| AUTOPAY_CREATED | Indicates that an autopay has been created. This may occur after the user finishes the autopay creation session and authorizes its creation. | +| AUTOPAY_UPDATED | Indicates that an autopay has been updated. This may occur when the user changes the payment method, the merchant changes the payment frequency, etc. | +| AUTOPAY_TRANSACTION_FAILED | Indicates that an automatic payment attempt has failed. | +| AUTOPAY_CANCELED | Indicates that an autopay has been canceled. | + +### Webhook validation {{ id: 'validating-webhooks' }} + +Since the notification arrives from a system external to your servers, it is important to validate that the message is authentic and comes from a trusted source. To do this, a signature included in the message is used, which was generated using the `secretKey` provided by the site and known only by the involved systems. To learn more about your `secretKey`, see the [Authentication](/autopay/authentication) documentation. + +To start your validation, you must have the `secretKey` associated with your merchant available. + +**Identify the algorithm**: To identify the algorithm used in the signature, keep the following in mind: + +- If the `signature` field starts with the `sha256:` prefix, then the signature was generated using SHA-256. + +**Extract the raw signature**: Once the algorithm is identified, locate the `signature` field. + +- If the `sha256:` prefix is present, you must remove it to obtain the raw signature to be compared. We will call this `receivedSignature`. + +**Generate your own signature**: Once the algorithm is identified, you must generate your own signature using the following formula: + +- For SHA-256: `SHA-256(id + type + date + secretKey)` + +This will produce the signature generated by your system, which we will call `generatedSignature`. Note that the data required to generate the signature is found in the webhook details. See more in the [Webhook contract](/autopay/contracts/webhook). + +**Compare signatures**: Finally, compare the signature you generated (`generatedSignature`) with the signature received in the message (`receivedSignature`). If both signatures are equal, then the notification is authentic and you can proceed to update the session status in your system. + + + When receiving a notification, it is recommended to call the [AutoPay query API](/autopay/autopay-api) to obtain more details about the change, + so that you always have accurate and up-to-date information. + + +## Notifications {{ id: 'webhook', tag: 'POST', label: '{{baseURl}}/autopay/webhook' }} + + + **baseURL**: This is the base URL of the client/merchant application, which must be provided by the merchant and configured during the AutoPay onboarding process. + + + + You must expose an endpoint according to the following contract. AutoPay will send notifications to this endpoint every time an autopay is created, the payment method is updated, an autopay is canceled, or a payment fails. + + + + + + ```json {{ 'title': 'Creación de un AutoPago' }} + { + "id": "2972c13d-6315-4da3-80d7-64c24eb232ad", + "reference": "ACC00012345", + "type": "AUTOPAY_CREATED", + "date": "2023-01-19 15:57:23", + "signature": "sha256:a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s" + } + ``` + ```json {{ 'title': 'Actualización del AutoPago' }} + { + "id": "2972c13d-6315-4da3-80d7-64c24eb232ad", + "reference": "ACC00012345", + "type": "AUTOPAY_UPDATED", + "date": "2023-01-19 15:57:23", + "signature": "sha256:a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s" + } + ``` + + ```json {{ 'title': 'Falla al cobrar un AutoPago' }} + { + "id": "2972c13d-6315-4da3-80d7-64c24eb232ad", + "reference": "ACC00012345", + "type": "AUTOPAY_TRANSACTION_FAILED", + "date": "2023-01-19 15:57:23", + "signature": "sha256:a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s", + "additional": { + "transactionID": "CFed8XTioVhyG3CGHhJrpgpyM8k1phj3" + }, + } + ``` + + ```json {{ 'title': 'Cancelación de AutoPago' }} + { + "id": "2972c13d-6315-4da3-80d7-64c24eb232ad", + "reference": "ACC00012345", + "type": "AUTOPAY_CANCELED", + "date": "2023-01-19 15:57:23", + "signature": "sha256:a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s" + } + ``` + + + + + + + + + +
+ + ```json {{ title: '200: Respuesta exitosa' }} + { + "status": { + "status": "OK", + "reason": "00", + "message": "Respuesta exitosa", + "date": "2025-09-29T17:09:29-05:00" + }, + } + ``` + ```json {{ title: '401: Firma inválida' }} + { + "status": { + "status": "FAILED", + "reason": "BR", + "message": "Firma inválida", + "date": "2025-09-29T17:09:29-05:00" + }, + } + ``` + + +
\ No newline at end of file diff --git a/src/pages/en/autopay/index.mdx b/src/pages/en/autopay/index.mdx index e1efb153e..758748098 100644 --- a/src/pages/en/autopay/index.mdx +++ b/src/pages/en/autopay/index.mdx @@ -2,4 +2,27 @@ import { HeroPattern } from '@/components/HeroPattern' - +# AutoPay (BETA) + +**AutoPay Placetopay** is an automatic payment service that allows merchants to enable recurring or scheduled charges using a payment method previously authorized by the user (card or compatible bank account), without requiring manual intervention for each transaction. The solution includes a guided enrollment experience for the end user, API services for the merchant to create and manage autopay sessions, and execution processes that trigger charges according to the defined configuration. + +--- +## Why is it useful? + +- **Improved conversion and retention:** reduces friction in repetitive payments (services, insurance, telcos, subscriptions). +- **Operational automation:** eliminates manual processes and reminders; charges are executed on the agreed dates. +- **Control and transparency:** the merchant can review, adjust, or cancel their autopays. +- **Security and compliance:** use of tokenized payment methods and PCI guidelines, with authentication options (e.g., 3DS 3RI when applicable). +- **Integrability:** in addition to direct checkout integration, the ecosystem exposes endpoints for creation/update/deactivation and querying of sessions/autopays; webhooks are also supported to notify relevant events. + +--- +## How does it work? + +1) [**AutoPay API:**](/en/autopay/api) +As a client, you can interact with the AutoPay API to perform actions on your users’ autopays, such as creation, querying, updating, and deactivation. + +2) [**Direct client integration:**](/en/autopay/contracts) +As a client, your application can expose certain endpoints so AutoPay can interact with them, obtain the necessary invoice information to process a payment ([Balance](/autopay/contracts/balance)), record the results of each payment ([Settlement](/autopay/contracts/settlement)), and receive updated information about the autopay status ([Webhooks](/autopay/contracts/webhook)). + +In this documentation you will find all the information required to integrate AutoPay into your platform. +--- diff --git a/src/pages/en/index.mdx b/src/pages/en/index.mdx index cf4e7fc0d..52d04a278 100644 --- a/src/pages/en/index.mdx +++ b/src/pages/en/index.mdx @@ -105,6 +105,14 @@ Consulting our guides and examples to integrate placetopay. action="View documentation" icon={ThreeDSIcon} /> + + ### Productos Financieros Avanzados From 92547187181651a80a17dc64b3fd79932b844029 Mon Sep 17 00:00:00 2001 From: Johanna Arango <67110144+larangogon@users.noreply.github.com> Date: Tue, 16 Dec 2025 15:01:15 -0500 Subject: [PATCH 2/2] feat: refactor and update trans --- src/pages/autopay/codes.mdx | 4 +- src/pages/en/autopay/api/session.mdx | 18 +++--- src/pages/en/autopay/authentication.mdx | 10 ++-- src/pages/en/autopay/charge-types.mdx | 10 ++-- src/pages/en/autopay/codes.mdx | 26 ++++----- src/pages/en/autopay/contracts/balance.mdx | 16 +++--- src/pages/en/autopay/contracts/settlement.mdx | 56 ++++++++++++------- src/pages/en/autopay/contracts/webhook.mdx | 20 +++---- 8 files changed, 87 insertions(+), 73 deletions(-) diff --git a/src/pages/autopay/codes.mdx b/src/pages/autopay/codes.mdx index 576f44000..8cb34f9ab 100644 --- a/src/pages/autopay/codes.mdx +++ b/src/pages/autopay/codes.mdx @@ -25,5 +25,5 @@ import { HeroPattern } from '@/components/HeroPattern' | XH | Error interno inesperado en el sistema que impidió procesar la operación. | | ?- | La operación se encuentra en estado pendiente, aplica a flujos asincrónicos que aún no han finalizado. | | 05 | Ha ocurrido un error durante el procesamiento con el servicio externo. | -| NF | No se ha encontrado el recurso o es inexistente. | -| XA | Monto no autorizado, el valor excede el límite permitido o el saldo disponible. | \ No newline at end of file +| NF | No se ha encontrado el recurso o es inexistente. | +| XA | Monto no autorizado, el valor excede el límite permitido o el saldo disponible. | \ No newline at end of file diff --git a/src/pages/en/autopay/api/session.mdx b/src/pages/en/autopay/api/session.mdx index 0b7ee3c43..41e5b39df 100644 --- a/src/pages/en/autopay/api/session.mdx +++ b/src/pages/en/autopay/api/session.mdx @@ -54,7 +54,7 @@ curl -X "POST" https://test.placetopay.com/autopay/session \ "autopay": { "action": "CREATE", "reference": "12345", - "description": "Inscripción autopago monto fijo", + "description": "Self-pay registration fixed amount", "dueDay": 15, "recurring": { "type": "FIXED", @@ -91,7 +91,7 @@ curl -X "POST" https://test.placetopay.com/autopay/session \ "autopay": { "action": "CREATE", "reference": "12345", - "description": "Inscripción autopago monto fijo", + "description": "Self-pay registration fixed amount", "dueDay": 15 "recurring": { "type": "TOTAL_BALANCE", @@ -124,7 +124,7 @@ curl -X "POST" https://test.placetopay.com/autopay/session \ "autopay": { "action": "CREATE", "reference": "12345", - "description": "Inscripción autopago monto fijo", + "description": "Self-pay registration fixed amount", "dueDay": 15 "recurring": { "type": "MINIMUM_BALANCE", @@ -157,7 +157,7 @@ curl -X "POST" https://test.placetopay.com/autopay/session \ "autopay": { "action": "EDIT", "reference": "12345", - "description": "Inscripción autopago monto fijo", + "description": "Self-pay registration fixed amount", "id": "f7b347d7-c922-4c68-8750-99fb43c9e5ff" }, "returnUrl": "https://merchant.test/return", @@ -199,7 +199,7 @@ curl -X "POST" https://test.placetopay.com/autopay/session \ "status": { "status": "FAILED", "reason": 401, - "message": "Autenticación fallida 102", + "message": "Authentication failed 102", "date": "2021-11-30T15:12:25-05:00" }, } @@ -274,7 +274,7 @@ curl -X "POST" https://test.placetopay.com/autopay/session/000000 \ "status": { "status": "APPROVED", "reason": "00", - "message": "La petición ha sido aprobada exitosamente", + "message": "The request has been successfully approved", "date": "2022-07-27T14:51:27-05:00" }, "requestId": 100, @@ -292,7 +292,7 @@ curl -X "POST" https://test.placetopay.com/autopay/session/000000 \ "autopay": { "action": "CREATE", "reference": "12345", - "description": "Inscripción autopago monto fijo", + "description": "Self-pay registration fixed amount", "recurring": { "type": "FIXED", "periodicity": "M", @@ -341,7 +341,7 @@ curl -X "POST" https://test.placetopay.com/autopay/session/000000 \ }, "subscription": { "reference": "12345", - "description": "Inscripción autopago monto fijo", + "description": "Self-pay registration fixed amount", "amount": { "currency": "USD", "total": 100 @@ -384,7 +384,7 @@ curl -X "POST" https://test.placetopay.com/autopay/session/000000 \ "status": { "status": "FAILED", "reason": 401, - "message": "Autenticación fallida 102", + "message": "Authentication failed 102", "date": "2021-11-30T15:12:25-05:00" }, } diff --git a/src/pages/en/autopay/authentication.mdx b/src/pages/en/autopay/authentication.mdx index 0e6b69bff..1f3368249 100644 --- a/src/pages/en/autopay/authentication.mdx +++ b/src/pages/en/autopay/authentication.mdx @@ -25,22 +25,22 @@ The `auth` parameter must be sent in all API requests and contains the set of pr - Identificador del sitio + Site identifier - Credencial tranKey generado. A continuación se explica en detalle. + tranKey credential generated. This is explained in detail below. - Valor aleatorio para cada solicitud codificado en Base64. + Random value for each request encoded in Base64. - Fecha actual, la cual se genera en formato ISO 8601. + Current date, which is generated in ISO 8601 format. - ```json {{ 'title': 'Autenticación de Ejemplo' }} + ```json {{ 'title': 'Example Authentication' }} { "auth": { "login":"aabbccdd1234567890aabbccdd123456", diff --git a/src/pages/en/autopay/charge-types.mdx b/src/pages/en/autopay/charge-types.mdx index 7e773fc13..eebe55487 100644 --- a/src/pages/en/autopay/charge-types.mdx +++ b/src/pages/en/autopay/charge-types.mdx @@ -8,8 +8,8 @@ A charge in **AutoPay** refers to the amount that is attempted to be collected o ## Charge types The charge type defines the charging modality, that is, how the amount to be charged is determined in each autopay execution (for example, total balance, minimum payment, etc.). Below are the charge types available in the AutoPay system and how they operate within the general flow. -| Charge type | What it charges | Source of the amount at execution | -|------------------------|----------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `TOTAL_BALANCE` | The **total balance** required for the period (total to pay according to recurrence). | The [**balance**](/autopay/contracts/balance) of the obligation is queried via the merchant API if it is enabled for each payment to be executed. | -| `MINIMUM_BALANCE` | The **minimum payment** required for the period. | The [**balance**](/autopay/contracts/balance) is queried to obtain the minimum amount for the period for each payment to be executed. | -| `FIXED` | A **fixed amount** specified by the merchant/user. | The amount is provided in the request or, if not, it will be selected by the user at the time of autopay confirmation. | +| Charge type | What it charges | Source of the amount at execution | +|------------------------|---------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `TOTAL_BALANCE` | The **total balance** required for the period (total to pay according to recurrence). | The [**balance**](/autopay/contracts/balance) of the obligation is queried via the merchant API if it is enabled for each payment to be executed. | +| `MINIMUM_BALANCE` | The **minimum payment** required for the period. | The [**balance**](/autopay/contracts/balance) is queried to obtain the minimum amount for the period for each payment to be executed. | +| `FIXED` | A **fixed amount** specified by the merchant/user. | The amount is provided in the request or, if not, it will be selected by the user at the time of autopay confirmation. | diff --git a/src/pages/en/autopay/codes.mdx b/src/pages/en/autopay/codes.mdx index bcbdbe50e..96b7a6c6f 100644 --- a/src/pages/en/autopay/codes.mdx +++ b/src/pages/en/autopay/codes.mdx @@ -9,21 +9,21 @@ import { HeroPattern } from '@/components/HeroPattern' | Code | Cause | |------|-----------------------------------------------------------------------| | 100 | Authentication not provided (Authorization header is malformed). | -| 101 | The consumer identifier does not exist. | +| 101 | The consumer identifier does not exist. | | 102 | The TranKey hash does not match; it may be incorrect or malformed. | -| 103 | Seed date is older than 5 minutes. | -| 104 | Inactive consumer. | +| 103 | Seed date is older than 5 minutes. | +| 104 | Inactive consumer. | ## Possible failure reasons -| Code | Cause | -|------|------------------------------------------------------------------------------------------------------------------------------------------| -| 00 | Successful operation. Indicates that the flow was processed correctly without errors. | -| BR | The request contains errors; it may include invalid data, violate validation rules, or reference unauthorized resources. | -| X3 | Error in the request sent to external services; it may be due to incorrect format, invalid fields, or incomplete data. | -| XH | Unexpected internal system error that prevented processing the operation. | -| ?- | The operation is in a pending state; applies to asynchronous flows that have not yet completed. | -| 05 | An error occurred during processing with the external service. | -| NF | The resource was not found or does not exist. | -| XA | Amount not authorized; the value exceeds the allowed limit or the available balance. | +| Code | Cause | +|------|--------------------------------------------------------------------------------------------------------------------------------------| +| 00 | Successful operation. Indicates that the flow was processed correctly without errors. | +| BR | The request contains errors; it may include invalid data, violate validation rules, or reference unauthorized resources. | +| X3 | Error in the request sent to external services; it may be due to incorrect format, invalid fields, or incomplete data. | +| XH | Unexpected internal system error that prevented processing the operation. | +| ?- | The operation is in a pending state; applies to asynchronous flows that have not yet completed. | +| 05 | An error occurred during processing with the external service. | +| NF | The resource was not found or does not exist. | +| XA | Amount not authorized; the value exceeds the allowed limit or the available balance. | diff --git a/src/pages/en/autopay/contracts/balance.mdx b/src/pages/en/autopay/contracts/balance.mdx index 0de954932..59f0ee137 100644 --- a/src/pages/en/autopay/contracts/balance.mdx +++ b/src/pages/en/autopay/contracts/balance.mdx @@ -57,12 +57,12 @@ export const apiRefs = ['/autopay/balance']
- ```json {{ title: '200: Respuesta exitosa' }} + ```json {{ title: '200: Successful response' }} { "status": { "status": "OK", "reason": "00", - "message": "Respuesta exitosa", + "message": "Successful response", "date": "2025-09-29T17:09:29-05:00" }, "id": "2972c13d-6315-4da3-80d7-64c24eb232ad", @@ -76,32 +76,32 @@ export const apiRefs = ['/autopay/balance'] } } ``` - ```json {{ title: '400: No encontrado' }} + ```json {{ title: '400: Not found' }} { "status": { "status": "FAILED", "reason": "404", - "message": "Balance no encontrado", + "message": "Balance Not found", "date": "2025-09-29T17:09:29-05:00" } } ``` - ```json {{ title: '400: Autenticación invalida' }} + ```json {{ title: '400: Invalid authentication' }} { "status": { "status": "FAILED", "reason": "BR", - "message": "Autenticación no proporcionada o encabezado Authorization mal formado.", + "message": "he authentication does not contains all the required parameters (login, tranKey, seed, nonce)", "date": "2025-09-29T17:09:29-05:00" } } ``` - ```json {{ title: '400: Autenticación invalida - Credenciales incorrectas' }} + ```json {{ title: '400: Invalid authentication - Incorrect credentials' }} { "status": { "status": "FAILED", "reason": "101", - "message": "Credenciales inválidas.", + "message": "Authentication failed 103.", "date": "2025-09-29T17:09:29-05:00" } } diff --git a/src/pages/en/autopay/contracts/settlement.mdx b/src/pages/en/autopay/contracts/settlement.mdx index b43bb5255..6b61b1658 100644 --- a/src/pages/en/autopay/contracts/settlement.mdx +++ b/src/pages/en/autopay/contracts/settlement.mdx @@ -39,7 +39,7 @@ curl -X POST {{baseURl}}/autopay/settlement \ "status": { "status": "APPROVED", "reason": "00", - "message": "Aprobada", + "message": "Approved", "date": "2021-09-24T11:51:31-05:00" }, "date": "2021-09-24T11:51:31-05:00", @@ -52,15 +52,29 @@ curl -X POST {{baseURl}}/autopay/settlement \ "issuerName": "BANCO DE GUAYAQUIL, S.A.", "amount": { "taxes": [ - { "kind": "airportTax", "amount": 63, "base": 0 }, - { "kind": "valueAddedTax", "amount": 158.47, "base": 0 } + { + "kind": "airportTax", + "amount": 63, + "base": 0 + }, + { + "kind": "valueAddedTax", + "amount": 158.47, + "base": 0 + } ], "currency": "USD", "total": 1161.12 }, "conversion": { - "from": { "currency": "USD", "total": 1161.12 }, - "to": { "currency": "USD", "total": 1161 }, + "from": { + "currency": "USD", + "total": 1161.12 + }, + "to": { + "currency": "USD", + "total": 1161 + }, "factor": 1 }, "authorization": "739877", @@ -71,14 +85,14 @@ curl -X POST {{baseURl}}/autopay/settlement \ "provider": "CREDIBANCO", "discount": null, "processorFields": { - "id": "08c0284b20510c8db8dcb29137374718", - "b24": "XX" + "id": "08c0284b20510c8db8dcb29137374718", + "b24": "XX" }, "additional": { - "merchantCode": "123456", - "terminalNumber": "12345678", - "bin": "411076", - "expiration": "1220" + "merchantCode": "123456", + "terminalNumber": "12345678", + "bin": "411076", + "expiration": "1220" } } }' @@ -98,44 +112,44 @@ curl -X POST {{baseURl}}/autopay/settlement \
- -```json {{ title: '200: Respuesta exitosa' }} + +```json {{ title: '200: Successful response' }} { "status": { "status": "OK", "reason": "00", - "message": "Respuesta sactisfactoria", + "message": "Successful response", "date": "2025-09-29T17:09:29-05:00" }, "id": "2972c13d-6315-4da3-80d7-64c24eb232ad" } ``` -```json {{ title: '404: Transacción no encontrada' }} +```json {{ title: '404: Transaction not found' }} { "status": { "status": "FAILED", "reason": "404", - "message": "Transacción no encontrada", + "message": "Transaction not found", "date": "2025-09-29T17:09:29-05:00" } } ``` -```json {{ title: '400: Autenticación invalida' }} +```json {{ title: '400: Invalid authentication' }} { "status": { "status": "FAILED", "reason": "BR", - "message": "Autenticación no proporcionada o encabezado Authorization mal formado.", + "message": "The authentication does not contains all the required parameters (login, tranKey, seed, nonce).", "date": "2025-09-29T17:09:29-05:00" } } ``` -```json {{ title: '400: Autenticación invalida - Credenciales incorrectas' }} +```json {{ title: '400: Invalid authentication - Incorrect credentials' }} { "status": { "status": "FAILED", - "reason": "101", - "message": "Credenciales inválidas.", + "reason": "401", + "message": "Authentication failed 101.", "date": "2025-09-29T17:09:29-05:00" } } diff --git a/src/pages/en/autopay/contracts/webhook.mdx b/src/pages/en/autopay/contracts/webhook.mdx index bb120a34e..9446959f6 100644 --- a/src/pages/en/autopay/contracts/webhook.mdx +++ b/src/pages/en/autopay/contracts/webhook.mdx @@ -63,8 +63,8 @@ This will produce the signature generated by your system, which we will call `ge /> - - ```json {{ 'title': 'Creación de un AutoPago' }} + + ```json {{ 'title': 'Creating an AutoPayment' }} { "id": "2972c13d-6315-4da3-80d7-64c24eb232ad", "reference": "ACC00012345", @@ -73,7 +73,7 @@ This will produce the signature generated by your system, which we will call `ge "signature": "sha256:a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s" } ``` - ```json {{ 'title': 'Actualización del AutoPago' }} + ```json {{ 'title': 'AutoPay Update' }} { "id": "2972c13d-6315-4da3-80d7-64c24eb232ad", "reference": "ACC00012345", @@ -83,7 +83,7 @@ This will produce the signature generated by your system, which we will call `ge } ``` - ```json {{ 'title': 'Falla al cobrar un AutoPago' }} + ```json {{ 'title': 'Fails to collect an AutoPayment' }} { "id": "2972c13d-6315-4da3-80d7-64c24eb232ad", "reference": "ACC00012345", @@ -96,7 +96,7 @@ This will produce the signature generated by your system, which we will call `ge } ``` - ```json {{ 'title': 'Cancelación de AutoPago' }} + ```json {{ 'title': 'AutoPay Cancellation' }} { "id": "2972c13d-6315-4da3-80d7-64c24eb232ad", "reference": "ACC00012345", @@ -120,23 +120,23 @@ This will produce the signature generated by your system, which we will call `ge
- - ```json {{ title: '200: Respuesta exitosa' }} + + ```json {{ title: '200: Successful response' }} { "status": { "status": "OK", "reason": "00", - "message": "Respuesta exitosa", + "message": "Successful response", "date": "2025-09-29T17:09:29-05:00" }, } ``` - ```json {{ title: '401: Firma inválida' }} + ```json {{ title: '401: Invalid signature' }} { "status": { "status": "FAILED", "reason": "BR", - "message": "Firma inválida", + "message": "Invalid signature", "date": "2025-09-29T17:09:29-05:00" }, }