### Start Imprint Application with Configuration Source: https://docs.imprint.co/ios Demonstrates how to initialize and start the Imprint application flow from a UIViewController. It includes defining a completion handler to manage application states like offer acceptance, rejection, or errors. ```swift import Imprint class YourViewController: UIViewController { // … func startImprintApplication() { let configuration = ImprintConfiguration(clientSecret: "client_secret", partnerReference: "partner_reference", environment: .sandbox) // Define the completion handler configuration.onCompletion = { state, data in switch state { case .offerAccepted: print("Offer accepted, data: \(String(describing: data))") case .rejected: print("Application rejected, data: \(String(describing: data))") case .inProgress: print("Incomplete application, data: \(String(describing: data))") case .error: print("Error occurred, data: \(String(describing: data))") } // Perform any generic actions after the flow ends if needed } ImprintApp.startApplication(from: self, configuration: configuration) } } ``` -------------------------------- ### Imprint SDK Application Flow Start Source: https://docs.imprint.co/ios Initiate the Imprint application flow from a given view controller. This method presents the Imprint experience to the user. ```APIDOC public static func startApplication(from viewController: UIViewController, configuration: ImprintConfiguration) Parameters: - viewController: The UIViewController from which the application flow will be presented. - configuration: The ImprintConfiguration object containing API keys and completion handlers. ``` -------------------------------- ### Imprint SDK API Reference Source: https://docs.imprint.co/ios Details the parameters, response data, and enumerations for interacting with the Imprint SDK. This includes configuration options for starting an application and understanding the outcomes. ```APIDOC ImprintApp.startApplication from: UIViewController, configuration: ImprintConfiguration Initiates the Imprint application flow. Parameters: from: The UIViewController from which to present the application flow. configuration: An ImprintConfiguration object containing client credentials and environment settings. ImprintConfiguration: clientSecret: String (Required) - Generated through Create Customer Session. partnerReference: String (Required) - The unique reference identifier for the partner. environment: ImprintEnvironment (Optional) - Specifies the target environment (e.g., .sandbox, .production). onCompletion: ((ImprintState, Any?) -> Void)? (Optional) - A closure to handle the completion state and associated data. Request Parameters: client_secret: String (Required) - Generated through Create Customer Session. partnerReference: String (Required) - The unique reference identifier for the partner. Response Data: customer_id: String | null - Imprint identifier for customer. partner_customer_id: String | null - Partner identifier for customer. payment_method_id: String | null - ID to the payment method of customer. error_code: ErrorCode | null - Identifier for the specific error encountered. Enums: ErrorCode: INVALID_CLIENT_SECRET: Indicate Client Secret is invalid. UNKNOWN_ERROR: Indicate other unexpected error happened. ImprintState: offerAccepted: Application has been approved and credit offer accepted. New cardholder! rejected: Application has been rejected by Imprint. inProgress: Application has been exited, not completed. error: Invalid request parameters (e.g., invalid token). ``` -------------------------------- ### Add Imprint SDK via Cocoapods Source: https://docs.imprint.co/ios Install the Imprint SDK using Cocoapods. Add the 'Imprint' pod to your application's `Podfile` and run `pod install`. ```ruby target 'YourApp' do pod 'Imprint' end ``` ```ruby pod install ``` -------------------------------- ### Imprint Integration Guides Source: https://context7_llms Guides for integrating Imprint's services into your applications. This includes creating transaction intents, applying for payment methods, and embedding the Imprint experience on web and iOS platforms. ```APIDOC IntegrationGuides: CreateTransactionIntent: Description: Guide on the process of creating a transaction intent to unlock personalized experiences. Purpose: Facilitates unique marketplace interactions. ApplyForLoanOrCreditCard: Description: Details the end-to-end process for applying for an Imprint payment method (loan or credit card). Steps: Involves three distinct steps for a complete application. SubscribeToEventNotifications: Description: Guide on how to subscribe to and react to real-time event notifications from Imprint. Purpose: Enables timely responses to business events. EmbedImprintOniOS: Description: Instructions for embedding the Imprint application experience directly within your iOS application. Benefit: Seamless integration for mobile users. EmbedImprintOnWeb: Description: Instructions for embedding the Imprint application experience on your website. Benefit: Consistent user experience across platforms. HandleRewardsEventNotifications: Description: A guide specifically for processing event notifications related to rewards. Focus: Managing reward lifecycle events effectively. ``` -------------------------------- ### PARTNER_CUSTOMER_NOT_FOUND_ERROR Example Source: https://docs.imprint.co/api-reference/offers/retrieve-an-offer Example of a PARTNER_CUSTOMER_NOT_FOUND_ERROR response structure. This indicates that a specified partner customer ID was not found in the system. ```APIDOC APIDOC: schemas: ErrorResponse: type: object properties: type: type: string description: The type of the error. example: PARTNER_CUSTOMER_NOT_FOUND_ERROR message: type: string description: A human-readable message describing the error. example: 'Partner Customer not found for provided ID: abcd-efgh-123' param: type: string description: The parameter that caused the error. example: partner_customer_id paths: /some/path: get: responses: '404': description: Partner Customer not found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' example: value: type: PARTNER_CUSTOMER_NOT_FOUND_ERROR message: 'Partner Customer not found for provided ID: abcd-efgh-123' param: partner_customer_id ``` -------------------------------- ### Configure Imprint SDK in Swift Source: https://docs.imprint.co/ios Create an instance of `ImprintConfiguration` by providing your `clientSecret` and selecting an `environment`. Optional fields can be assigned as needed. ```swift let configuration = ImprintConfiguration(clientSecret: "client_secret", environment: .sandbox) ``` -------------------------------- ### Start Imprint Application Flow (Kotlin) Source: https://docs.imprint.co/android Initiates the Imprint application flow by calling `ImprintApp.startApplication`. This method requires the application `context`, the `ImprintConfiguration` object, and the `onCompletion` handler. ```kotlin fun startApplication( context: Context, configuration: ImprintConfiguration, onCompletion: (CompletionState, Map?) -> Unit, ) ``` -------------------------------- ### Import Imprint SDK in Swift Source: https://docs.imprint.co/ios Import the Imprint SDK into your Swift files to access its functionalities. ```swift import Imprint ``` -------------------------------- ### GET /v2/offers OpenAPI Specification Source: https://docs.imprint.co/api-reference/offers/retrieve-an-offer This entry documents the GET /v2/offers endpoint of the Imprint API. It details the request parameters, including the required `partner_customer_id` query parameter, and the authentication methods (basicAuth, bearerAuth). It also describes the possible JSON responses for successful retrieval (200 OK) with various offer types and error scenarios (404 Not Found). ```yaml paths: path: /v2/offers method: get servers: - url: https://dev.sbx.imprint.co description: Imprint public api sandbox request: security: - title: basicAuth parameters: query: {} header: {} cookie: {} - title: bearerAuth parameters: query: {} header: Authorization: type: http scheme: bearer description: >- Bearer HTTP authentication. Allowed headers-- Authorization: Bearer cookie: {} parameters: path: {} query: partner_customer_id: schema: - type: string description: The unique identifier for the customer in the partner's system header: {} cookie: {} body: {} response: '200': application/json: schemaArray: - type: object properties: id: allOf: - &ref_0 type: string example: DCBFC736-2286-42DD-897D-160DCA80AED2 description: The unique ID Imprint assigns to the offer. type: allOf: - &ref_1 type: string description: The type of offer enum: - PRESCREEN_BONUS_50_STR - PRESCREEN_NO_BONUS_STR - ITA_BONUS_50_STR - NONE definition: allOf: - type: string example: PRESCREEN_BONUS_50_STR description: >- When and offer is a `PRESCREEN_BONUS_50_STR` type this will have the offer enum refIdentifier: '#/components/schemas/PRESCREEN_BONUS_50_STR' requiredProperties: - id - type - definition - type: object properties: id: allOf: - *ref_0 type: allOf: - *ref_1 definition: allOf: - type: string example: PRESCREEN_NO_BONUS_STR description: >- When and offer is a `PRESCREEN_NO_BONUS_STR` type this will have the offer enum refIdentifier: '#/components/schemas/PRESCREEN_NO_BONUS_STR' requiredProperties: - id - type - definition - type: object properties: id: allOf: - *ref_0 type: allOf: - *ref_1 definition: allOf: - type: string example: ITA_BONUS_50_STR description: >- When and offer is a `ITA_BONUS_50_STR` type this will have the offer enum refIdentifier: '#/components/schemas/ITA_BONUS_50_STR' requiredProperties: - id - type - definition - type: object properties: id: allOf: - *ref_0 type: allOf: - *ref_1 offer_text: allOf: - type: string example: '' description: When and offer is a `None` type this will have the offer enum refIdentifier: '#/components/schemas/NONE' requiredProperties: - id - type examples: example: value: definition: PRESCREEN_BONUS_50_STR id: DCBFC736-2286-42DD-897D-160DCA80AED2 type: PRESCREEN_BONUS_50_STR description: Successfully returned marketing placement '404': application/json: schemaArray: - type: object properties: type: allOf: - type: string description: The category of error being returned example: PARTNER_CUSTOMER_NOT_FOUND_ERROR message: allOf: - type: string description: A message describing the cause of the error example: 'Partner Customer not found for provided ID: abcd-efgh-123' param: allOf: - type: string description: The param causing the error example: partner_customer_id refIdentifier: '#/components/schemas/PartnerCustomerNotFoundError' requiredProperties: - type - message examples: ``` -------------------------------- ### Start Imprint Application with Kotlin Source: https://docs.imprint.co/android This Kotlin function demonstrates how to initiate an application process using the Imprint SDK. It configures the SDK with a client secret and environment, and defines a callback to handle the completion state of the application. The function takes a Context object as input. ```kotlin fun startApplication(context: Context) { val configuration = ImprintConfiguration( clientSecret = "client_secret", environment = ImprintConfiguration.Environment.SANDBOX, ) val onCompletion = { state: CompletionState, metadata: Map? -> val metadataInfo = metadata?.toString() ?: "No metadata" val resultText = when (state) { CompletionState.OFFER_ACCEPTED -> { "Offer accepted\n$metadataInfo" } CompletionState.REJECTED -> { "Application rejected\n$metadataInfo" } CompletionState.IN_PROGRESS -> { "Incomplete application\n$metadataInfo" } CompletionState.ERROR -> { "Error occured\n$metadataInfo" } } Log.d("Application result:", resultText) } // Start the application process with the provided context, configuration, and callback Imprint.startApplication( context = context, configuration = configuration, onCompletion = onCompletion, ) } ``` -------------------------------- ### OpenAPI: GET /v2/transaction_intents/{intent_id} Source: https://docs.imprint.co/api-reference/transaction-intents/retrieve-a-transaction-intent Retrieves a specific transaction intent by its unique identifier. This endpoint requires authentication via Bearer token or basic authentication. It details the path parameters, request security, and the structure of successful (200) and error (404) responses, including example data. ```APIDOC paths: path: /v2/transaction_intents/{intent_id} method: get servers: - url: https://dev.sbx.imprint.co description: Imprint public api sandbox request: security: - title: basicAuth parameters: query: {} header: {} cookie: {} - title: bearerAuth parameters: query: {} header: Authorization: type: http scheme: bearer description: >- Bearer HTTP authentication. Allowed headers-- Authorization: Bearer cookie: {} parameters: path: intent_id: schema: - type: string required: true description: The unique identifier for the transaction intent. example: 3E4F0CCD-ACBF-42F3-A459-6DF92AF632D1 query: {} header: {} cookie: {} body: {} response: '200': application/json: schemaArray: - type: object properties: id: allOf: - type: string example: 5B30532B-5B5B-4826-8DE2-429C57B705FD customer_id: allOf: - type: string example: 9B5E1EE0-2E1C-46E7-81B9-3C3917204BE4 payment_method_id: allOf: - type: string description: >- The `payment_method_id` that this `transaction_intent` was executed with. example: DCBFC736-2286-42DD-897D-160DCA80AED2 amount: allOf: - type: integer description: Currency amount example: 10000 currency: allOf: - $ref: '#/components/schemas/TransactionCurrency' status: allOf: - $ref: '#/components/schemas/TransactionIntentStatus' network_transaction_id: allOf: - type: string description: >- The network's unique identifier for the transaction. Examples include Visa Transaction ID, Mastercard Trace ID, and American Express Network Reference ID partner_transaction_id: allOf: - type: string description: The partner's unique transaction id created_at: allOf: - type: string description: >- the RFC-3339 timestamp when the transaction intent was created example: '2025-02-13T19:08:07.000Z' updated_at: allOf: - type: string description: >- the RFC-3339 timestamp when the transaction intent was last updated example: '2025-02-13T19:08:07.000Z' metadata: allOf: - type: object description: Additional transaction intent data additionalProperties: true example: platform_version: 2.1.0 refIdentifier: '#/components/schemas/TransactionIntent' requiredProperties: - id - customer_id - amount - currency - status - created_at examples: example: value: id: 5B30532B-5B5B-4826-8DE2-429C57B705FD customer_id: 9B5E1EE0-2E1C-46E7-81B9-3C3917204BE4 payment_method_id: DCBFC736-2286-42DD-897D-160DCA80AED2 amount: 10000 currency: USD status: CONFIRMED network_transaction_id: partner_transaction_id: created_at: '2025-02-13T19:08:07.000Z' updated_at: '2025-02-13T19:08:07.000Z' metadata: platform_version: 2.1.0 description: Transaction intent retrieved successfully '404': application/json: schemaArray: - type: object properties: type: allOf: - type: string description: The category of error being returned. example: TRANSACTION_INTENT_FOUND_ERROR message: allOf: - type: string description: A message describing the cause of the error. example: 'Transaction intent not found for provided ID: txint_123' param: allOf: ``` -------------------------------- ### MDX Content Rendering and Event Notification UI Logic Source: https://docs.imprint.co/guide-event-notifications This JavaScript code defines the rendering logic for MDX content, including component mapping and error handling for missing components. It constructs the UI for displaying information about Imprint's event notification system, such as overview, setup steps, and example transaction data. ```javascript children: \"123\"\n }), _jsx(_components.td, {\n children: \"$50\"\n }), _jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"CAPTURED\"\n })\n }), _jsx(_components.td, {\n style: {\n textAlign: \"left\"\n },\n children: \"…\"\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: \"345\"\n }), _jsx(_components.td, {\n children: \"123\"\n }), _jsx(_components.td, {\n children: \"$50\"\n }), _jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"REFUNDED\"\n })\n }), _jsx(_components.td, {\n style: {\n textAlign: \"left\"\n },\n children: \"…\"\n })]\n })]\n })]\n })]\n })]\n })]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\nfunction _missingMdxReference(id, component) {\n throw new Error(\"Expected \" + (component ? \"component\" : \"object\") + \" `\" + id + \"` to be defined: you likely forgot to import, pass, or provide it.\");\n}\\n\"])\\nself.__next_f.push([1,\"3b:T629e,\"\])\nself.__next_f.push([1,\"\\\"use strict\\\";\\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\\nconst {useMDXComponents: _provideComponents} = arguments[0];\\nfunction _createMdxContent(props) {\\n const _components = {\\n a: \\\"a\\\",\\n code: \\\"code\\\",\\n img: \\\"img\\\",\\n li: \\\"li\\\",\\n ol: \\\"ol\\\",\\n p: \\\"p\\\",\\n strong: \\\"strong\\\",\\n table: \\\"table\\\",\\n tbody: \\\"tbody\\\",\\n td: \\\"td\\\",\\n th: \\\"th\\\",\\n thead: \\\"thead\\\",\\n tr: \\\"tr\\\",\\n ..._provideComponents(),\\n ...props.components\\n }, {Heading, Info, Step, Steps} = _components;\\n if (!Heading) _missingMdxReference(\\\"Heading\\\", true);\\n if (!Info) _missingMdxReference(\\\"Info\\\", true);\\n if (!Step) _missingMdxReference(\\\"Step\\\", true);\\n if (!Steps) _missingMdxReference(\\\"Steps\\\", true);\\n return _jsxs(_Fragment, {\\n children: [_jsx(Heading, {\\n level: \\\"2\\\",\\n id: \\\"overview\\\",\\n isAtRootLevel: \\\"true\\\",\\n children: \\\"Overview\\\"\\n }), \\\"\\\\n\\\", _jsx(_components.p, {\\n children: \\\"You can subscribe to specific event types to receive real-time event notifications. This enables you to build efficient, event-driven workflows and respond promptly to changes in transaction activity, account status, and other critical events.\\\"\\n }), \\\"\\\\n\\\", _jsx(Heading, {\\n level: \\\"2\\\",\\n id: \\\"how-event-notifications-work\\\",\\n isAtRootLevel: \\\"true\\\",\\n children: \\\"How event notifications work\\\"\\n }), \\\"\\\\n\\\", _jsxs(_components.p, {\\n children: [\\\"When an event occurs, Imprint will \\\", _jsx(_components.code, {\\n children: \\\"POST\\\"\\n }), \\\" to the endpoint configured. This event notification contains a JSON payload with details about the event.\\\\nAs part of event notification enrollment, you will receive a secret shared only between Imprint and you.All requests are signed (HMAC SHA-256) using the shared secret.\\\"\\n ]\\n }), \\\"\\\\n\\\", _jsx(_components.p, {\\n children: \\\"For increased security, you can restrict your endpoint to only allow requests from Imprint’s IP Ranges, which can be provided by your Imprint team. \\\"\\n }), \\\"\\\\n\\\", _jsxs(_components.p, {\\n children: [\\\"Your system should acknowledge events with a \\\", _jsx(_components.code, {\\n children: \\\"2XX\\\"\\n }), \\\" HTTP response status to confirm successful receipt. If a delivery fails, Imprint will retry the request based on an exponential back-off strategy.\\\"\\n ]\\n }), \\\"\\\\n\\\", _jsx(_components.p, {\\n children: _jsx(_components.img, {\\n src: \\\"https://mintlify.s3.us-west-1.amazonaws.com/imprint-b3c5d5af/images/event-notification-diagram-1.png\\\",\\n alt: \\\"\\\"\\n })\\n }), \\\"\\\\n\\\", _jsx(Heading, {\\n level: \\\"2\\\",\\n id: \\\"setup\\\",\\n isAtRootLevel: \\\"true\\\",\\n children: \\\"Setup\\\"\\n }), \\\"\\\\n\\\", _jsx(_components.p, {\\n children: \\\"To start receiving event notifications, please coordinate the following with your Imprint team:\\\"\\n }), \\\"\\\\n\\\", _jsxs(_components.ol, {\\n children: [\\\"\\\\n\\\", _jsxs(_components.li, {\\n children: [\\\"\\\\n\\\", _jsxs(_components.p, {\\n children: [\\\"\\\", _jsx(_components.strong, {\\n children: \\\"Select events\\\"\\n }), \\\": subscribe to specific event types. For a description of each event notification, see the \\\", _jsx(_components.a, {\\n href: \\\"https://docs.imprint.co/api-reference/webhooks/application-event-notification\\\",\\n children: \\\"reference pages\\\"\\n }), \\\".\\\"\\n ]\\n }), \\\"\\\\n\\\"\\n ]\\n }), \\\"\\\\n\\\", _jsxs(_components.li, {\\n children: [\\\"\\\\n\\\", _jsxs(_components.p, {\\n children: [\\\"\\\", _jsx(_components.strong, {\\n chil ``` -------------------------------- ### API Error Response Example Source: https://docs.imprint.co/api-reference/error-handling An example of an error response from the Imprint API, detailing the error type, message, and the parameter associated with the error. ```json { "error": { "type": "INVALID_REQUEST_ERROR", "message": "Invalid email format", "param": "email" } } ``` -------------------------------- ### Imprint Event Notification Setup Source: https://docs.imprint.co/guide-event-notifications Details the steps required to set up event notifications with Imprint, including selecting events, registering endpoints, storing the signing token, and implementing retry logic. ```APIDOC Imprint Event Notification Setup: To start receiving event notifications, coordinate the following with your Imprint team: 1. **Select Events**: - Subscribe to specific event types. - Refer to the reference pages for a description of each event notification. - Reference: https://docs.imprint.co/api-reference/webhooks/application-event-notification 2. **Register Your Endpoint(s)**: - Provide at least one publicly accessible URL where events should be sent. - Multiple endpoints can be provided, potentially one per event type. - All endpoints must use HTTPS for encrypted communication. 3. **Store Event Signing Token**: - Your Imprint team will provide a secret key for validating incoming request signatures. - Use this secret key to validate the signature of incoming requests using HMAC SHA-256. - Refer to the signature verification page for details on interpreting the `X-IMPRINT-HMAC-SIGNATURE` header. - Reference: https://docs.imprint.co/api-reference/verify-event-notification 4. **Retry Logic**: - Implement idempotency handling to avoid processing duplicate events. - Imprint will retry failed webhook deliveries using an exponential back-off strategy. ``` -------------------------------- ### Transaction Intent Schema and Examples Source: https://docs.imprint.co/api-reference/transaction-intents/update-a-transaction-intent Defines the structure for a transaction intent, including required properties, data types, and example values. It also outlines the status enumeration for transaction intents. ```APIDOC components: schemas: TransactionCurrency: type: string description: >- The 3-character currency code of the amount in ISO 4217 format (e.g., "USD") example: USD TransactionIntentStatus: type: string enum: - CONFIRMED - CANCELED example: CONFIRMED TransactionIntent: type: object description: Represents a transaction intent. properties: id: type: string description: Unique identifier for the transaction intent. example: 5B30532B-5B5B-4826-8DE2-429C57B705FD customer_id: type: string description: Identifier for the customer associated with the transaction. example: 9B5E1EE0-2E1C-46E7-81B9-3C3917204BE4 payment_method_id: type: string description: Identifier for the payment method used. example: DCBFC736-2286-42DD-897D-160DCA80AED2 amount: type: integer description: The transaction amount. example: 10000 currency: type: string description: The 3-character currency code of the amount in ISO 4217 format. example: USD status: type: string enum: - CONFIRMED - CANCELED description: The status of the transaction intent. example: CONFIRMED network_transaction_id: type: string description: Identifier for the transaction on the network. example: partner_transaction_id: type: string description: Identifier for the transaction from the partner. example: created_at: type: string format: date-time description: The RFC-3339 timestamp when the transaction intent was created. example: '2025-02-13T19:08:07.000Z' updated_at: type: string format: date-time description: The RFC-3339 timestamp when the transaction intent was last updated. example: '2025-02-13T19:08:07.000Z' metadata: type: object description: Additional transaction intent data. additionalProperties: true example: platform_version: 2.1.0 requiredProperties: - id - customer_id - amount - currency - status - created_at examples: example: value: id: 5B30532B-5B5B-4826-8DE2-429C57B705FD customer_id: 9B5E1EE0-2E1C-46E7-81B9-3C3917204BE4 payment_method_id: DCBFC736-2286-42DD-897D-160DCA80AED2 amount: 10000 currency: USD status: CONFIRMED network_transaction_id: partner_transaction_id: created_at: '2025-02-13T19:08:07.000Z' updated_at: '2025-02-13T19:08:07.000Z' metadata: platform_version: 2.1.0 description: Transaction intent updated successfully ``` -------------------------------- ### Imprint.create() Configuration and Callbacks Source: https://docs.imprint.co/web Defines the configuration object fields for the Imprint.create() method, including required and optional parameters for setting up the Imprint UI, and details the possible values and data structures for the onCompletion callback. ```APIDOC Imprint.create() Configuration Object Fields: __init__(client_secret: str, partner_reference: str = None, selector: str = None, onCompletion: function = None, referralCode: str = None, offerConfigUUID: str = None) - client_secret: (REQUIRED, String) Generated through [Create Customer Session](https://docs.imprint.co/api-reference/customer-sessions/create-a-new-customer-session) endpoint - partner_reference: (Optional, String) Unique identifier for the program provided by the Imprint team - selector: (Optional, String) DOM element to load the application. If not provided, Imprint will try to find a container with id="imprint-ui" (#imprint-ui selector) - onCompletion: (Optional, String) Callback function that accepts a `result` and `data` parameters (see all possible values below) - referralCode: (Optional, String) For use with Imprint's Referral Program - offerConfigUUID: (Optional, String) Identifier for specific reward offer in the referral system onCompletion Callback Values: result: - OFFER_ACCEPTED: Application has been approved and credit offer accepted. New cardholder! - REJECTED: Application has been rejected by Imprint - IN_PROGRESS: Application has been exited, not completed - ERROR: Invalid request parameters (e.g., invalid token) data: - customer_id: (string | null) Imprint Customer ID - payment_method_id: (string | null) Payment Method ID - partner_customer_id: (string | null) Partner Customer ID - error_code: (string | null) Error Code ``` -------------------------------- ### Asset Loading Instructions Source: https://docs.imprint.co/guide-event-notifications This snippet details the loading of various assets required by the application, including font files (WOFF2) and CSS stylesheets. These are typically handled by the Next.js build process and the browser's asset loading mechanisms. ```javascript :HL["/mintlify-assets/_next/static/media/bb3ef058b751a6ad-s.p.woff2","font",{"crossOrigin":"","type":"font/woff2"}] :HL["/mintlify-assets/_next/static/media/e4af272ccee01ff0-s.p.woff2","font",{"crossOrigin":"","type":"font/woff2"}] :HL["/mintlify-assets/_next/static/css/ca797da4e9f8f21c.css","style"] :HL["/mintlify-assets/_next/static/css/f61b4e54ca51c353.css","style"] :HL["/mintlify-assets/_next/static/css/19e66b131dc509b0.css","style"] ``` -------------------------------- ### Payment Method Schema and Examples Source: https://docs.imprint.co/api-reference/payment-methods/update-a-payment-method Defines the structure for a payment method, including card, bank account, and loan details. It also includes examples of a successfully updated payment method and the associated metadata. ```APIDOC components: schemas: PaymentMethod: type: object properties: id: type: string description: Unique identifier for the payment method. example: DCBFC736-2286-42DD-897D-160DCA80AED2 type: type: string description: The type of payment method (e.g., CARD, BANK_ACCOUNT, LOAN). enum: - CARD - BANK_ACCOUNT - LOAN example: CARD customer_id: type: string description: The ID of the customer associated with this payment method. example: B40A789E-BD46-4BB9-B63E-F9919582694C card: type: object properties: last4: type: string description: The last four digits of the card number. example: '1234' network: type: string description: The card network (e.g., VISA, MASTERCARD). example: VISA card_type: type: string description: The type of card (e.g., PHYSICAL, VIRTUAL). example: PHYSICAL card_design_id: type: string description: Identifier for the card design. example: 3b9c1f3e-52a0-44c1-b131-a7ab0099a214 pci_details: type: object properties: pan: type: string description: Primary Account Number (PAN). example: '5105105105105100' exp_month: type: string description: Expiration month (MM). example: '06' exp_year: type: string description: Expiration year (YY). example: '26' cvv: type: string description: Card Verification Value (CVV). example: '123' bank_account: type: object properties: last4: type: string description: The last four digits of the bank account number. example: '1234' routing_number: type: string description: The bank's routing number. example: bank_name: type: string description: The name of the bank. example: Wells Fargo account_type: type: string description: The type of bank account (e.g., CHECKING, SAVINGS). example: CHECKING loan: type: object properties: amount: type: integer description: The total loan amount. example: 10000 currency: type: string description: The currency of the loan amount. example: USD remaining_balance: type: integer description: The remaining balance on the loan. example: 123 term_months: type: integer description: The loan term in months. example: 12 apr: type: string description: Annual Percentage Rate (APR). example: '5.89' loan_status: type: string description: The current status of the loan. example: PENDING created_at: type: string format: date-time description: Timestamp when the payment method was created. example: '2025-02-13T19:08:07.000Z' updated_at: type: string format: date-time description: Timestamp when the payment method was last updated. example: '2025-02-13T19:08:07.000Z' status: type: string description: Current status of the payment method. enum: - ACTIVE - INACTIVE - CANCELED example: ACTIVE metadata: type: object additionalProperties: true description: Additional metadata for the payment method. example: platform_version: 2.1.0 refIdentifier: '#/components/schemas/PaymentMethod' requiredProperties: - id - type - customer_id - created_at - status - metadata examples: example: value: id: DCBFC736-2286-42DD-897D-160DCA80AED2 type: CARD customer_id: B40A789E-BD46-4BB9-B63E-F9919582694C card: last4: '1234' network: VISA card_type: PHYSICAL card_design_id: 3b9c1f3e-52a0-44c1-b131-a7ab0099a214 pci_details: pan: '5105105105105100' exp_month: '06' exp_year: '26' cvv: '123' bank_account: last4: '1234' routing_number: bank_name: Wells Fargo account_type: CHECKING loan: amount: 10000 currency: USD remaining_balance: 123 term_months: 12 apr: '5.89' loan_status: PENDING created_at: '2025-02-13T19:08:07.000Z' updated_at: '2025-02-13T19:08:07.000Z' status: ACTIVE metadata: platform_version: 2.1.0 description: Payment method updated successfully ``` -------------------------------- ### Initialize Imprint UI Source: https://docs.imprint.co/web Initialize the Imprint UI using the global `Imprint.create()` method. This requires a `client_secret`, `partner_reference`, and a `selector` for the container. An optional `onCompletion` callback can handle different application flow outcomes. ```javascript Imprint.create({ client_secret: "QzMyNzg4QzgtNEUwOS00QkU4LThDMjEtMkU5OUQ3QzkwRDhGCg==", partner_reference: "S00QkU4NEUwO", selector: "#imprint-ui", // reference to your container onCompletion: (result, data) => { switch (result) { case "OFFER_ACCEPTED": // Implement logic for new approved cardholders console.log("Offer accepted, data:", data); break; case "REJECTED": // Implement logic for rejected applications console.log("Rejected, data:", data); break; case "IN_PROGRESS": // Implement logic for abandoned applications console.log("Abandoned, data:", data); break; case "ERROR": // Implement error handling console.log("Error occurred, data:", data); break; } } }); ``` -------------------------------- ### One-time Reward JSON Example Source: https://docs.imprint.co/rewards-event-notifications This example shows the JSON structure for a one-time reward. It specifies the reward amount, customer ID, and a 'type' field set to 'ONE_TIME', distinguishing it from ongoing or transactional rewards. ```json { "data": { "amount": 100, "created_at": "2025-02-13T19:08:07.000Z", "customer_id": "1ebb6d73-d132-4c80-9736-dfd5b01f11a4", "reward_id": "c960a701-1eaf-47aa-8f54-c4ca96bba4b3", "transaction_id": "", "type": "ONE_TIME", "status": "AVAILABLE" }, "object": "REWARD" } ``` -------------------------------- ### Imprint.co Webhook Setup and Security Source: https://docs.imprint.co/guide-event-notifications Details on configuring Imprint.co webhooks, including registering publicly accessible HTTPS endpoints for event delivery and securing these endpoints by verifying the X-IMPRINT-HMAC-SIGNATURE header. It also covers the importance of implementing retry logic and idempotency. ```APIDOC Webhook Configuration: - Register at least one publicly accessible URL where events should be sent. - Multiple endpoints can be provided, potentially one per event type. - All endpoints must use HTTPS to ensure encrypted communication. Event Signature Verification: - Imprint provides a secret key to validate the signature of incoming requests. - The signature is found in the 'X-IMPRINT-HMAC-SIGNATURE' header. - Refer to the signature verification page for detailed interpretation. - API Reference: https://docs.imprint.co/api-reference/verify-event-notification Retry Logic: - Implement idempotency handling to avoid processing duplicate events. - Imprint will retry failed webhook deliveries. ```