# CheckoutAPIService

    final public class CheckoutAPIService : CheckoutAPIProtocol

Show on GitHub

- `init(publicKey:environment:)`

  Initializes a CheckoutAPIService object with public key and Environment. CheckoutAPIService holds the core tokenisation logic methods to tokenise a user’s card details

  #### Declaration

  Swift

      public convenience init(publicKey: String, environment: Environment)

  Show on GitHub
- `createToken(_:completion:)`

  The create token method tokenises the user’s card details.

  #### Declaration

  Swift

      public func createToken(_ paymentSource: PaymentSource, completion: @escaping (Result<TokenDetails, TokenisationError.TokenRequest>) -> Void)

  Show on GitHub
- `correlationID`

  Call the correlationID method to return the correlation ID string ( used for logging events and support purposes ).

  #### Declaration

  Swift

      public var correlationID: String { get }

  Show on GitHub