Custom Ship-to Address API need to auto increment Code

Given the basic custom API shown below. How can I make the code optional and have the system calculate the next auto increment code. Currently this is giving me an error when I simply do not pass a code along.

page 83704 "SF_APIV-ShipToAddresses"
{
    PageType = API;
    ChangeTrackingAllowed = true;
    DelayedInsert = true;
    EntityName = 'sf_shiptoaddress';
    EntitySetName = 'sf_shiptoaddresses';
    Extensible = false;
    SourceTable = "Ship-to Address";
    ODataKeyFields = SystemId;

    layout
    {
        area(content)
        {
            repeater(Group)
            {
                field(id; Rec.SystemId)
                {
                    Editable = false;
                }
                field(customerNo; Rec."Customer No.")
                {
                    Editable = false;
                }
                // Our new input field for Customer SystemId
                // field(customerId; CustomerId) { }
                field(code; Rec.Code) { }
                field(name; Rec.Name) { }
                field(addressLine1; Rec.Address) { }
                field(addressLine2; Rec."Address 2") { }
                field(city; Rec.City) { }
                field(state; Rec.County) { }
                field(postalCode; Rec."Post Code") { }
                field(country; Rec."Country/Region Code") { }
                field(phone; Rec."Phone No.") { }
                field(email; Rec."E-Mail") { }
            }
        }
    }

    actions
    {
    }
}

Thanks for any advice. I think this should be simple, but cannot see how the system does it.