Skip to content
Last updated

Adding billing details to a payment

Audience: All users (Merchants, Developers, Testers)

Environment: Sandbox / Production

Introduction

Sometimes you want your payments to be linked to a specific customer who visited and purchased a product from your website. With Helix-Pay, this is really easy.

Using the API

  1. Use the POST /payments endpoint as usual
  2. Send a billing_address property as part of the request body

Example

{
  "amount": 2498,
  "currency": "GBP",
  "description": "Order #10001",
  "billing_address": {
    "first_name": "John",
    "last_name": "Doe",
    "email": "john.doe@test.com",
    "phone_number": "+447975112233",
    "address_line_1": "123 Queen Str.",
    "address_line_2": "Apartment Block 2",
    "city": "London",
    "state": "London",
    "zip_code": "E1 7BT",
    "country_code": "GB"
  }
}

Billing Address Definition

Here is the definition of a billing address. It is written as a Typescript interface, but it can be adapted to any programming language.

interface BillingAddress {
  first_name: string;
  last_name: string;
  email: string;
  phone_number?: string; // optional
  address_line_1: string;
  address_line_2?: string; // optional
  city: string;
  state: string;
  zip_code: string;
  country_code: string;
}

Checking for billing address

Once you create a payment that has a billing address, you can see it in the Helix-Pay portal, as part of the payment details page.