Update Credit Card

Example Request

<?php
//Set up API path and method
$base_url = "https://app.paykickstart.com/api/";
$route = "purchase/update-cc";
$url = $base_url . $route;
$post = true;

//Create request data string
$data = http_build_query([
    "invoice_id" => "PK-PMNW0V5NLP",
    "auth_token" => "52YjafEGX4P8",
    "updateCcPw" => "9E780SDF",
    "stripeToken" => "tok_1DrPnbGHbWjVjDgKnht3VpQW",
    "ccNum" => "1985",
    "ExpireMonth" => 5,
    "ExpireYear" => 2022
]);

//Execute cURL request
$ch = curl_init();
if ($post) {
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
} else {
    $url = $url . "?" . $data;
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
$output = curl_exec($ch);
curl_close($ch);

//Output Response
echo json_decode($output);

Example Response

{
  "success": 1,
  "message": "Card updated"
}

This POST request updates a customer’s credit card information for a specified purchase. Please note that we DO NOT store your customer’s credit card details in Paykickstart. Paykickstart uses frontend tokenisation technology to protect you and your customers from passing payment information insecurely, and all information supplied via this API call is directly relayed to the linked payment processor where the payment profile is updated.

ARGUMENTS

invoice_id

The unique Paykickstart purchase ID


Payment Processor Tokens*

The payment processor token is required. Please refer to the new purchase documentation on how to generate tokens and which parameters to set.


ccNum

The last 4 digits of the customer’s new credit card number


ExpireMonth

The customer’s new credit card expiry month


ExpireYear

The customer’s new credit card expiry year


auth_token

The Paykickstart vendor’s API Key