Process a Sale {#concept}
=========================

This section describes how to send a sale request to process a payment.  
A sale request authorizes and captures a payment in the same request. A successful sale response includes an Multibanco redirect URL and a `PENDING` status. Redirect the customer to the Multibanco URL to allow the customer to complete the checkout using their Multibanco account. When the customer completes the checkout, the customer is redirected to your website.  
When you receive a successful response, save the sale request ID in the id response field to perform a follow-on check status request or refund request.

Calculating the Grand Total
---------------------------

Include the grand total in the request by using the orderInformation.amountDetails.totalAmount field.

Endpoints
---------

**Production:** `POST ``https://api.cybersource.com``/pts/v2/payments`{#concept_d7e345}  
**Test:** `POST ``https://apitest.cybersource.com``/pts/v2/payments`{#concept_d7e355}

Processing a Sale {#paypal-session-task}
========================================

Follow these steps to successfully process sale.

1. Send a `POST` request to the `https://apitest.cybersource.com``/pts/v2/payments`{#paypal-session-task_sale-test-rest} endpoint and include these required fields:

   clientReferenceInformation.code
   :

   merchantInformation.cancelUrl
   :

   merchantInformation.failureUrl
   :

   merchantInformation.successUrl
   :

   orderInformation.amountDetails.currency
   :
   Set to `EUR`.

   orderInformation.amountDetails.totalAmount
   :

   orderInformation.billTo.address1
   :

   orderInformation.billTo.country
   :

   orderInformation.billTo.email
   :

   orderInformation.billTo.firstName
   :

   orderInformation.billTo.lastName
   :

   orderInformation.billTo.phoneNumber
   :

   paymentInformation.paymentType.method.name
   :
   Set to `MULTIBANCO`.

   paymentInformation.paymentType.name
   :
   Set to `bankTransfer`.

   processingInformation.actionList
   :
   Set to `AP_SALE`.
   {#paypal-session-task_step-1-cmd}

2. You can include these optional fields in the request:

   merchantDefinedInformation\[\].key
   :

   merchantInformation.merchantDescriptor
   :

   orderInformation.billTo.address1
   :

   orderInformation.billTo.address2
   :

   orderInformation.billTo.administrativeArea
   :

   orderInformation.billTo.locality
   :

   orderInformation.billTo.phoneNumber
   :

   orderInformation.billTo.postalCode
   :

   orderInformation.lineItems\[\].productCode
   :

   orderInformation.lineItems\[\].productName
   :

   orderInformation.lineItems\[\].productSku
   :

   orderInformation.lineItems\[\].quantity
   :

   orderInformation.lineItems\[\].taxAmount
   :

   orderInformation.lineItems\[\].totalAmount
   :

   orderInformation.lineItems\[\].unitPrice
   :
   {#paypal-session-task_step-2-cmd}

3. Redirect the customer to the returned URL in the merchantInformation.successUrl response field.

   ```
   "successUrl": "https://www.valid.merchant.redirect.url.from.request.html?actionsuccess"
   ```

   {#paypal-session-task_codeblock_us3_hdx_lgc} {#paypal-session-task_step-3-cmd}

4. When the customer completes the checkout using their Multibanco credentials, the customer is redirected to the merchant website based on the URL that you included in the merchantInformation.successUrl request field.{#paypal-session-task_step-4-cmd}
   {#paypal-session-task_step-4}

5. Save the request ID in the id field from the sale response. Include the request ID in a check status request to confirm that the payment is complete.

   ```
   "id": "7551889104536542704807"
   ```

{#paypal-session-task_step-5-cmd}

Example: Processing a Sale {#x-ex-rest}
=======================================

Request

```
{
    "clientReferenceInformation": {
        "code": "123"
    },
    "merchantInformation": {
        "cancelUrl": "https://www.valid.merchant.redirect.url.from.request.html?actioncancel",
        "failureUrl": "https://www.valid.merchant.redirect.url.from.request.html?actionfailure",
        "successUrl": "https://www.valid.merchant.redirect.url.from.request.html?actionsuccess"
    },
    "paymentInformation": {
        "paymentType": {
            "method": {
                "name": "MULTIBANCO"
            },
            "name": "bankTransfer"
        }
    },
    "orderInformation": {
        "billTo": {
            "firstName": "John",
            "lastName": "Doe",
            "address1": "1 Market St",
            "country": "PT",
            "email": "test@test.com",
            "phoneNumber": "33623456789"
        },
        "amountDetails": {
            "totalAmount": "600.00",
            "currency": "EUR"
        }
    },
    "processingInformation": {
        "actionList": [
            "AP_SALE"
        ]
    }

}
```

Response to a Successful Request

```
{
    "_links": {
        "void": {
            "method": "POST",
            "href": "/pts/v2/payments/7551889104536542704807/voids"
        },
        "billingAgreement": {
            "method": "POST",
            "href": "/pts/v2/billing-agreements/7551889104536542704807"
        },
        "self": {
            "method": "POST",
            "href": "/pts/v2/payments/7551889104536542704807"
        },
        "refund": {
            "method": "POST",
            "href": "/pts/v2/payments/7551889104536542704807/refunds"
        },
        "status": {
            "method": "POST",
            "href": "/pts/v2/refresh-payment-status/7551889104536542704807"
        }
    },
    "clientReferenceInformation": {
        "code": "123"
    },
    "id": "7551889104536542704807",
    "message": "Request was processed successfully.",
    "orderInformation": {
        "amountDetails": {
            "totalAmount": "600.00",
            "currency": "EUR"
        }
    },
    "processorInformation": {
        "responseDetails": "00001",
        "paymentUrl": "https://payment.limonetikqualif.com/IfThenPay/Order/PayPage/665437010510",
        "transactionId": "665437010510",
        "responseCode": "00001"
    },
    "reconciliationId": "XFZ3ZE5XDZTC",
    "status": "PENDING",
    "submitTimeUtc": "2025-08-14T16:28:31Z"
}
```

Response Statuses for Processing a Sale {#x-req-fields}
=======================================================

`Cybersource` responds to your sale request with one of these statuses in the status field:

* `FAILED`: The sale cannot be completed.
* `PENDING`: The sale request is accepted but is not completed. Send a check status request as often as necessary to obtain the information that you need. For more information, see [Check a Status](/docs/cybs/en-us/thunes/developer/all/rest/thunes/thunes-multibanco-intro/thunes-multibanco-status-intro.md "").
  {#x-req-fields_ul_pdp_lkr_3yb}

