Feature: One Click

One Click feature allows your customers to make purchases with just one click using previously saved payment information.
The additional attributes in credit-card object required to configure One Click feature are token_id, saved_token_id. Successful request returns transaction_status:capture and is ready for settlement.

You need a token from Get Card Token response to charge with One Click feature.




One Click Initial Charge Request


{
    "payment_type": "credit_card",
    "credit_card": {
        "token_id": "4811117d16c884-2cc7-4624-b0a8-10273b7f6cc8",
        "save_token_id": true     // <-- To flag that token is saved during initial charge
    },
    "transaction_details": {
        "order_id": "A87550",
        "gross_amount": 145000
    }
}

The credit_card object in Charge request to configure the initial One Click feature is identical with Card Charge Request, with the additional attributes given below.

JSON AttributeDescriptionType
token_idToken ID represents customer's card information acquired from Get Card Token response.String
save_token_idA flag to indicate whether the token_id is saved for future transactions.Boolean



One Click Initial Charge Response and Notifications


{
    "status_code": "200",
    "status_message": "Success, Credit Card 3D Secure transaction is successful",
    "transaction_id": "f50c0aef-b629-4a5b-957b-4c52f45e2e63",
    "order_id": "A87550",
    "payment_type": "credit_card",
    "transaction_time": "2014-08-25 11:21:48",
    "transaction_status": "capture",
    "fraud_status": "accept",
    "masked_card": "48111111-1114",
    "saved_token_id": "4811117d16c884-2cc7-4624-b0a8-10273b7f6cc8",
    "saved_token_id_expired_at": "2024-08-25 11:21:48",
    "approval_code": "1408940508666",
    "gross_amount": "145000.00",
    "bank": "bni",
    "channel_response_code": "00",
    "channel_response_message": "Approved",
    "currency": "IDR",
    "card_type": "credit",
    "on_us": true
}
{
  "masked_card": "48111111-1114",
  "approval_code": "1408940508666",
  "bank": "bni",
  "eci": "05",
  "saved_token_id": "4811117d16c884-2cc7-4624-b0a8-10273b7f6cc8",
  "saved_token_id_expired_at": "2024-08-25 11:21:48",
  "transaction_time": "2014-08-25 11:21:48",
  "gross_amount": "145000.00",
  "order_id": "A87550",
  "payment_type": "credit_card",
  "signature_key": "c77f17bf6a8dee35c19f02f2c33f9e4a2ee61b4bad15370a9f0f149a96909c8d887a0e0cddeb47bd02e88f369422aee6e323aaf938bb7bc5c55228459babbdb1",
  "status_code": "200",
  "transaction_id": "f50c0aef-b629-4a5b-957b-4c52f45e2e63",
  "transaction_status": "capture",
  "fraud_status": "accept",
  "status_message": "midtrans payment notification",
  "channel_response_code": "00",
  "channel_response_message": "Approved",
  "card_type": "credit",
  "on_us": false
}

One Click Initial Charge response and notifications are identical with Card Payment Charge response and notifications, with additional attributes given below.

JSON AttributeDescriptionType
saved_token_idToken ID of a card to be charged for the future transactions.String
saved_token_id_expired_atExpiry date of the Token ID.String



One Click Subsequent Charge


{
    "payment_type": "credit_card",
    "credit_card": {
        "token_id": "44811117d16c884-2cc7-4624-b0a8-10273b7f6cc8"
    },
    "transaction_details": {
        "order_id": "A87551",
        "gross_amount": 145000
    }
}

You need saved_token_id from initial Charge response in order to charge future One Click transactions.

JSON AttributeDescriptionType
token_idsaved_token_id represents customer's card information acquired from One Click initial Charge response.String



One Click Subsequent Charge Response and Notifications


Subsequent One Click Charge response is identical with Card Payment Charge Response.
Successful One Click transaction is described as capture and is ready for settlement.