Customer-Initiated Recurring Payment with PAN {#credentials-recur-cit-pan-intro}
================================================================================

A recurring payment is a credentials-on-file (COF) transaction in a series of payments that you bill to a customer at a fixed amount, at regular intervals that do not exceed one year between transactions. The series of recurring payments is the result of an agreement between you and the customer for the purchase of goods or services that are provided at regular intervals.

Recurring Billing Service for Recurring Payments
------------------------------------------------

> IMPORTANT
> Do not use this document for the Recurring Billing service.  
> Use the [Recurring Billing Developer Guide](https://developer.cybersource.com/docs/cybs/en-us/recurring-billing/developer/all/rest/recurring-billing/recur-bill-dev-intro.md ""). When you use the Recurring Billing service, ` Cybersource ` saves and stores payment credentials for recurring transactions, ensuring compliance with COF best practices.

Processor-Specific Information
------------------------------

`National Payment Gateway` requires payer authentication data in customer-initiated transactions.  
When the domestic scheme directory server for mada cards is not available and authentication falls back to the global scheme directory server, the authentication brand response field indicates which directory server was used during the authentication process.

Endpoint
--------

**Production:** `POST ``https://api.sa.cybersource.com``/pts/v2/payments`  
**Test:** `POST ``https://apitest.sa.cybersource.com``/pts/v2/payments`

Successful Response
-------------------

Store the *network transaction ID* , which is the processorInformation.networkTransactionId field value, from the successful response message. You must include the network transaction ID in subsequent MIT authorization requests in order to associate the CIT to the MIT.

Required Fields for a Customer-Initiated Recurring Payment with PAN {#credentials-recur-cit-pan-reqfields}
==========================================================================================================

[clientReferenceInformation.code](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/client-ref-info-aa/client-ref-info-code.md "")
:

[consumerAuthenticationInformation.acsReferenceNumber](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/cons-auth-info-aa/cons-auth-info-acs-reference-num.md "")
:

[consumerAuthenticationInformation.acsTransactionId](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/cons-auth-info-aa/cons-auth-info-acs-transaction-id.md "")
:

[consumerAuthenticationInformation.authenticationDate](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/cons-auth-info-aa/cons-auth-info-authentication-date.md "")
:

[consumerAuthenticationInformation.cavv](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/cons-auth-info-aa/cons-auth-info-cavv-a.md "")
:

[consumerAuthenticationInformation.directoryServerTransactionId](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/cons-auth-info-aa/cons-auth-info-directory-server-transaction-id.md "")
:

[consumerAuthenticationInformation.dsReferenceNumber](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/cons-auth-info-aa/cons-auth-info-ds-reference-num.md "")
:

[consumerAuthenticationInformation.paSpecificationVersion](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/cons-auth-info-aa/cons-auth-info-pa-specification-version.md "")
:

[consumerAuthenticationInformation.paresStatus](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/cons-auth-info-aa/cons-auth-info-pares-status-a.md "")
:

[merchantInformation.merchantDescriptor.locality](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/merch-info-aa/merch-info-merchant-descriptor-locality.md "")
:

[orderInformation.amountDetails.currency](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-amount-details-currency.md "")
:
Set the value to `SAR`.

[orderInformation.amountDetails.totalAmount](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-amount-details-total-amount.md "")
:

[paymentInformation.card.expirationMonth](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/payment-info-aa/payment-info-card-exp-mo.md "")
:

[paymentInformation.card.expirationYear](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/payment-info-aa/payment-info-card-exp-year.md "")
:

[paymentInformation.card.number](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/payment-info-aa/payment-info-card-number.md "")
:

[paymentInformation.card.securityCode](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/payment-info-aa/payment-info-card-security-code-a.md "")
:

[paymentInformation.card.type](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/payment-info-aa/payment-info-card-type-a.md "")
:

[processingInformation.authorizationOptions.initiator. credentialStoredOnFile](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/processing-info-aa/processing-info-auth-ops-initiator-cof.md "")
:

processingInformation.authorizationOptions.initiator. merchantInitiatedTransaction.agreementId
:

[processingInformation.capture](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/processing-info-aa/processing-info-capture-a.md "")
:

[processingInformation.commerceIndicator](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/processing-info-aa/processing-info-commerce-ind.md "")
:

[recurringPaymentInformation.amountType](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/recurring-payment-info-aa/recurring-payment-info-amount-type.md "")
:

[recurringPaymentInformation.numberOfPayments](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/recurring-payment-info-aa/recurring-payment-info-number-of-payments.md "")
:

[recurringPaymentInformation.type](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/recurring-payment-info-aa/recurring-payment-info-type.md "")
:

REST Example: Customer-Initiated Recurring Payment with a mada Card PAN and `3-D Secure` {#credentials-recur-cit-pan-ex-rest-spg}
=================================================================================================================================

Request  
This example includes optional fields.

```keyword
{
    "clientReferenceInformation": {
        "code": "SPG_REQ_05"
    },
    "recurringPaymentInformation": {
        "amountType": "0",
        "numberOfPayments": 3,
        "type": "1"
    },
    "consumerAuthenticationInformation": {
        "cavv": "EHuWW9PiBkWvqE5juRwDzAUFBAk=",
        "dsReferenceNumber": "dsReferenceNumber-3DS-mada123",
        "paresStatus": "Y",
        "acsReferenceNumber": "3DS_LOA_ACS_201_13579",
        "paSpecificationVersion": "2",
        "authenticationDate": "20230413121212",
        "directoryServerTransactionId": "f25084f0-5b16-4c0a-ae5d-b24808a95e4b",
        "acsTransactionId": "f25084f0-5b16-4c0a-ae5d-b248083334b2"
    },
    "processingInformation": {
        "commerceIndicator": "mada",
        "authorizationOptions": {
            "initiator": {
            	"credentialStoredOnFile":true,
                "merchantInitiatedTransaction": {
                    "agreementId": "AgreementId123$"
                }
            }
        },
        "capture": true
    },
    "orderInformation": {
        "billTo": {
            "firstName": "Abdullah",
            "lastName": "Muhammad",
            "phoneNumber": "01-4844094",
            "address2": "P.O.Box: 16335",
            "address1": "Al Dariyah Dist.",
            "postalCode": "22028",
            "email": "test@cybs.com"
        },
        "amountDetails": {
            "totalAmount": "100",
            "currency": "SAR"
        }
    },
    "merchantInformation": {
        "categoryCode": 5411,
        "merchantDescriptor": {
            "country": "SA",
            "address1": "API Address",
            "postalCode": "12987-7318",
            "locality": "Riyadh",
            "name": "API Merchant-Name1"
        }
    },
    "paymentInformation": {
        "card": {
            "expirationYear": "2031",
            "number": "CARD_NUMBER",
            "securityCode": "123",
            "expirationMonth": "12",
            "type": "060"
        }
    }
}
```

Response to a Successful Request

```
{
    "paymentInformation": {
        "bin": "968208",
        "issuer": "Al Bank Al Saudi Al Fransi",
        "binCountry": "SA",
        "cardBrand": "MADA",
        "cardType": "PREPAID"
    },
    "paymentAccountInformation": {
        "card": {
            "currency": "SAR",
            "type": "060"
        }
    },
    "orderInformation": {
        "amountDetails": {
            "currency": "SAR",
            "authorizedAmount": "100.00"
        }
    },
    "processorInformation": {
        "approvalCode": "830SPG",
        "retrievalReferenceNumber": "334210123456",
        "cardVerification": {
            "resultCode": "M",
            "resultCodeRaw": "M"
        },
        "responseCode": "00",
        "consumerAuthenticationResponse": {
            "code": "2",
            "codeRaw": "2"
        },
        "settlementDate": "220915"
    },
    "_links": {
        "self": {
            "method": "GET",
            "href": "/pts/v2/payments/7020303222541234567890"
        },
        "refund": {
            "method": "POST",
            "href": "/pts/v2/payments/7020303222541234567890/refunds"
        }
    },
    "clientReferenceInformation": {
        "code": "TC_SPG_BASIC-1"
    },
    "consumerAuthenticationInformation": {
        "token": "abc"
    },
    "reconciliationId": "7020303222541234567890",
    "status": "COMPLETED",
    "id": "7020303222541234567890",
    "submitTimeUtc": "2023-12-08T10:12:02Z"
}
```

