Skip to main content

Add payment method

POST 

/checkout/add-payment-method

Add payment method.

Authorization Action:

pay:methods:create

Request

Bodyrequired

    cancel_urlstring

    If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website.

    success_urlstringrequired

    The URL to which the customers is redirected when payment or setup is complete.

    payment_method_typesstring[]

    Possible values: [card, paypal, customer_balance]

    Default value: ["card"]
    customerstring

    ID of an existing Customer, if one exists. If blank, a new Customer object based on information provided during the payment flow will be created.

Responses

Schema
    urlstringrequired
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://connhex.com/checkout/add-payment-method");
request.Headers.Add("Accept", "application/json");
var content = new StringContent("{\n \"cancel_url\": \"string\",\n \"success_url\": \"string\",\n \"payment_method_types\": [\n \"card\"\n ],\n \"customer\": \"string\"\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Request Collapse all
Body required
{
  "cancel_url": "string",
  "success_url": "string",
  "payment_method_types": [
    "card"
  ],
  "customer": "string"
}