Pike13 For Developers
Get Started
Authentication
Core API
Reporting API
Webhooks API
Announcements

Core API Documentation

Form of Payment

Represent a client's available forms of payment. You can view a client's credit card or ACH account information. You can also save a new card (and, for some payment gateways, a bank account) in the business's payment gateway. The method depends on the gateway; see Saving Cards and Bank Accounts for which one applies.

Building a signup or onboarding flow that saves a card on file? Start with the card-on-file guide and review what the API does not support before you design your integration.

Front

GET /api/v2/front/people/me/form_of_payments/:id
GET /api/v2/front/people/:person_id/form_of_payments/:id

Returns the details of a Form of Payment. But, only for the person logged in.

Show curl example

REQUEST
$ curl https://mybiz.pike13.com/api/v2/front/people/me/form_of_payments/1?client_id=XXXXXXXXXXXXXX

RESPONSE
{
  "form_of_payments": [
    {
      "id": 1,
      "type": "creditcard",
      "first_name": "Jane",
      "last_name": "Client",
      "autobill": false,
      "created_at": "2017-06-26T23:13:40Z",
      "updated_at": "2017-06-26T23:13:40Z",
      "card_type": "visa",
      "expire_month": 12,
      "expire_year": 2020,
      "last_four": "1111"
    }
  ]
}

REQUEST
$ curl https://mybiz.pike13.com/api/v2/front/people/1/form_of_payments/2?client_id=XXXXXXXXXXXXXX

RESPONSE
{
  "form_of_payments": [
    {
      "id": 2,
      "type": "ach",
      "first_name": "Jane",
      "last_name": "Client",
      "autobill": false,
      "created_at": "2017-06-26T23:13:40Z",
      "updated_at": "2017-06-26T23:13:40Z",
      "account_name": "Big Bank",
      "account_type": "checking",
      "account_holder_type": "personal",
      "account_number": "1xxxx3123",
      "routing_number": "1xxxx3123"
    }
  ]
}

GET /api/v2/front/people/:person_id/form_of_payments

Lists all of the vaulted Forms of Payment for a person.

Show curl example

REQUEST
$ curl https://mybiz.pike13.com/api/v2/front/people/1/form_of_payments \
  -H "Authorization: Bearer XXXXXXXXXXXXXXX"

RESPONSE
{
  "form_of_payments": [
    {
      "id": 1,
      "type": "creditcard",
      "first_name": "Jane",
      "last_name": "Client",
      "autobill": false,
      "created_at": "2017-06-27T22:00:07Z",
      "updated_at": "2017-06-27T22:00:07Z",
      "card_type": "visa",
      "expire_month": 1,
      "expire_year": 2023,
      "last_four": "4242"
    },
    {
      "id": 7,
      "type": "ach",
      "first_name": "Jane",
      "last_name": "Client",
      "autobill": true,
      "created_at": "2017-06-29T20:32:31Z",
      "updated_at": "2017-06-29T20:32:31Z",
      "account_name": "Bank of America",
      "account_number": "0xxxxxxxx4321",
      "routing_number": "1xxxx0024",
      "account_type": "checking"
    }
  ]
}

Attributes

See the attributes table below in the Desk section.

POST /api/v2/front/people/:person_id/form_of_payments

Saves a card or bank account for the logged-in client. See Saving Cards and Bank Accounts below.

PUT /api/v2/front/people/:person_id/form_of_payments/:id

Updates and returns a form_of_payment for the person logged in. There can only be one default (autobill) form of payment for each person. To turn off autobill for a form of payment, you must turn it on for another form of payment.

Show curl example

REQUEST
$ curl -X PUT https://mybiz.pike13.com/api/v2/front/people/1/form_of_payments/1 \
  -H "Authorization: Bearer XXXXXXXXXXXXXXX" \
  -H "Content-Type: application/json" \
  -d '{"form_of_payment":{"autobill": true}}'

RESPONSE
{
  "form_of_payments": [
    {
      "id": 1,
      "type": "creditcard",
      "first_name": "Jane",
      "last_name": "Client",
      "autobill": false,
      "created_at": "2017-06-27T22:00:07Z",
      "updated_at": "2017-06-27T22:00:07Z",
      "card_type": "visa",
      "expire_month": 1,
      "expire_year": 2023,
      "last_four": "4242"
    }
  ]
}

REQUEST
$ curl -X PUT https://mybiz.pike13.com/api/v2/front/people/1/form_of_payments/7 \
  -H "Authorization: Bearer XXXXXXXXXXXXXXX" \
  -H "Content-Type: application/json" \
  -d '{"form_of_payment":{"autobill": true}}'

RESPONSE
{
  "form_of_payments": [
    {
      "id": 7,
      "type": "ach",
      "first_name": "Jane",
      "last_name": "Client",
      "autobill": true,
      "created_at": "2017-06-29T20:32:31Z",
      "updated_at": "2017-06-29T20:32:31Z",
      "account_name": "Bank of America",
      "account_number": "0xxxxxxxx4321",
      "routing_number": "1xxxx0024",
      "account_type": "checking"
    }
  ]
}

Attributes

See the attributes table below in the Desk section

DELETE /api/v2/front/people/:person_id/form_of_payments/:id

Deletes a form_of_payment for the person logged in. Payment methods cannot be deleted if they are set as default, nor if they are the last remaining payment method on file.

Show curl example

REQUEST
$ curl -X DELETE https://mybiz.pike13.com/api/v2/front/people/1/form_of_payments/1 \
  -H "Authorization: Bearer XXXXXXXXXXXXXXX" \
  -H "Content-Type: application/json"

RESPONSE
{
  message: "Payment method deleted successfully"
}

Desk

GET /api/v2/desk/people/:person_id/form_of_payments/:id

Returns the details of a Form of Payment for anyone within the business.

Show curl example

REQUEST
$ curl https://mybiz.pike13.com/api/v2/desk/people/1/form_of_payments/1 \
  -H "Authorization: Bearer XXXXXXXXXXXXXXX"

RESPONSE
{
  "form_of_payments": [
    {
      "id": 1,
      "type": "creditcard",
      "first_name": "Jane",
      "last_name": "Client",
      "autobill": false,
      "created_at": "2017-06-26T23:13:40Z",
      "updated_at": "2017-06-26T23:13:40Z",
      "card_type": "visa",
      "expire_month": 12,
      "expire_year": 2020,
      "last_four": "1111"
    }
  ]
}

REQUEST
$ curl https://mybiz.pike13.com/api/v2/desk/people/1/form_of_payments/2?client_id=XXXXXXXXXXXXXX

RESPONSE
{
  "form_of_payments": [
    {
      "id": 2,
      "type": "ach",
      "first_name": "Jane",
      "last_name": "Client",
      "autobill": false,
      "created_at": "2017-06-26T23:13:40Z",
      "updated_at": "2017-06-26T23:13:40Z",
      "account_name": "Big Bank",
      "account_type": "checking",
      "account_holder_type": "personal",
      "account_number": "1xxxx3123",
      "routing_number": "1xxxx3123"
    }
  ]
}

GET /api/v2/desk/people/:person_id/form_of_payments

Lists all of the Forms of Payment for a person.

Show curl example

REQUEST
$ curl https://mybiz.pike13.com/api/v2/desk/people/1/form_of_payments \
  -H "Authorization: Bearer XXXXXXXXXXXXXXX"

RESPONSE
{
  "form_of_payments": [
    {
      "id": 1,
      "type": "creditcard",
      "first_name": "Autumn",
      "last_name": "Langworth",
      "autobill": false,
      "created_at": "2017-06-27T22:00:07Z",
      "updated_at": "2017-06-27T22:00:07Z",
      "card_type": "visa",
      "expire_month": 1,
      "expire_year": 2023,
      "last_four": "4242"
    },
    {
      "id": 7,
      "type": "Ach",
      "first_name": "Autumn",
      "last_name": "Langworth",
      "autobill": true,
      "created_at": "2017-06-29T20:32:31Z",
      "updated_at": "2017-06-29T20:32:31Z",
      "account_name": "Bank of America",
      "account_number": "0xxxxxxxx4321",
      "routing_number": "1xxxx0024",
      "account_type": "checking"
    }
  ]
}

Attributes

These apply to the Front and Desk versions of the API.

idintegerThe id of the form of payment.
typestringEither "creditcard" or "ach". Some fields below will change depending on type.
first_namestringThe first name on the account.
last_namestringThe last name on the account.
autobillbooleanWhether this form of payment is the default for autobills.
created_attimestampWhen this form of payment was created.
updated_attimestampWhen this form of payment last updated.
card_typestringCredit card only. One of: visa, mastercard, discover, american_express, unknown.
expire_monthnumberCredit card only. The expiration month, e.g. 12
expire_yearnumberCredit card only. The expiration year, e.g. 2019
last_fourstringCredit card only. The last 4 digits of the credit card.
account_namestringACH only. A friendly description, e.g. Mega Savings Bank
account_typestringACH only. One of: savings, checking
account_holder_typestringACH only. One of: personal, business
account_numberstringACH only. The obfuscated account number
routing_numberstringACH only. The obfuscated routing number
POST /api/v2/desk/people/:person_id/form_of_payments

Saves a card or bank account for any client in the business. See Saving Cards and Bank Accounts below.

PUT /api/v2/desk/people/:person_id/form_of_payments/:id

Updates and returns a Form of Payment for anyone in the business. There can only be one default (autobill) form of payment for each person. To turn off autobill for a form of payment, you must turn it on for another form of payment.

Show curl example

REQUEST
$ curl -X PUT https://mybiz.pike13.com/api/v2/desk/people/1/form_of_payments/1 \
  -H "Authorization: Bearer XXXXXXXXXXXXXXX" \
  -H "Content-Type: application/json" \
  -d '{"form_of_payment":{"autobill": true}}'

RESPONSE
{
  "form_of_payments": [
    {
      "id": 1,
      "type": "creditcard",
      "first_name": "Jane",
      "last_name": "Client",
      "autobill": false,
      "created_at": "2017-06-27T22:00:07Z",
      "updated_at": "2017-06-27T22:00:07Z",
      "card_type": "visa",
      "expire_month": 1,
      "expire_year": 2023,
      "last_four": "4242"
    }
  ]
}

REQUEST
$ curl -X PUT https://mybiz.pike13.com/api/v2/desk/people/1/form_of_payments/7 \
  -H "Authorization: Bearer XXXXXXXXXXXXXXX" \
  -H "Content-Type: application/json" \
  -d '{"form_of_payment":{"autobill": true}}'

RESPONSE
{
  "form_of_payments": [
    {
      "id": 7,
      "type": "ach",
      "first_name": "Jane",
      "last_name": "Client",
      "autobill": true,
      "created_at": "2017-06-29T20:32:31Z",
      "updated_at": "2017-06-29T20:32:31Z",
      "account_name": "Bank of America",
      "account_number": "0xxxxxxxx4321",
      "routing_number": "1xxxx0024",
      "account_type": "checking"
    }
  ]
}

Attributes

These apply to the Front and Desk versions of the API.

idintegerThe id of the form of payment.
autobillbooleanTrue to make this form of payment the default form of payment.
DELETE /api/v2/desk/people/:person_id/form_of_payments/:id

Deletes a form_of_payment for the specified person. Payment methods cannot be deleted if they are set as default, nor if they are the last remaining payment method on file.

Show curl example

REQUEST
$ curl -X DELETE https://mybiz.pike13.com/api/v2/desk/people/1/form_of_payments/1 \
  -H "Authorization: Bearer XXXXXXXXXXXXXXX" \
  -H "Content-Type: application/json"

RESPONSE
{
  message: "Payment method deleted successfully"
}

What the API Does Not Support

These come up often when planning a card-on-file integration. None of them are available today:

  • Hosted checkout or card-entry pages. Pike13 does not provide a payment page that your system can create, embed, or send customers to through the API. The card fields always appear on your page, either as your own form or as fields embedded from the payment gateway.
  • Return or redirect URLs. After three-step vaulting, the customer's browser lands on a Pike13 completion URL. You cannot set your own return URL.
  • Importing a card token or vault ID from your own gateway account. Pike13 only accepts payment details collected with the business's own gateway settings, as described in Saving Cards and Bank Accounts. You cannot pass Pike13 a token, customer vault ID, or payment method created with a separate gateway account.
  • Webhooks for saved cards. No webhook fires when a form of payment is created. Confirm the result with GET /api/v2/desk/people/:person_id/form_of_payments instead.
  • Saving bank accounts with three-step vaulting. Three-step vaulting supports credit cards only. The Stripe and tokenizer methods can also save bank accounts.

Guide: Save a Card on File From Your Own Signup Form

A common integration collects a new client's details in your own system (such as a CRM or signup form), creates the client in Pike13, and saves a credit card for future billing. Using the Desk API with a staff member's token:

  1. Check how the business saves cards. GET /api/v2/desk/payments/configuration returns a vaulting_method inside creditcard. If it is null, the API cannot save cards for this business.
  2. Create the client with POST /api/v2/desk/people and keep the returned person id.
  3. Collect and save the card with the method that matches vaulting_method: In every method, the customer's card details go from their browser to the payment gateway and never reach your servers or Pike13's.
  4. Confirm the card was saved by listing the client's forms of payment with GET /api/v2/desk/people/:person_id/form_of_payments
  5. If the client has no other saved card, the new card automatically becomes their default (autobill) form of payment. Otherwise, make it the default with PUT /api/v2/desk/people/:person_id/form_of_payments/:id.

Saving Cards and Bank Accounts

How you save a payment method depends on the business's payment gateway. Call GET /api/v2/desk/payments/configuration (or the Front equivalent) and use the method that matches creditcard.vaulting_method. The Stripe and tokenizer methods also need public keys for your page; contact Pike13 Support to get them.

vaulting_method Method Card fields shown by Bank accounts
three_step Three-step vaulting Your own HTML form, posting directly to the gateway No
stripe_setup_intent Stripe SetupIntent Stripe.js Elements embedded in your page Yes, depending on the business's currency
tokenizer Gateway tokenizer The gateway's tokenizer fields embedded in your page Yes, if the business accepts ACH
null Not available

In every method, the customer's card details go from their browser to the payment gateway, and Pike13 saves the result. Your PCI DSS obligations still depend on how the card fields appear on your page. Confirm with your payment processor or PCI assessor which self-assessment applies to you.

Whichever method you use, the first payment method saved for a client automatically becomes their default (autobill) form of payment. No webhook fires when a payment method is saved; to confirm, call GET /api/v2/desk/people/:person_id/form_of_payments

Saving a Credit Card (Three-Step Vaulting)

Three-step vaulting saves a client's credit card in the business's payment gateway so Pike13 can charge it later, including for autobill. Card details go from the customer's browser directly to the payment gateway and never pass through your servers or Pike13's.

Which Businesses Support It

Three-step vaulting is available for businesses whose payment gateway is NMI-based. Before you start, call GET /api/v2/desk/payments/configuration (or the Front equivalent) and check that creditcard.vaulting_method is "three_step". For any other value, Step One returns an error for that business. Check vaulting_method rather than relying on the error message.

Who Hosts What

  • Your page displays the card entry form (Step Two). Neither Pike13 nor the gateway hosts a card-entry page for this flow.
  • The customer's browser submits the card details directly to the gateway's one-time URL.
  • Pike13 creates the one-time URL (Step One) and saves the card once the gateway confirms it (Step Three).

Because the card fields are on your page, your PCI DSS obligations differ from those of a fully hosted payment page, even though card data never reaches your servers. Confirm with your payment processor or PCI assessor which self-assessment applies to you.

Timing and Access

Once you begin Step One, you have 10 minutes to complete the vaulting before you need to start over again.

These instructions apply to Front or Desk. Front only lets the logged-in client add a card for themselves, and their Pike13 account must be confirmed. Desk lets staff add a card for anyone in the business.

Step One

POST /api/v2/desk/people/:person_id/form_of_payments

Send the type of Form of Payment that you want to vault. Currently only "creditcard" is supported. The response contains a one-time form_url at the payment gateway, which your card form will submit to in Step Two. The card details in the response are empty until vaulting completes.

Attributes

typestringRequired. The only option is: "creditcard"

Show curl example

REQUEST
$ curl -X POST https://mybiz.pike13.com/api/v2/desk/people/1/form_of_payments \
  -H "Authorization: Bearer XXXXXXXXXXXXXXX" \
  -H "Content-Type: application/json" \
  -d '{"form_of_payment":{"type": "creditcard"}}'

RESPONSE
{
  "form_of_payments": [
    {
      "id": 1,
      "type": "creditcard",
      "first_name": "Jane",
      "last_name": "Client",
      "autobill": false,
      "created_at": "2017-06-26T23:13:40Z",
      "updated_at": "2017-06-26T23:13:40Z",
      "card_type": null,
      "expire_month": null,
      "expire_year": null,
      "last_four": null,
      "form_url": "https://secure.nmi.com/api/v2/three-step/SOME_KEY"
    }
  ]
}

Step Two

POST [form_url]

Display an HTML form to the customer with its action set to the form_url from Step One. When the customer submits it, their browser posts the card details directly to the payment gateway. Your server must not collect or forward these fields.

Instead of returning a response, the gateway redirects the customer's browser to Pike13 to finish saving the card. That is Step Three.

Attributes

billing-cc-numberstringRequired. Credit card number.
billing-cc-expstringRequired. Credit card expiration. Format: MMYY
billing-cvvstringCard security code. Check Configuration API to see if it's required.
billing-first-namestringRequired. Cardholder's first name.
billing-last-namestringRequired. Cardholder's last name.
billing-address1stringCardholder's billing address.
billing-address2stringCard billing address, line 2.
billing-citystringCard billing city
billing-statestringCard billing state/province. Format: CC
billing-postalstringCard billing postal code.
billing-countrystringCard billing country code. Format: CC/ISO 3166
billing-phonestringBilling phone number.
billing-emailstringBilling email address.
HTML FORM EXAMPLE
<form method="POST" action="https://secure.nmi.com/api/v2/three-step/SOME_KEY">
  <input type="text" name="billing-first-name" autocomplete="cc-given-name" required>
  <input type="text" name="billing-last-name" autocomplete="cc-family-name" required>
  <input type="text" name="billing-cc-number" autocomplete="cc-number" inputmode="numeric" required>
  <input type="text" name="billing-cc-exp" autocomplete="cc-exp" placeholder="MMYY" required>
  <input type="text" name="billing-cvv" autocomplete="cc-csc" inputmode="numeric">
  <input type="text" name="billing-postal" autocomplete="postal-code">
  <button type="submit">Save card</button>
</form>

Show curl example (testing only)

Use this only to test against a sandbox with test card numbers. In production, card details must come from the customer's browser, never from your server.

REQUEST
$ curl -X POST \
  https://secure.nmi.com/api/v2/three-step/SOME_KEY \
  -H 'content-type: multipart/form-data' \
  -F billing-cc-number=4111111111111111 \
  -F billing-cc-exp=1025 \
  -F billing-cvv=999 \
  -F billing-first-name=Jane \
  -F billing-last-name=Client \
  -F 'billing-address1=1221 E Pike St' \
  -F billing-city=Seattle \
  -F billing-state=WA \
  -F billing-postal=98122

RESPONSE
redirect to
https://mybiz.pike13.com/api/v2/front/people/1/form_of_payments/1/complete?client_id=APP_KEY&token-id=SOME_CODE

Step Three

GET [redirect_url]

After the gateway accepts the card details, it redirects the customer's browser to a Pike13 completion URL. Loading that URL tells Pike13 the gateway has vaulted the card, and Pike13 saves it. You don't call this URL yourself; the customer's browser follows the redirect.

A successful response is an empty JSON object with an HTTP response code of 200. If there was a problem vaulting the credit card, the response code will be 4xx and the body will contain an error message.

The customer's browser ends on this Pike13 response, and you cannot set your own return URL. To keep the customer on your page, you can submit the Step Two form into a hidden iframe (using the form's target attribute), then confirm the result as described below.

Show curl example

REQUEST
$ curl -X GET \
  https://mybiz.pike13.com/api/v2/front/people/1/form_of_payments/1/complete?client_id=APP_KEY&token-id=SOME_CODE

RESPONSE
{ }

FAILURE RESPONSE
{ "errors": { "base": [ "Invalid Credit Card Number REFID:1234567890" ] } }

Confirming the Card Was Saved

Call GET /api/v2/desk/people/:person_id/form_of_payments (or the Front equivalent). The card appears in the list, with its card type, last four digits, and expiration, only after vaulting completes. No webhook fires when a card is saved, so poll this endpoint if you need to know when the customer finishes.

If the client has no other saved card, the new card automatically becomes their default (autobill) form of payment. Otherwise it is saved with autobill off; use PUT /api/v2/desk/people/:person_id/form_of_payments/:id to make it the default. Cards saved this way are stored for recurring billing, so they can be used for autobill.

Saving a Card With Stripe (Stripe Connect Businesses)

For businesses where creditcard.vaulting_method is "stripe_setup_intent", you collect the card with Stripe.js and a Stripe SetupIntent, then tell Pike13 which payment method was created. Card details go from the customer's browser to Stripe and never reach your servers or Pike13's.

What You Need

  • The Stripe publishable key and the business's Stripe account id. Contact Pike13 Support to get them. Initialize Stripe.js with the publishable key and pass the account id as stripeAccount. The business is a connected account, so the SetupIntent and payment method live on that account.
  • The Pike13 person id of the client. Create the client first if needed.

Step One: Create a SetupIntent

GET /api/v2/desk/people/:person_id/form_of_payments/new

Creates a Stripe SetupIntent for the client and returns its client_secret. If the client doesn't have a Stripe customer yet, Pike13 creates one. The SetupIntent is for future off-session charges, which is what autobill needs.

Front uses GET /api/v2/front/people/:person_id/form_of_payments/new and always creates the SetupIntent for the logged-in client.

If the business does not use Stripe Connect, the response is a 422 with {"error": "Stripe Connect is not enabled"}.

Show curl example

REQUEST
$ curl https://mybiz.pike13.com/api/v2/desk/people/1/form_of_payments/new \
  -H "Authorization: Bearer XXXXXXXXXXXXXXX"

RESPONSE
{
  "setup_intent": {
    "client_secret": "seti_1Q2w3E4r5T6y7U8i_secret_AbCdEfGhIjKlMnOp"
  }
}

Step Two: Confirm the SetupIntent in the Browser

Mount a Stripe card element on your page and confirm the SetupIntent with the client_secret. Wait until Stripe reports the SetupIntent as succeeded before continuing. Pike13 does not check the SetupIntent status when you save the payment method.

STRIPE.JS EXAMPLE
<script src="https://js.stripe.com/v3/"></script>
<div id="card-element"></div>
<button id="save-card">Save card</button>
<script>
  const stripe = Stripe(publishableKey, { stripeAccount: accountId });
  const card = stripe.elements().create("card");
  card.mount("#card-element");

  document.getElementById("save-card").addEventListener("click", async () => {
    const { setupIntent, error } = await stripe.confirmCardSetup(clientSecret, {
      payment_method: { card: card, billing_details: { name: "Jane Client" } }
    });
    if (error) { /* show error.message to the customer */ return; }
    if (setupIntent.status === "succeeded") {
      // Send setupIntent.payment_method to your server for Step Three
    }
  });
</script>

Step Three: Save the Payment Method in Pike13

POST /api/v2/desk/people/:person_id/form_of_payments

Send the Stripe payment method id from the confirmed SetupIntent. Pike13 retrieves it from Stripe and saves it as the client's card, using the client's name from their Pike13 profile. Front uses POST /api/v2/front/people/:person_id/form_of_payments for the logged-in client.

This response has a different shape from other Form of Payment responses: it returns the Pike13 form_of_payment_id plus the Stripe payment method details. Use GET /api/v2/desk/people/:person_id/form_of_payments to read the saved card in the standard format.

Attributes

stripe_payment_methodobject
idstringRequired. The payment method id (pm_...) from the confirmed SetupIntent.

Errors

404{"error": "Could not find Stripe payment method"} when Stripe has no such payment method on the business's account.
422{"error": "..."} when the payment method could not be saved.

Show curl example

REQUEST
$ curl -X POST https://mybiz.pike13.com/api/v2/desk/people/1/form_of_payments \
  -H "Authorization: Bearer XXXXXXXXXXXXXXX" \
  -H "Content-Type: application/json" \
  -d '{"stripe_payment_method": {"id": "pm_1Q2w3E4r5T6y7U8i"}}'

RESPONSE
{
  "form_of_payment": {
    "form_of_payment_id": 12,
    "stripe_payment_method_id": "pm_1Q2w3E4r5T6y7U8i",
    "stripe_details": {
      "object": "payment_method",
      "billing_details": {
        "address": {
          "city": null,
          "country": "US",
          "line1": null,
          "line2": null,
          "postal_code": "98122",
          "state": null
        },
        "email": "jane@example.com",
        "name": "Jane Client",
        "phone": null
      },
      "created": 1791500000,
      "customer": "cus_Q1w2E3r4T5y6U7",
      "livemode": false,
      "metadata": {},
      "type": "card",
      "card": {
        "brand": "visa",
        "country": "US",
        "exp_month": 12,
        "exp_year": 2028,
        "funding": "credit",
        "last4": "4242"
      }
    }
  }
}

Bank Accounts

The SetupIntent also allows bank accounts, based on the business's currency: us_bank_account for USD, sepa_debit for EUR, and acss_debit for CAD. Confirm the SetupIntent with Stripe's bank account flow instead of the card element, then save the payment method the same way. Pike13 saves it as an ACH form of payment and records the mandate acceptance using the IP address and user agent of the save request.

The API does not provide microdeposit verification. Only save a bank account after its SetupIntent has succeeded, for example through Stripe's instant verification.

Saving a Card With the Gateway Tokenizer (Celero Surcharging and NextNP Businesses)

For businesses where creditcard.vaulting_method is "tokenizer", you embed the payment gateway's tokenizer on your page. The tokenizer collects the card details and returns a one-time token, which you send to Pike13. Card details go from the customer's browser to the gateway and never reach your servers or Pike13's.

What You Need

  • The tokenizer script URL and public key for the business's gateway. Contact Pike13 Support to get them. Load the script on your page and pass the key to the tokenizer.
  • The Pike13 person id of the client. Create the client first if needed.

Step One: Collect a Token in the Browser

Load the tokenizer script and create a tokenizer in a container on your page. When the customer submits, the tokenizer returns a token in its submission callback. Configure it to match the business's requirements:

  • Require the cardholder's first and last name. Pike13 saves the name from the token, and a form of payment needs both.
  • Require CVV when creditcard.required_fields.cvv is true.
  • Require the billing ZIP code when creditcard.required_fields.postal_code is true.
TOKENIZER EXAMPLE
<script src="SCRIPT_URL"></script>
<div id="card-fields"></div>
<button id="save-card">Save card</button>
<script>
  const tokenizer = new Tokenizer({
    apikey: "PUBLIC_API_KEY",
    container: "#card-fields",
    submission: (response) => {
      if (!response.token || response.invalid) { /* show response.msg to the customer */ return; }
      // Send response.token to your server for Step Two
    },
    settings: {
      payment: {
        types: ["card"],
        card: {
          requireCVV: true,
          user_required: { first_name: true, last_name: true },
          billing_required: { zip: true }
        }
      },
      user: { showInline: true, showName: true },
      billing: { show: true }
    }
  });
  document.getElementById("save-card").addEventListener("click", () => tokenizer.submit());
</script>

Step Two: Save the Token in Pike13

POST /api/v2/desk/people/:person_id/form_of_payments

Send the token from Step One. Pike13 exchanges it with the gateway, saves the card in the gateway's vault, and saves the form of payment for the client. Front uses POST /api/v2/front/people/:person_id/form_of_payments for the logged-in client.

Attributes

form_of_paymentobject
tokenstringRequired. The token from the tokenizer's submission callback.
is_achbooleanTrue when the token is for a bank account. Defaults to false.

Errors

422{"errors": "..."} when the gateway declines the card or the form of payment is invalid, for example a missing cardholder name.

Show curl example

REQUEST
$ curl -X POST https://mybiz.pike13.com/api/v2/desk/people/1/form_of_payments \
  -H "Authorization: Bearer XXXXXXXXXXXXXXX" \
  -H "Content-Type: application/json" \
  -d '{"form_of_payment": {"token": "TOKEN_FROM_TOKENIZER", "is_ach": false}}'

RESPONSE
{
  "form_of_payments": [
    {
      "id": 12,
      "first_name": "Jane",
      "last_name": "Client",
      "autobill": true,
      "type": "creditcard",
      "created_at": "2026-10-09T18:30:00Z",
      "updated_at": "2026-10-09T18:30:00Z",
      "card_type": "visa",
      "expire_month": 12,
      "expire_year": 2028,
      "last_four": "1111",
      "customer_vault_id": "d3a8kt1pm2vc73f2n0lg"
    }
  ]
}

Bank Accounts

If the business accepts bank accounts, meaning accepted_types includes "ach", configure the tokenizer with types: ["ach"] and send the resulting token with "is_ach": true.