{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "properties": {
        "account_identifier": {
            "description": "The identifier for the platform account to fund.",
            "maxLength": 96,
            "minLength": 5,
            "pattern": "^[\\+\\w-]{5,96}$",
            "type": "string"
        },
        "client_ip": {
            "description": "The IP address of the person making the purchase.",
            "type": "string"
        },
        "credit_card": {
            "description": "Details of the credit card being used to fund the account.",
            "properties": {
                "billing_address": {
                    "description": "The billing address associated with the credit card.",
                    "properties": {
                        "address": {
                            "description": "The billing address. For multi-line addresses append subsequent lines to the first.",
                            "maxLength": 60,
                            "minLength": 1,
                            "type": "string"
                        },
                        "city": {
                            "description": "The city of the customer's billing address.",
                            "maxLength": 40,
                            "minLength": 1,
                            "type": "string"
                        },
                        "country": {
                            "description": "The country of the customer's billing address.",
                            "maxLength": 60,
                            "minLength": 1,
                            "optional": true,
                            "type": "string"
                        },
                        "email": {
                            "description": "The customer's email address.",
                            "maxLength": 255,
                            "minLength": 5,
                            "pattern": "^\\S+@\\S+$",
                            "type": "string"
                        },
                        "f_name": {
                            "description": "The first name associated with the customer's billing address.",
                            "maxLength": 50,
                            "minLength": 1,
                            "type": "string"
                        },
                        "l_name": {
                            "description": "The last name associated with the customer's billing address.",
                            "maxLength": 50,
                            "minLength": 1,
                            "type": "string"
                        },
                        "state": {
                            "description": "The state of the customer's billing address. Up to 40 characters (no symbols) or a FIPS state alpha code (e.g. AL, WA, etc).",
                            "maxLength": 40,
                            "minLength": 1,
                            "type": "string"
                        },
                        "zip": {
                            "description": "The postal code of the customer's billing address.",
                            "maxLength": 20,
                            "minLength": 1,
                            "type": "string"
                        }
                    },
                    "required": [
                        "f_name",
                        "l_name",
                        "address",
                        "city",
                        "state",
                        "zip",
                        "email"
                    ],
                    "type": "object"
                },
                "expiration": {
                    "description": "The expiration date of the credit card in YYYY-MM format.",
                    "pattern": "^[0-9]{4}-(?:0[1-9]|1[0-2])$",
                    "type": "string"
                },
                "number": {
                    "description": "The credit card number, preferably numbers only.",
                    "maxLength": 20,
                    "minLength": 10,
                    "type": "string"
                },
                "security_code": {
                    "description": "The 3 or 4-digit card security code (CVV2, CVC2, or CID).",
                    "pattern": "^\\d{3,4}$",
                    "type": "string"
                }
            },
            "required": [
                "number",
                "expiration",
                "security_code",
                "billing_address"
            ],
            "type": "object"
        },
        "customer": {
            "description": "The platform's customer.",
            "maxLength": 96,
            "minLength": 1,
            "type": "string"
        }
    },
    "required": [
        "customer",
        "account_identifier",
        "client_ip",
        "credit_card"
    ],
    "title": "Register a card to a platform user's account.",
    "type": "object"
}