> For the complete documentation index, see [llms.txt](https://pivot-payment.gitbook.io/pivot-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pivot-payment.gitbook.io/pivot-docs/payments/accept-payment/build-card-payment-use-case/pay-and-save-card-tokenization.md).

# Pay and Save Card (Tokenization)

Enable customers to save their payment methods securely for future use. This flow exchanges sensitive card or account details for a **payment token**, which can be reused for faster checkouts, recurring payments, or subscriptions without re-entering information

{% hint style="info" %}
Applicable only for Card and E-wallet
{% endhint %}

## Redirection Mode

### Initiation

Enable "Save Payment Information Detail" option for your customers, when the Charge is <mark style="color:orange;">`SUCCESS`</mark> We will save your Customer's Payment Information Detail in Token format under your Customer Object

<figure><img src="https://3640688391-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbRczl3VT35wkmuP4KTzZ%2Fuploads%2FKA9T94xVGl421UXR4Hhq%2Fimage.png?alt=media&amp;token=678c8797-c393-4611-b746-0ea054a97a16" alt=""><figcaption></figcaption></figure>

<details>

<summary>Create Payment Session  </summary>

A windowed time for the end customer to complete the payment, starting when the client initiates the payment request through your app. The payment session duration is customizable, with a default duration of 15 minutes.

API Reference: [Create Payment Session](/pivot-docs/api-references/api-lists/payments/payment-session/create-payment-session.md)

```json
POST [BASE_URL]/v2/payments

{
  "clientReferenceId": "1751610085",
  "amount": {
    "value": 10000,
    "currency": "IDR"
  },
  "paymentType": "SINGLE",
  "paymentMethod": {
    "type": "CARD"
  },
  "paymentMethodOptions": {
    "card": {
      "captureMethod": "automatic",
      "threeDsMethod": "CHALLENGE"
    }
  },
  "saveForFuture": true,
  "showSavePayment": null,
  "mode": "REDIRECT",
  "bypassStatusPage": false,
  "redirectUrl": {
    "successReturnUrl": "https://merchant.com/success",
    "failureReturnUrl": "https://merchant.com/failure",
    "expirationReturnUrl": "https://merchant.com/expiration"
  },
  "customer": {
    "givenName": "Reforza Jordan",
    "surname": "Geotama",
    "email": "reforza@pivot-payment.com",
    "phoneNumber": {
      "countryCode": "+62",
      "number": "89699990001"
    },
    "refundPreference": {
      "method": "AUTO",
      "transferDestination": {
        "channelCode": "014",
        "channelInformation": {
          "accountNumber": "17677665415",
          "accountName": "Reforza Jordan Geotama"
        }
      }
    }
  },
  "orderInformation": {
    "productDetails": [
      {
        "type": "PHYSICAL",
        "category": "FASHION",
        "subCategory": "FASHION WANITA",
        "name": "Dress Kasual Warna Putih",
        "description": "Ukuran M",
        "quantity": 1,
        "price": {
          "value": 100000,
          "currency": "IDR"
        }
      }
    ],
    "billingInfo": {
      "givenName": "Reforza Jordan",
      "surname": "Geotama",
      "email": "reforza@pivot-payment.com",
      "phoneNumber": {
        "countryCode": "+62",
        "number": "89699990001"
      },
      "addressLine1": "Biomedical Building Lantai 3",
      "addressLine2": "Digital hub, BSD City",
      "city": "Tangerang Regency",
      "provinceState": "Banten",
      "country": "ID",
      "postalCode": "15331"
    },
    "shippingInfo": {
      "givenName": "Reforza Jordan",
      "surname": "Geotama",
      "email": "reforza@pivot-payment.com",
      "phoneNumber": {
        "countryCode": "+62",
        "number": "89699990001"
      },
      "addressLine1": "Biomedical Building Lantai 3",
      "addressLine2": "Digital hub, BSD City",
      "city": "Tangerang Regency",
      "provinceState": "Banten",
      "country": "ID",
      "postalCode": "15331",
      "method": "REGULAR",
      "shippingFee": {
        "value": 100000,
        "currency": "IDR"
      }
    }
  },
  "autoConfirm": true,
  "statementDescriptor": "Reforza Pivot",
  "expiryAt": "2025-12-30T23:59:00Z",
  "metadata": {
    "invoiceNo": "INV001"
  }
}
```

</details>

<details>

<summary>Choose a mode </summary>

To generate Redirect Payment Page, choose mode “REDIRECT”

```json
{
  "mode": "REDIRECT"
}
```

</details>

<details>

<summary>Enable Save Payment Information Detail</summary>

To enable Customer to save their payment information detail, choose <mark style="color:orange;">`true`</mark>

```json
{
  "saveForFuture": true
}
```

</details>

<details>

<summary>Define Payment Method </summary>

Set <mark style="color:orange;">`autoConfirm`</mark> to true and fill <mark style="color:orange;">`paymentMethod`</mark> and <mark style="color:orange;">`paymentMethodOptions`</mark> Object to finalize the payment method from the previous step.

Reference:&#x20;

* [Payment Method Object](/pivot-docs/api-references/api-lists/payments/object/payment-method-object.md)
* [Payment Method Options Object](/pivot-docs/api-references/api-lists/payments/object/payment-method-options-object.md)

```json
{
  "paymentMethod": {
    "type": "CARD"
  },
  "paymentMethodOptions": {
    "card": {
      "captureMethod": "automatic",
      "threeDsMethod": "CHALLENGE"
    }
  },
  "autoConfirm": true
}
```

</details>

<details>

<summary>Send us your Success, Failure, and Expired Payment Session URL</summary>

Handle Success, Failure, and Expired cases on your Payment Session

Object reference: [Redirect Object](/pivot-docs/api-references/api-lists/payments/object/redirect-object.md)

```json
{
  "redirectUrl": {
    "successReturnUrl": "https://merchant.com/success",
    "failureReturnUrl": "https://merchant.com/failure",
    "expirationReturnUrl": "https://merchant.com/expiration"
  }
}
```

</details>

<details>

<summary>Fill Customer and Order information</summary>

Include customer and order details by filling the <mark style="color:orange;">`customer`</mark> and <mark style="color:orange;">`orderInformation`</mark> objects.  Personalize the payment experience, enhance fraud detection and reconciliation, and ensure smoother processing of refund requests.

Object Reference:

* [Customers](/pivot-docs/api-references/api-lists/core-resources/customers.md)
* [Order Object](/pivot-docs/api-references/api-lists/payments/object/order-object.md)

```json
{
  "customer": {
    "givenName": "Reforza Jordan",
    "surname": "Geotama",
    "email": "reforza@pivot-payment.com",
    "phoneNumber": {
      "countryCode": "+62",
      "number": "89699990001"
    },
    "refundPreference": {
      "method": "AUTO",
      "transferDestination": {
        "channelCode": "014",
        "channelInformation": {
          "accountNumber": "17677665415",
          "accountName": "Reforza Jordan Geotama"
        }
      }
    }
  },
  "orderInformation": {
    "productDetails": [
      {
        "type": "PHYSICAL",
        "category": "FASHION",
        "subCategory": "FASHION WANITA",
        "name": "Dress Kasual Warna Putih",
        "description": "Ukuran M",
        "quantity": 1,
        "price": {
          "value": 100000,
          "currency": "IDR"
        }
      }
    ],
    "billingInfo": {
      "givenName": "Reforza Jordan",
      "surname": "Geotama",
      "email": "reforza@pivot-payment.com",
      "phoneNumber": {
        "countryCode": "+62",
        "number": "89699990001"
      },
      "addressLine1": "Biomedical Building Lantai 3",
      "addressLine2": "Digital hub, BSD City",
      "city": "Tangerang Regency",
      "provinceState": "Banten",
      "country": "ID",
      "postalCode": "15331"
    },
    "shippingInfo": {
      "givenName": "Reforza Jordan",
      "surname": "Geotama",
      "email": "reforza@pivot-payment.com",
      "phoneNumber": {
        "countryCode": "+62",
        "number": "89699990001"
      },
      "addressLine1": "Biomedical Building Lantai 3",
      "addressLine2": "Digital hub, BSD City",
      "city": "Tangerang Regency",
      "provinceState": "Banten",
      "country": "ID",
      "postalCode": "15331",
      "method": "REGULAR",
      "shippingFee": {
        "value": 100000,
        "currency": "IDR"
      }
    }
  }
}
```

</details>

<details>

<summary>Redirect to Payment Page</summary>

After creating the Payment Session, redirect your customer to the URL for the Payment page returned in the response.

```json
{
  "paymentUrl": "https://payment.pivot-payment.com/detail?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1dWlkIjoiN2Y2NWM3NTctMzU1Zi00NjQ1LWFjMTQtMDI4YjM0YWI1MWIxIiwiaXNzIjoiYmFja2VuZC1wb3J0YWwiLCJleHAiOjE3NDM0NjU1NDV9.55-QdvI0xVtivNLJzREPDGzUbqFNEj7ouFUCvrzAIbw"
}
```

</details>

<details>

<summary>Simulate Payment</summary>

1. Visit the Payment Page
2. Tick "Save for future use" on the checklist box<br>

   <figure><img src="https://3640688391-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbRczl3VT35wkmuP4KTzZ%2Fuploads%2Fn1dqndvovZk5P5X3HdA9%2FScreenshot%202025-09-03%20at%2008.39.35.png?alt=media&amp;token=25b27cdc-e066-48ae-ae82-299df58f2c19" alt=""><figcaption></figcaption></figure>
3. [Simulate the Payment](/pivot-docs/api-references/api-lists/payments/payment-simulation.md)

</details>

<details>

<summary>Manage your Customer ID</summary>

Once the Payment Session has been generated, save and manage your <mark style="color:orange;">`customerId`</mark> to be used for future use.

{% hint style="info" %}
Stored Payment Method links to your <mark style="color:orange;">`customerId`</mark>
{% endhint %}

```json
{
  "customerId": "01975d90-bb55-76f6-b423-691c7868e85d"
}
```

</details>

### Use Saved Payment&#x20;

Reuse your customers' saved Payment Information details so that they can check out faster

<figure><img src="https://3640688391-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbRczl3VT35wkmuP4KTzZ%2Fuploads%2FOxM2ScOsKDVvp3GKqH1t%2Fimage.png?alt=media&amp;token=a0687f3d-3d93-4226-ad1a-9831c834cb89" alt=""><figcaption></figcaption></figure>

<details>

<summary>Create Payment Session  </summary>

A windowed time for the end customer to complete the payment, starting when the client initiates the payment request through your app. The payment session duration is customizable, with a default duration of 15 minutes.

API Reference: [Create Payment Session](/pivot-docs/api-references/api-lists/payments/payment-session/create-payment-session.md)

```json
POST [BASE_URL]/v2/payments

{
  "clientReferenceId": "1751610085",
  "amount": {
    "value": 10000,
    "currency": "IDR"
  },
  "paymentType": "SINGLE",
  "paymentMethod": {
    "type": "CARD"
  },
  "paymentMethodOptions": {
    "card": {
      "captureMethod": "automatic",
      "threeDsMethod": "CHALLENGE"
    }
  },
  "saveForFuture": true,
  "showSavePayment": true,
  "mode": "REDIRECT",
  "bypassStatusPage": false,
  "redirectUrl": {
    "successReturnUrl": "https://merchant.com/success",
    "failureReturnUrl": "https://merchant.com/failure",
    "expirationReturnUrl": "https://merchant.com/expiration"
  },
  "customer": {
    "givenName": "Reforza Jordan",
    "surname": "Geotama",
    "email": "reforza@pivot-payment.com",
    "phoneNumber": {
      "countryCode": "+62",
      "number": "89699990001"
    },
    "refundPreference": {
      "method": "AUTO",
      "transferDestination": {
        "channelCode": "014",
        "channelInformation": {
          "accountNumber": "17677665415",
          "accountName": "Reforza Jordan Geotama"
        }
      }
    }
  },
  "orderInformation": {
    "productDetails": [
      {
        "type": "PHYSICAL",
        "category": "FASHION",
        "subCategory": "FASHION WANITA",
        "name": "Dress Kasual Warna Putih",
        "description": "Ukuran M",
        "quantity": 1,
        "price": {
          "value": 100000,
          "currency": "IDR"
        }
      }
    ],
    "billingInfo": {
      "givenName": "Reforza Jordan",
      "surname": "Geotama",
      "email": "reforza@pivot-payment.com",
      "phoneNumber": {
        "countryCode": "+62",
        "number": "89699990001"
      },
      "addressLine1": "Biomedical Building Lantai 3",
      "addressLine2": "Digital hub, BSD City",
      "city": "Tangerang Regency",
      "provinceState": "Banten",
      "country": "ID",
      "postalCode": "15331"
    },
    "shippingInfo": {
      "givenName": "Reforza Jordan",
      "surname": "Geotama",
      "email": "reforza@pivot-payment.com",
      "phoneNumber": {
        "countryCode": "+62",
        "number": "89699990001"
      },
      "addressLine1": "Biomedical Building Lantai 3",
      "addressLine2": "Digital hub, BSD City",
      "city": "Tangerang Regency",
      "provinceState": "Banten",
      "country": "ID",
      "postalCode": "15331",
      "method": "REGULAR",
      "shippingFee": {
        "value": 100000,
        "currency": "IDR"
      }
    }
  },
  "autoConfirm": true,
  "statementDescriptor": "Reforza Pivot",
  "expiryAt": "2025-12-30T23:59:00Z",
  "metadata": {
    "invoiceNo": "INV001"
  }
}
```

</details>

<details>

<summary>Choose a mode</summary>

To generate Redirect Payment Page, choose mode “REDIRECT”

```json
{
  "mode": "REDIRECT"
}
```

</details>

<details>

<summary>Show saved Payment Information</summary>

To show the saved Payment Information to your Customer, choose <mark style="color:orange;">`true`</mark>

```json
{
  "showSavePayment": true
}
```

</details>

<details>

<summary>Define Payment Method</summary>

Set <mark style="color:orange;">`autoConfirm`</mark> to true and fill <mark style="color:orange;">`paymentMethod`</mark> and <mark style="color:orange;">`paymentMethodOptions`</mark> Object to finalize the payment method from the previous step.

Reference:&#x20;

* [Payment Method Object](/pivot-docs/api-references/api-lists/payments/object/payment-method-object.md)
* [Payment Method Options Object](/pivot-docs/api-references/api-lists/payments/object/payment-method-options-object.md)

```json
{
  "paymentMethod": {
    "type": "CARD"
  },
  "paymentMethodOptions": {
    "card": {
      "captureMethod": "automatic",
      "threeDsMethod": "CHALLENGE"
    }
  },
  "autoConfirm": true
}
```

</details>

<details>

<summary>Send us your Success, Failure, and Expired Payment Session URL</summary>

Handle Success, Failure, and Expired cases on your Payment Session

Object reference: [Redirect Object](/pivot-docs/api-references/api-lists/payments/object/redirect-object.md)

```json
{
  "redirectUrl": {
    "successReturnUrl": "https://merchant.com/success",
    "failureReturnUrl": "https://merchant.com/failure",
    "expirationReturnUrl": "https://merchant.com/expiration"
  }
}
```

</details>

<details>

<summary>Fill Customer ID and Order information</summary>

Include customer and order details by filling the saved <mark style="color:orange;">`customerId`</mark> and <mark style="color:orange;">`orderInformation`</mark> objects.  Personalize the payment experience, enhance fraud detection and reconciliation, and ensure smoother processing of refund requests.

Object Reference:

* [Customers](/pivot-docs/api-references/api-lists/core-resources/customers.md)
* [Order Object](/pivot-docs/api-references/api-lists/payments/object/order-object.md)

```json
{
  "customerId": "01975d90-bb55-76f6-b423-691c7868e85d",
  "orderInformation": {
    "productDetails": [
      {
        "type": "PHYSICAL",
        "category": "FASHION",
        "subCategory": "FASHION WANITA",
        "name": "Dress Kasual Warna Putih",
        "description": "Ukuran M",
        "quantity": 1,
        "price": {
          "value": 100000,
          "currency": "IDR"
        }
      }
    ],
    "billingInfo": {
      "givenName": "Reforza Jordan",
      "surname": "Geotama",
      "email": "reforza@pivot-payment.com",
      "phoneNumber": {
        "countryCode": "+62",
        "number": "89699990001"
      },
      "addressLine1": "Biomedical Building Lantai 3",
      "addressLine2": "Digital hub, BSD City",
      "city": "Tangerang Regency",
      "provinceState": "Banten",
      "country": "ID",
      "postalCode": "15331"
    },
    "shippingInfo": {
      "givenName": "Reforza Jordan",
      "surname": "Geotama",
      "email": "reforza@pivot-payment.com",
      "phoneNumber": {
        "countryCode": "+62",
        "number": "89699990001"
      },
      "addressLine1": "Biomedical Building Lantai 3",
      "addressLine2": "Digital hub, BSD City",
      "city": "Tangerang Regency",
      "provinceState": "Banten",
      "country": "ID",
      "postalCode": "15331",
      "method": "REGULAR",
      "shippingFee": {
        "value": 100000,
        "currency": "IDR"
      }
    }
  }
}
```

</details>

<details>

<summary>Redirect to Payment Page</summary>

After creating the Payment Session, redirect your customer to the URL for the Payment page returned in the response.

```json
{
  "paymentUrl": "https://payment.pivot-payment.com/detail?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1dWlkIjoiN2Y2NWM3NTctMzU1Zi00NjQ1LWFjMTQtMDI4YjM0YWI1MWIxIiwiaXNzIjoiYmFja2VuZC1wb3J0YWwiLCJleHAiOjE3NDM0NjU1NDV9.55-QdvI0xVtivNLJzREPDGzUbqFNEj7ouFUCvrzAIbw"
}
```

</details>

<details>

<summary>Simulate Payment</summary>

1. Visit the Payment Page
2. Choose your saved Payment Information detail, and input CVV/CVC to proceed with the Payment<br>

   <figure><img src="https://3640688391-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbRczl3VT35wkmuP4KTzZ%2Fuploads%2FrHe7N9g7kPYV4KO395hN%2FScreenshot%202025-09-03%20at%2009.12.14.png?alt=media&amp;token=667850d1-c6e5-4810-8382-a0942a21c3b8" alt=""><figcaption></figcaption></figure>

</details>

## API Mode

### Initiation

Enable "Save Payment Information Detail" option for your customers, when the Charge is <mark style="color:orange;">`SUCCESS`</mark> We will save your Customer's Payment Information Detail in Token format under your Customer Object

<figure><img src="https://3640688391-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbRczl3VT35wkmuP4KTzZ%2Fuploads%2FTt6wJAMCPmMcQ0sUDnxN%2Fimage.png?alt=media&amp;token=327aa1d5-c3c4-4760-a09b-17b424771cad" alt=""><figcaption></figcaption></figure>

<details>

<summary>Create Payment Session</summary>

A windowed time for the end customer to complete the payment, starting when the client initiates the payment request through your app. The payment session duration is customizable, with a default duration of 15 minutes.

API Reference: [Create Payment Session](/pivot-docs/api-references/api-lists/payments/payment-session/create-payment-session.md)

```json
POST [BASE_URL]/v2/payments

{
  "clientReferenceId": "1751620870",
  "amount": {
    "value": 10000,
    "currency": "IDR"
  },
  "paymentType": "SINGLE",
  "paymentMethod": {
    "type": "CARD"
  },
  "saveForFutureUse": true,
  "mode": "API",
  "redirectUrl": {
    "successReturnUrl": "https://merchant.com/success",
    "failureReturnUrl": "https://merchant.com/failure",
    "expirationReturnUrl": "https://merchant.com/expiration"
  },
  "customer": {
    "givenName": "Reforza Jordan",
    "surname": "Geotama",
    "email": "reforza@pivot-payment.com",
    "phoneNumber": {
      "countryCode": "+62",
      "number": "89699990001"
    },
    "refundPreference": {
      "method": "AUTO",
      "transferDestination": {
        "channelCode": "014",
        "channelInformation": {
          "accountNumber": "17677665415",
          "accountName": "Reforza Jordan Geotama"
        }
      }
    }
  },
  "orderInformation": {
    "productDetails": [
      {
        "type": "PHYSICAL",
        "category": "FASHION",
        "subCategory": "FASHION WANITA",
        "name": "Dress Kasual Warna Putih",
        "description": "Ukuran M",
        "quantity": 1,
        "price": {
          "value": 100000,
          "currency": "IDR"
        }
      }
    ],
    "billingInfo": {
      "givenName": "Reforza Jordan",
      "surname": "Geotama",
      "email": "reforza@pivot-payment.com",
      "phoneNumber": {
        "countryCode": "+62",
        "number": "89699990001"
      },
      "addressLine1": "Biomedical Building Lantai 3",
      "addressLine2": "Digital hub, BSD City",
      "city": "Tangerang Regency",
      "provinceState": "Banten",
      "country": "ID",
      "postalCode": "15331"
    },
    "shippingInfo": {
      "givenName": "Reforza Jordan",
      "surname": "Geotama",
      "email": "reforza@pivot-payment.com",
      "phoneNumber": {
        "countryCode": "+62",
        "number": "89699990001"
      },
      "addressLine1": "Biomedical Building Lantai 3",
      "addressLine2": "Digital hub, BSD City",
      "city": "Tangerang Regency",
      "provinceState": "Banten",
      "country": "ID",
      "postalCode": "15331",
      "method": "REGULAR",
      "shippingFee": {
        "value": 100000,
        "currency": "IDR"
      }
    }
  },
  "autoConfirm": false,
  "statementDescriptor": "Reforza Pivot",
  "expiryAt": "2025-12-30T23:59:00Z",
  "metadata": {
    "invoiceNo": "INV001"
  }
}
```

</details>

<details>

<summary>Choose a mode</summary>

To manage your own Card Input Page choose mode “API”

```json
{
  "mode": "API"
}
```

</details>

<details>

<summary>Enable Save Payment Information Detail</summary>

To enable Customer to save their payment information detail, choose <mark style="color:orange;">`true`</mark>

{% hint style="info" %}
Can be sent later in Confirm Payment Session
{% endhint %}

```json
{
  "saveForFuture": true
}
```

</details>

<details>

<summary>Define Payment Method</summary>

Set <mark style="color:orange;">`autoConfirm`</mark> to false and fill <mark style="color:orange;">`paymentMethod.type`</mark> = "CARD" to generate the Card RSA Encryption Key

Object Reference:&#x20;

* [Payment Method Object](/pivot-docs/api-references/api-lists/payments/object/payment-method-object.md)

```json
{
  "paymentMethod": {
    "type": "CARD"
  },
  "autoConfirm": false
}
```

</details>

<details>

<summary>Send us your Success, Failure, and Expired Payment Session URL</summary>

Handle Success, Failure, and Expired cases on your Payment Session

Object reference: [Redirect Object](/pivot-docs/api-references/api-lists/payments/object/redirect-object.md)

```json
{
  "redirectUrl": {
    "successReturnUrl": "https://merchant.com/success",
    "failureReturnUrl": "https://merchant.com/failure",
    "expirationReturnUrl": "https://merchant.com/expiration"
  }
}
```

</details>

<details>

<summary>Fill Customer and Order information</summary>

Include customer and order details by filling the <mark style="color:orange;">`customer`</mark> and <mark style="color:orange;">`orderInformation`</mark> objects.  Personalize the payment experience, enhance fraud detection and reconciliation, and ensure smoother processing of refund requests.

Object Reference:

* [Customers](/pivot-docs/api-references/api-lists/core-resources/customers.md)
* [Order Object](/pivot-docs/api-references/api-lists/payments/object/order-object.md)

```json
{
  "customer": {
    "givenName": "Reforza Jordan",
    "surname": "Geotama",
    "email": "reforza@pivot-payment.com",
    "phoneNumber": {
      "countryCode": "+62",
      "number": "89699990001"
    },
    "refundPreference": {
      "method": "AUTO",
      "transferDestination": {
        "channelCode": "014",
        "channelInformation": {
          "accountNumber": "17677665415",
          "accountName": "Reforza Jordan Geotama"
        }
      }
    }
  },
  "orderInformation": {
    "productDetails": [
      {
        "type": "PHYSICAL",
        "category": "FASHION",
        "subCategory": "FASHION WANITA",
        "name": "Dress Kasual Warna Putih",
        "description": "Ukuran M",
        "quantity": 1,
        "price": {
          "value": 100000,
          "currency": "IDR"
        }
      }
    ],
    "billingInfo": {
      "givenName": "Reforza Jordan",
      "surname": "Geotama",
      "email": "reforza@pivot-payment.com",
      "phoneNumber": {
        "countryCode": "+62",
        "number": "89699990001"
      },
      "addressLine1": "Biomedical Building Lantai 3",
      "addressLine2": "Digital hub, BSD City",
      "city": "Tangerang Regency",
      "provinceState": "Banten",
      "country": "ID",
      "postalCode": "15331"
    },
    "shippingInfo": {
      "givenName": "Reforza Jordan",
      "surname": "Geotama",
      "email": "reforza@pivot-payment.com",
      "phoneNumber": {
        "countryCode": "+62",
        "number": "89699990001"
      },
      "addressLine1": "Biomedical Building Lantai 3",
      "addressLine2": "Digital hub, BSD City",
      "city": "Tangerang Regency",
      "provinceState": "Banten",
      "country": "ID",
      "postalCode": "15331",
      "method": "REGULAR",
      "shippingFee": {
        "value": 100000,
        "currency": "IDR"
      }
    }
  }
}
```

</details>

<details>

<summary>Get RSA Encryption Key details</summary>

After creating the Payment Session, pass the RSA Encryption Key to the Merchant Front-end, which is returned in the response.

Object Reference: [Payment Session Object](/pivot-docs/api-references/api-lists/payments/object/payment-session-object.md)

```json
{
  "encryptionKey": "Eykc6QYeUuG5aKcPMrUsaZq0bWWCGLJY"
}
```

</details>

<details>

<summary>Encrypt Card Information in Merchant Front-end</summary>

Encrypt Card Information details using the RSA Encryption Key from the Merchant Back-end, then pass the Encrypted Card to the Merchant Back-end

Encryption Code Reference: [Card Encryption](/pivot-docs/api-references/api-lists/payments/card-encryption.md)

Card Simulation Reference: [Payment Simulation](/pivot-docs/api-references/api-lists/payments/payment-simulation.md)

</details>

<details>

<summary>Confirm Payment Session</summary>

Finalize the Payment Method by filling <mark style="color:orange;">`paymentMethod.card.encryptedCard`</mark> and <mark style="color:orange;">`paymentMethodOptions`</mark> objects

API Reference: [Confirm Payment Session](/pivot-docs/api-references/api-lists/payments/payment-session/confirm-payment-session.md)

```json
POST [BASE_URL]/v2/payments/{id}/confirm

{
  "paymentMethod": {
    "type": "CARD",
    "card": {
      "encryptedCard": "vFbUU18gh35lmeVnhb7fgG91tBNb890MTv+0yKBEIARbaiYFySPTvFZZGa7f5V9ONqAJg6KKmtsQn2Qmt7R7V8KdscSgB29zr8MypMvofd3RjNihKk8QvbWOe1qaVjoIzEvkO30oMm3go1nPRFtVcojpw+NAyF1Uip1ED7fZGDfo5haaa2jdSGRg3kei12LcOHZ5jfh94GsPrQ4MCsWfKn1o8Y5b/aPAmfRsfQ2BnGudFAfoxG4hCdCcUTtpNBTt27dPIVeCdyfoOaRRjjgM3JO1dCerhAOgCw2DOvBsHw+Z2VJHJmURPvVTOiuZhSa8E6SRQ1GW7Cf4CRlPLmLa54UU6hbyNePq7W7TGMV11j8Slzan6JF0Wayow0gJp+aTjSER4ZwrmyqRTxKKA2l4t6vi66Yc2B/bzsJtslYa5tJoxmatavuCZma29kUtqU9Dtlu2UNkGoW7XweBtwxkOWpFLfnufTLYNpd7SuaRqOvW0Yc6CjbXZMbradd3ZqFJ+mtSOuU3BAFV5xSjxv90mYWqnZBOpZIVM3WZQanJ//fEReXg7YasvAxQIGYBJybob3uy4mEcODVy6Ty9E9c0UdF5WN7XV0K+5bTLzGEPlMSlTqgL4HSccXp4dpVdWFL4XpVwQBgdjtpmRpklfyaco4YFlGutFSgVYvEitAKYkCtpG9m6RYw4="
    }
  },
  "paymentMethodOptions": {
    "card": {
      "captureMethod": "automatic",
      "threeDsMethod": "CHALLENGE",
      "processingConfig": {
        "bankMerchantId": null,
        "merchantIdTag": null
      }
    }
  }
}
```

</details>

<details>

<summary>Redirect to 3DS Page</summary>

After confirming the Payment Session, redirect your customer to the 3DS Page URL for authenticating the transaction returned in the response.

```json
{
  "paymentUrl": "https://creditcard-webview-stg.harsya.com/payment/creditcard/threeds?client_transaction_id=1751620870&acquirer_transaction_id=TRXCC36ac8979a69a17516228851&session_id=FYb9MAxPBhiwsMGEwbtV5SmkF6t2DnWK"
}
```

</details>

<details>

<summary>Manage your Customer ID</summary>

Once the Payment Session has been generated, save and manage your <mark style="color:orange;">`customerId`</mark> to be used for future use

{% hint style="info" %}
Stored Payment Method links to your <mark style="color:orange;">`customerId`</mark>
{% endhint %}

```json
{
  "customerId": "01975d90-bb55-76f6-b423-691c7868e85d"
}
```

</details>

### Use Saved Payment

Reuse your customers' saved Payment Information details so that they can check out faster

<figure><img src="https://3640688391-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbRczl3VT35wkmuP4KTzZ%2Fuploads%2F6zYqSFzFp7TaoFtEXDLi%2Fimage.png?alt=media&amp;token=9492be5b-040c-4ef2-b00d-5ee9e07bcfbc" alt=""><figcaption></figcaption></figure>

<details>

<summary>Get Stored Payment Information Detail</summary>

Get the Stored Payment Information details to be shown in the Merchant Front-end whenever your Customer uses saved Payment

API Reference: [Retrieve Customer](/pivot-docs/api-references/api-lists/core-resources/customers/retrieve-customer.md)

```json
GET [BASE_URL]/v1/customers/{customerId}

{
  "code": "00",
  "message": "Success",
  "data": {
    "givenName": "Reforza Jordan",
    "sureName": "Geotama",
    "email": "reforza@pivot-payment.com",
    "phoneNumber": {
      "countryCode": "+62",
      "number": "089699990003"
    },
    "refundPreference": {
      "method": "AUTO",
      "transferDestination": {
        "channelCode": "014",
        "channelInformation": {
          "accountNumber": "17677665415",
          "accountName": "Reforza Jordan Geotama"
        }
      }
    },
    "storedPaymentMethods": [
      {
        "token": "020027de-134e-45ed-8f0d-7ae0506a7133",
        "paymentMethod": "CARD",
        "paymentChannel": "VISA",
        "status": "ACTIVE",
        "createdAt": "2025-09-02T06:02:59.141590124Z",
        "card": {
          "fingerprint": "0198edcf-87a0-73fd-b937-7ec4b0ddb9c6",
          "network": "VISA",
          "first6": "444000",
          "first8": "44400001",
          "last4": "0002",
          "expMonth": "01",
          "expYear": "39",
          "cardHolderFirstName": "Reforza Jordan",
          "cardHolderLastName": "Geotama"
        }
      }
    ]
  }
}
```

</details>

<details>

<summary>Create Payment Session</summary>

A windowed time for the end customer to complete the payment, starting when the client initiates the payment request through your app. The payment session duration is customizable, with a default duration of 15 minutes.

API Reference: [Create Payment Session](/pivot-docs/api-references/api-lists/payments/payment-session/create-payment-session.md)

```json
POST [BASE_URL]/v2/payments

{
  "clientReferenceId": "1751620870",
  "amount": {
    "value": 10000,
    "currency": "IDR"
  },
  "paymentType": "SINGLE",
  "paymentMethod": {
    "type": "CARD",
    "card": {
      "token": "020027de-134e-45ed-8f0d-7ae0506a7133",
      "cvc": "123"
    }
  },
  "paymentMethodOptions": {
    "card": {
      "captureMethod": "automatic",
      "threeDsMethod": "CHALLENGE"
    }
  },
  "saveForFutureUse": true,
  "mode": "API",
  "redirectUrl": {
    "successReturnUrl": "https://merchant.com/success",
    "failureReturnUrl": "https://merchant.com/failure",
    "expirationReturnUrl": "https://merchant.com/expiration"
  },
  "customerId": "01975d90-bb55-76f6-b423-691c7868e85d",
  "orderInformation": {
    "productDetails": [
      {
        "type": "PHYSICAL",
        "category": "FASHION",
        "subCategory": "FASHION WANITA",
        "name": "Dress Kasual Warna Putih",
        "description": "Ukuran M",
        "quantity": 1,
        "price": {
          "value": 100000,
          "currency": "IDR"
        }
      }
    ],
    "billingInfo": {
      "givenName": "Reforza Jordan",
      "surname": "Geotama",
      "email": "reforza@pivot-payment.com",
      "phoneNumber": {
        "countryCode": "+62",
        "number": "89699990001"
      },
      "addressLine1": "Biomedical Building Lantai 3",
      "addressLine2": "Digital hub, BSD City",
      "city": "Tangerang Regency",
      "provinceState": "Banten",
      "country": "ID",
      "postalCode": "15331"
    },
    "shippingInfo": {
      "givenName": "Reforza Jordan",
      "surname": "Geotama",
      "email": "reforza@pivot-payment.com",
      "phoneNumber": {
        "countryCode": "+62",
        "number": "89699990001"
      },
      "addressLine1": "Biomedical Building Lantai 3",
      "addressLine2": "Digital hub, BSD City",
      "city": "Tangerang Regency",
      "provinceState": "Banten",
      "country": "ID",
      "postalCode": "15331",
      "method": "REGULAR",
      "shippingFee": {
        "value": 100000,
        "currency": "IDR"
      }
    }
  },
  "autoConfirm": true,
  "statementDescriptor": "Reforza Pivot",
  "expiryAt": "2025-12-30T23:59:00Z",
  "metadata": {
    "invoiceNo": "INV001"
  }
}
```

</details>

<details>

<summary>Choose a mode</summary>

To manage your own Card Input Page choose mode “API”

```json
{
  "mode": "API"
}
```

</details>

<details>

<summary>Define Payment Method</summary>

Set <mark style="color:orange;">`autoConfirm`</mark> to true, fill Saved Payment Information from Get Stored Payment Information Detail and CVC from Merchant Front-end in <mark style="color:orange;">`paymentMethod`</mark> and <mark style="color:orange;">`paymentMethodOptions`</mark> Object to finalize the payment method from the previous step.

Reference:&#x20;

* [Payment Method Object](/pivot-docs/api-references/api-lists/payments/object/payment-method-object.md)
* [Payment Method Options Object](/pivot-docs/api-references/api-lists/payments/object/payment-method-options-object.md)

```json
{
  "paymentMethod": {
    "type": "CARD",
    "card": {
      "token": "020027de-134e-45ed-8f0d-7ae0506a7133",
      "cvc": "123" // Optional
    }
  },
  "paymentMethodOptions": {
    "card": {
      "captureMethod": "automatic",
      "threeDsMethod": "CHALLENGE"
    }
  },
  "autoConfirm": true
}
```

</details>

<details>

<summary>Send us your Success, Failure, and Expired Payment Session URL</summary>

Handle Success, Failure, and Expired cases on your Payment Session

Object reference: [Redirect Object](/pivot-docs/api-references/api-lists/payments/object/redirect-object.md)

```json
{
  "redirectUrl": {
    "successReturnUrl": "https://merchant.com/success",
    "failureReturnUrl": "https://merchant.com/failure",
    "expirationReturnUrl": "https://merchant.com/expiration"
  }
}
```

</details>

<details>

<summary>Fill Customer ID and Order information</summary>

Include customer and order details by filling the saved <mark style="color:orange;">`customerId`</mark> and <mark style="color:orange;">`orderInformation`</mark> objects.  Personalize the payment experience, enhance fraud detection and reconciliation, and ensure smoother processing of refund requests.

Object Reference:

* [Customers](/pivot-docs/api-references/api-lists/core-resources/customers.md)
* [Order Object](/pivot-docs/api-references/api-lists/payments/object/order-object.md)

```json
{
  "customerId": "01975d90-bb55-76f6-b423-691c7868e85d",
  "orderInformation": {
    "productDetails": [
      {
        "type": "PHYSICAL",
        "category": "FASHION",
        "subCategory": "FASHION WANITA",
        "name": "Dress Kasual Warna Putih",
        "description": "Ukuran M",
        "quantity": 1,
        "price": {
          "value": 100000,
          "currency": "IDR"
        }
      }
    ],
    "billingInfo": {
      "givenName": "Reforza Jordan",
      "surname": "Geotama",
      "email": "reforza@pivot-payment.com",
      "phoneNumber": {
        "countryCode": "+62",
        "number": "89699990001"
      },
      "addressLine1": "Biomedical Building Lantai 3",
      "addressLine2": "Digital hub, BSD City",
      "city": "Tangerang Regency",
      "provinceState": "Banten",
      "country": "ID",
      "postalCode": "15331"
    },
    "shippingInfo": {
      "givenName": "Reforza Jordan",
      "surname": "Geotama",
      "email": "reforza@pivot-payment.com",
      "phoneNumber": {
        "countryCode": "+62",
        "number": "89699990001"
      },
      "addressLine1": "Biomedical Building Lantai 3",
      "addressLine2": "Digital hub, BSD City",
      "city": "Tangerang Regency",
      "provinceState": "Banten",
      "country": "ID",
      "postalCode": "15331",
      "method": "REGULAR",
      "shippingFee": {
        "value": 100000,
        "currency": "IDR"
      }
    }
  }
}
```

</details>

<details>

<summary>Redirect to 3DS Page</summary>

After creating the Payment Session, redirect your customer to the 3DS Page URL for authenticating the transaction returned in the response.

```json
{
  "paymentUrl": "https://creditcard-webview-stg.harsya.com/payment/creditcard/threeds?client_transaction_id=1751620870&acquirer_transaction_id=TRXCC36ac8979a69a17516228851&session_id=FYb9MAxPBhiwsMGEwbtV5SmkF6t2DnWK"
}
```

</details>
