For the complete documentation index, see llms.txt. This page is also available as Markdown.

Link to web payment on iOS - US 🇺🇸

iOS in the US permits the use of standard "naked" hyperlinks without requiring integration with Apple's StoreKit APIs for external linkouts. Thus, launching Coda Links in iOS is a highly streamlined process.

Below is the step-by-step guide for linking US users to from an iOS App to your Coda-hosted Payment Page:

Prerequisites

Ensure that you have followed the steps in Set up payments, and obtained a API Key that can be used with our Codapay APIs.

This is the standard integration that allows you to call Codapay's Payment Init API, which returns a unique web checkout URL.

A summary of the Payment Init API specs are as follows:

For the full list of supported request & response parameters, refer to Initiate a payment request

Environment
Endpoint URL | Method: POST

Sandbox

https://sandbox.codapayments.com/airtime/api/restful/v2.0/Payment/init.json

Production

https://airtime.codapayments.com/airtime/api/restful/v2.0/Payment/init.json

2. Launch the URL: Simply invoke standard iOS networking methods to launch the URL in an external browser.

For optimal functionality, open the URL in an external browser rather than an in-app webview, as certain e-wallet payment features may be limited in webviews.

SwiftUI Sample
UIKit Sample

Step 2: Receive a payment success notification from Coda

  1. Coda will send a notification to your Complete Notification URL (configured on Coda Portal during Set up payments). This notification is sent to you when the user has successfully completed their payment on Coda-hosted Payment Page.

  1. You need to respond to the notification from Coda with an acknowledgement, to confirm that it has been successfully received.

    1. If your application processes the notification successfully, respond with ResultCode=0

    2. Otherwise, return an error code.

If no response is received, the notification will be re-sent 3 times at 5-minute intervals. If all attempts fail, an email alert will be triggered. To subscribe to this email alert notifications, go to the Coda Portal > Team > Manage Access > Tick "Transaction Notification" > Save Changes

We highly recommend that you call the InquiryPaymentResult API after receiving the notification, to confirm the status of the payment once more. This will help reconcile the transaction status between your system and Coda's before releasing the purchased item to the user. The details are as follows:

Environment
Endpoint URL | Method: POST

Sandbox

https://sandbox.codapayments.com/airtime/api/restful/v2.0/Payment/inquiryPaymentResult.json

Production

https://airtime.codapayments.com/airtime/api/restful/v2.0/Payment//inquiryPaymentResult.json

For the full list of supported request & response parameters, refer to Check a transaction status

Step 4: Post-Purchase UX & Deep Linking

  1. Item Fulfillment: When the payment succeeds, Coda Webstore completes the payment and automatically sends a server-to-server item fulfillment request to your backend. This should already be covered in the Webstore basic setup. No changes required here

  2. User can click to go back to App via deep link: To ensure this redirection happens smoothly, you must provide Coda with a deep link that can redirect users back to your iOS app upon a successful purchase.

    1. This link can be configured in Coda Portal under Complete Landing Page URL. If you have already configured this during Set up payments, no change is required.

    2. Once the user is deep-linked back to your app, they should seamlessly receive their items. In addition, your app can display a purchase success screen with confetti animations!

Refer to Redirecting users from Coda Links back to your appto learn how to setup back-to-app redirection correctly for your iOS App.

  1. User can explore Webstore's offers & LiveOps campaigns

    • If you have a Coda Webstore published, the post-purchase screen will display your best Webstore offers to the user automatically, encouraging them to explore & become a loyal direct-to-webstore customer.

seedling

Last updated

Was this helpful?