POST/autopay/session

Create or update an AutoPay session

The AutoPay creation and update flow starts with this request, which generates a session. This process allows configuring scheduled and/or recurring payments in an automated way, providing a link to redirect the cardholder to the graphical interface so they can authorize the start or update of the autopay and select the payment method.

Flow

  1. Initial request: When performing the create or edit request, 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 terms and conditions of the autopay
  • Select their preferred payment method
  • Complete the payment method subscription process
  • Pass the required security validations
  1. Activation: Once the process is completed, you will receive a notification via webhook indicating the creation or update of the autopay. Alternatively, you can check the status using the session query endpoint to verify whether the autopay has already been updated.

Request

Information required to create a session.

  • Name
    auth
    Type
    Authentication
    is Required
    REQUIRED
    Description

    Structure containing the site authentication information generated according to the WSSE UsernameToken Profile 1.1. See more at Authentication.

  • Name
    type
    Type
    string
    is Required
    REQUIRED
    Description

    Parameter used for additional session types. Use autopay to generate an AutoPay session.

    Allowed values:autopay
    Example:autopay
  • Name
    autopay
    Type
    AutopayRequest
    is Required
    REQUIRED
    Description

    Detail of the autopay to be generated. The user must register a payment method so that automatic charges are made on that payment method according to the agreed conditions. Required when .type is autopay.

  • Name
    buyer
    Type
    Person
    is optional
    Description

    Structure that reflects the information of a person involved in a transaction.

  • Name
    payer
    Type
    Person
    is optional
    Description

    Structure that reflects the information of a person involved in a transaction.

  • Name
    fields
    Type
    array[NameValuePair]
    is optional
    Description

    Structure to relate additional information in the process. See more in Additional Fields

  • Name
    paymentMethod
    Type
    string
    is optional
    Description

    Used to restrict the payment methods available in checkout. Multiple codes can be sent separated by commas. See more at Payment methods

    Ex: visa,master,pse

    Example:visa
  • Name
    cancelUrl
    Type
    string
    is optional
    Description

    Cancel URL, the user is redirected to this URL when they decide not to continue with the process. Occurs when the user clicks on I do not wish to continue.

    Example:https://commerce.test/cancel
  • Name
    skipResult
    Type
    boolean
    is optional
    Description

    If true is sent, when the user finishes the process the session result page will not be displayed, instead they will be redirected to the returnUrl. See more at Skip result

    Default value:false
  • Name
    noBuyerFill
    Type
    boolean
    is optional
    Description

    By default, the data sent as buyer is pre-filled in the Checkout interface to speed up the payment process, if this parameter is sent as true then this pre-filling will not be done.

    Default value:false
  • Name
    ipAddress
    Type
    string
    is Required
    REQUIRED
    Description

    IP address of the user who will perform the process.

    Example:134.10.163.36
    Max length:46
  • Name
    userAgent
    Type
    string
    is Required
    REQUIRED
    Description

    User Agent of the user's browser that will carry out the process.

    Example:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
    Max length:255
  • Name
    returnUrl
    Type
    string
    is Required
    REQUIRED
    Description

    Return URL, to this url the user is redirected once the session ends. Occurs when the user clicks on Return to commerce.

    e.g.: https://merchant.com/return

    Example:https://commerce.test/return
    Format:uri
    Max length:255
  • Name
    locale
    Type
    string
    is optional
    Description

    Language in which the request and the session will be processed. See more in Location

    Example:en_US, es_CO
    Format:regex
    Pattern:^\w{2}\_[A-Z]{2}
    Max length:5

Request

POST
/autopay/session
            curl -X "POST" {{baseURl}}/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": "Fixed amount autopay subscription",
                    "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",
        }'

Response

Successful response

  • Name
    status
    Type
    Status
    is Required
    REQUIRED
    Description

    Structure used to define response statuses.

  • Name
    requestId
    Type
    string|number|integer
    is optional
    Description

    request identifier

    Example:1
  • Name
    processUrl
    Type
    string
    is optional
    Description

    URL to which the user must be redirected to complete the payment process.

    Format:uri
    Max length:250

Response

POST
/autopay/session
{
  "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",
}