### Apple Pay Setup and Integration Guides Source: https://developer.ryftpay.com/docs/payment-methods/apple-pay Guides for setting up and integrating Apple Pay on different platforms. This includes specific instructions for iOS native applications and web-based integrations. ```APIDOC Ryft Apple Pay Integration: Overview: Apple Pay provides a secure and frictionless payment method that is PSD2 SCA-compliant. Customers must add their credit or debit card to their Apple Account to use Apple Pay. Prerequisites: - Familiarize yourself with Apple's brand guidelines. Setup: - Setup Apple Pay for iOS: - Link: https://developer.ryftpay.com/docs/payment-methods/apple-pay/ios - Setup Apple Pay for Web: - Link: https://developer.ryftpay.com/docs/payment-methods/apple-pay/web Integration: - Integrate Apple Pay on the Web: - Link: https://developer.ryftpay.com/docs/integrate/web/embedded-sdk/apple-pay/ - Integrate Apple Pay on iOS: - Link: https://developer.ryftpay.com/docs/integrate/iOS/drop-in Testing: - Supported in Ryft's sandbox environment (https://sandbox-dash.ryftpay.com/). - Requires an Apple Developer account for sandbox testing. - Use Apple's provided test cards. ``` -------------------------------- ### Dispute Recommended Evidence Example Source: https://developer.ryftpay.com/docs/reference-guides/develop/manage-disputes/responding-to-disputes Example JSON snippet illustrating the 'recommendedEvidence' field within a dispute object, guiding the user on which evidence types are most beneficial. ```json { ... "recommendedEvidence":[ "ProofOfDelivery", "CustomerSignature" ], } ``` -------------------------------- ### RyftPay Create Customer Request Example Source: https://developer.ryftpay.com/docs/reference-guides/develop/recurring-billing/subscriptions/creating-subscriptions Example JSON payload for creating a customer with RyftPay. This includes essential contact information and optional metadata for internal tracking. ```json { "email": "abc@ryftpay.com", "firstName": "Nathan", "lastName": "Drake", "metadata": { "myCustomerId": "1234567810" } } ``` -------------------------------- ### Customer Details Response Example Source: https://developer.ryftpay.com/docs/reference-guides/develop/stored-payment-methods/use-stored-payment-method Example JSON response received when a customer exists, populating the 'customerDetails' field with the customer's information. ```JSON { "customerEmail": "abc@ryftpay.com", "customerDetails": { "id": "cus_01GA46C9FGA3BAZAA4J6P467SA", "firstName": "Bill", "lastName": "Jones", "homePhoneNumber": "+441321231211", "mobilePhoneNumber": "+447900000000" }, "status": "PendingPayment" } ``` -------------------------------- ### RyftPay Transfer Request Examples Source: https://developer.ryftpay.com/docs/platforms/transfers Provides JSON examples for initiating transfers. Demonstrates how to structure requests for sending funds to a sub-account (destination transfer) and withdrawing funds from a sub-account (source transfer). ```JSON { "amount": 25000, "currency": "GBP", "destination": { "accountId": "ac_6e3721da-9186-42cb-bc93-bf938be86403" }, "reason": "Funds owed from transactions dated 2021-01-24" } ``` ```JSON { "amount": 25000, "currency": "GBP", "source": { "accountId": "ac_6e3721da-9186-42cb-bc93-bf938be86403" }, "reason": "Dispute fees" } ``` -------------------------------- ### RyftPay Create Subscription Response Example Source: https://developer.ryftpay.com/docs/reference-guides/develop/recurring-billing/subscriptions/creating-subscriptions Example JSON response received after successfully creating a subscription with RyftPay. It includes the subscription ID, status, customer details, and payment session information. ```json { "id": "sub_01H00DRRD4S2W2D8HSSM7FB17Q", "status": "PastDue", "customer": { "id": "cus_01GR43GYXZR1R4HFQRRSNYTYY6" }, "paymentSessions": { "initial": { "id": "ps_01H00DRRD6FS2G62S0EKRZ9GE7", "clientSecret": "ps_01H00DRRD6FS2G62S0EKRZ9GE7_secret_3f469a47-f580-4740-9291-e1c04eb34c1a" }, "latest": { "id": "ps_01H00DRRD6FS2G62S0EKRZ9GE7", "clientSecret": "ps_01H00DRRD6FS2G62S0EKRZ9GE7_secret_3f469a47-f580-4740-9291-e1c04eb34c1a" } } } ``` -------------------------------- ### Payout Method Creation Response Example Source: https://developer.ryftpay.com/docs/platforms/payouts/payout-methods Example of a successful response when creating a payout method. It includes the unique payout method ID, status, currency, country, and the bank account details provided, along with creation and update timestamps. ```JSON { "id": "pm_01G0EYVFR02KBBVE2YWQ8AKMGJ", "type": "BankAccount", "status": "Valid", "currency": "GBP", "country": "GB", "bankAccount": { "bankIdType": "SortCode", "bankId": "070806", "accountNumberType": "UnitedKingdom", "accountNumber": "12345678", "address": { "lineOne": "123 Street", "city": "Manchester", "postalCode": "M1 1AA", "region": "Greater Manchester", "country": "GB" } }, "createdTimestamp": 1696241011, "lastUpdatedTimestamp": 1696241011 } ``` -------------------------------- ### RyftPay Monthly Subscription Price Example Source: https://developer.ryftpay.com/docs/reference-guides/develop/recurring-billing/subscriptions/creating-subscriptions Example JSON snippet demonstrating how to define pricing for a monthly subscription with a finite number of billing cycles. This example sets a price of £30 per month for 12 months. ```json { "price": { "amount": 3000, "currency": "GBP", "interval": { "unit": "Months", "count": 1, "times": 12 } } } ``` -------------------------------- ### RyftPay Create Subscription Request Example Source: https://developer.ryftpay.com/docs/reference-guides/develop/recurring-billing/subscriptions/creating-subscriptions Example JSON payload for creating a subscription with RyftPay. It requires customer ID, a description, pricing details including amount, currency, and interval, and optional metadata. ```json { "customer": { "id": "cus_01GR43GYXZR1R4HFQRRSNYTYY6" }, "description": "Professional Plan (12 months)", "price": { "amount": 5000, "currency": "GBP", "interval": { "unit": "Months", "count": 1, "times": 12 } }, "metadata": { "customerId": "123" } } ``` -------------------------------- ### Account Verification Payment Session Request Example Source: https://developer.ryftpay.com/docs/reference-guides/develop/account-verification A JSON request payload example for creating a payment session specifically for account verification, setting the amount to zero and enabling the verification flag. ```JSON { "amount": 0, "verifyAccount": true } ``` -------------------------------- ### GBP Payout Method Request Example Source: https://developer.ryftpay.com/docs/platforms/payouts/payout-methods Example JSON payload for creating a payout method for a GBP bank account in the United Kingdom. It specifies the 'SortCode' and 'UnitedKingdom' account number types. ```JSON { "type": "BankAccount", "currency": "GBP", "country": "GB", "bankAccount": { "bankIdType": "SortCode", "bankId": "070806", "accountNumberType": "UnitedKingdom", "accountNumber": "12345678" } } ``` -------------------------------- ### Send Payment Session Request with Example Values (Python) Source: https://developer.ryftpay.com/docs/reference-guides/develop/accounts/standard-account/collect-payment-details This Python code snippet shows how to send a payment session request to the Ryft API using specific example values for amount, customer details, and order information. It demonstrates a practical implementation of the API call. ```Python import http.client import json conn = http.client.HTTPSConnection("sandbox-api.ryftpay.com") payload = json.dumps({ "amount":54550, "currency":"GBP", "customerEmail":"jane@mail.com", "metadata":{ "orderId":"1", "customerId":"Jane" }, "returnUrl":"https://ryftpay.com/checkout?orderId=1" }) headers ={ 'Authorization':'the-api-secret-key', 'Content-Type':'application/json' } conn.request("POST","/v1/payment-sessions", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` -------------------------------- ### Create Customer Request Example Source: https://developer.ryftpay.com/docs/reference-guides/develop/stored-payment-methods/customers This JSON object demonstrates the structure for creating a new customer, including basic identification and optional metadata. ```json { "firstName": "Victor", "lastName": "Sullivan", "metadata": { "myCustomerId": "2234567810" } } ``` -------------------------------- ### Example Request to Challenge a Dispute Source: https://developer.ryftpay.com/docs/reference-guides/develop/manage-disputes/responding-to-disputes A cURL command demonstrating how to send a POST request to the RyftPay API to challenge a dispute, including necessary headers. ```curl curl -X POST https://api.ryftpay.com.com/v1/disputes/{disputeId}/challenge \ -H "Authorization: " \ -H "Content-Type: application/json" ``` -------------------------------- ### Synchronize Customer Data Example Source: https://developer.ryftpay.com/docs/reference-guides/develop/stored-payment-methods/customers Example JSON payload for synchronizing existing customer data, potentially used when updating or creating a customer with pre-existing information. ```json { "customerEmail":"abc@ryftpay.com", "customerDetails":{ "firstName":"Nathan", "lastName":"Drake", "homePhoneNumber":"+441345213211", "mobilePhoneNunmber":"+447900000000", "metadata":{ "myCustomerId":"12345678910" } } } ``` -------------------------------- ### Ryft iOS SDK Installation via Swift Package Manager Source: https://developer.ryftpay.com/docs/integrate/iOS/drop-in Install the Ryft iOS SDK into your Xcode project using Swift Package Manager. Add the provided repository URL to your project's package dependencies to include the SDK. ```swift https://github.com/RyftPay/ryft-ios ``` -------------------------------- ### Split Payment Request Example (JSON) Source: https://developer.ryftpay.com/docs/platforms/process-payments/split-payments A JSON payload demonstrating how to structure the 'splits' object when creating a payment session. This example shows the division of a £75.00 transaction, detailing amounts and fees for two sub-accounts. ```json { "amount": 7500, "currency": "GBP", "splits": { "items": [ { "accountId": "ac_3fe8398f-8cdb-43a3-9be2-806c4f84c327", "amount": 3000, "fee": { "amount": 500 }, "metadata": { "productId": "123" } }, { "accountId": "ac_b83f2653-06d7-44a9-a548-5825e8186004", "amount": 4500, "description": "2x The Big Gundown", "fee": { "amount": 1000 }, "metadata": { "productId": "321" } } ] } } ``` -------------------------------- ### Ryft Account Creation Response Handling Source: https://developer.ryftpay.com/docs/platforms/onboarding-accounts/hosted-onboarding Details the expected JSON responses for account creation, including success (200 OK) and conflict (409) scenarios. It highlights essential fields like 'id' for storage and provides examples of error structures. ```APIDOC API Endpoint: /accounts (Implied) Response Handling for Account Creation: Success Response (200 OK): Description: On success, returns the newly created account details. Body: { "id": "ac_6138b313-d1e7-4ed7-8c7f-5263753a234b", ... } Notes: Store the 'id' for future operations. Conflict Response (409 Conflict): Description: Returned when an account matching the provided details (e.g., email) already exists. Body: { "requestId": "d02c1127-731f-48f0-9b11-b2cee79b3731", "code": "409", "errors": [ { "code": "bad_request", "message": "A resource with these details already exists" } ] } Resolution: Authorize the existing user instead. Bad Request Response (400 Bad Request): Description: Returned for invalid input, such as an invalid email format. Body: { "requestId": "d02c1127-731f-48f0-9b11-b2cee79b3731", "code": "400", "errors": [ { "code": "bad_request", "message": "The given email is not valid" } ] } Resolution: Inspect the error message and correct the input. Server Error Response (5XX): Description: Indicates a server-side issue. Resolution: Retry the request; contact support if issues persist. ``` -------------------------------- ### Create Minimum Account Request Source: https://developer.ryftpay.com/docs/platforms/onboarding-accounts/non-hosted-onboarding This example shows the minimal JSON payload required to initiate account creation without specifying entity details. It includes the onboarding flow type and custom metadata. ```json { "onboardingFlow":"NonHosted", "metadata":{ "yourAccountId":"123" } } ``` -------------------------------- ### Declined Transfer Status Example Source: https://developer.ryftpay.com/docs/platforms/transfers Provides the JSON structure for a transfer that was declined. This example includes the 'errors' field, which details the reason for the decline, such as insufficient platform balance. ```JSON { "id":"tfr_01HCMT97VM5ZN531EXRXS2JF5S", "amount":5000, "currency":"GBP", "status":"Declined", "errors":[ { "code":"InsufficientPlatformBalance", "description":"Platform account did not have sufficient balance to cover transfer amount" } ], "destination":{ "accountId":"ac_6e3721da-9186-42cb-bc93-bf938be86403" }, "createdTimestamp":1697210736, "lastUpdatedTimestamp":1697210736 } ``` -------------------------------- ### Ryft Account Link Creation API Source: https://developer.ryftpay.com/docs/platforms/onboarding-accounts/hosted-onboarding Details the process and API endpoint for creating an account link, which is necessary for users to register with Ryft. Includes request parameters and response examples. ```APIDOC API Endpoint: /account-links Operation: Create Account Link Purpose: Generates a temporary link for a sub-account to complete Ryft registration. Request: Method: POST (Implied) Headers: Content-Type: application/json (Implied) Body Parameters: accountId (string, required): The unique ID of the sub-account created previously. redirectUrl (string, required): The URL to redirect the user back to upon completion or cancellation of registration. Example Request Body: { "accountId": "ac_6138b313-d1e7-4ed7-8c7f-5263753a234b", "redirectUrl": "https://ryftpay.com" } Response Handling: Success Response (200 OK): Description: Returns the details of the created account link. Body: { "accountId": "ac_6138b313-d1e7-4ed7-8c7f-5263753a234b", "redirectUrl": "https://ryftpay.com" } Notes: This response contains the temporary link to be shared with the user. Error Responses (4XX / 5XX): Description: Handles client-side or server-side errors during link creation. Resolution: Refer to general error handling for specific codes and messages. ``` -------------------------------- ### Ryft SDK Initialization and Configuration Source: https://developer.ryftpay.com/docs/integrate/web/embedded-sdk Provides an overview of the Ryft.init() method, detailing key configuration parameters such as publicKey, clientSecret, and the option to manually handle actions. It also covers the localisation object for form customization. ```APIDOC Ryft.init(options: RyftInitOptions) Initializes the Ryft Embedded SDK with the provided configuration. Parameters: options (RyftInitOptions): An object containing initialization settings. RyftInitOptions: publicKey (string): Your Ryft public API key. Required. clientSecret (string, optional): Your Ryft client secret. Can also be supplied on Ryft.attemptPayment(). manuallyHandleActions (boolean, optional): If true, requires manual handling of payment actions via Ryft.handleRequiredAction(). Defaults to false. localisation (LocalisationOptions, optional): An object to customize form field placeholder texts. LocalisationOptions: cardNumberPlaceholder (string, optional): Placeholder text for the card number field. Default: "Card Number". expiryMonthPlaceholder (string, optional): Placeholder text for the expiry month field. Default: "MM". expiryYearPlaceholder (string, optional): Placeholder text for the expiry year field. Default: "YY". cvvPlaceholder (string, optional): Placeholder text for the CVV field. Default: "CVC". nameOnCardPlaceholder (string, optional): Placeholder text for the cardholder name field. Default: "Name on card". Example: Ryft.init({ publicKey: "pk_test_..."; clientSecret: "sk_test_..."; manuallyHandleActions: true, localisation: { cardNumberPlaceholder: "Card Number", cvvPlaceholder: "CVV" } }); ``` -------------------------------- ### Create Individual Entity Account Request Source: https://developer.ryftpay.com/docs/platforms/onboarding-accounts/non-hosted-onboarding This example demonstrates the JSON payload for creating an account with detailed individual entity information. It requires the entityType to be 'Individual' and includes fields like name, DOB, nationality, and address. ```json { "onboardingFlow":"NonHosted", "entityType":"Individual", "individual":{ "firstName":"Fred", "lastName":"Jones", "email":"fred.jones@example.com", "dateOfBirth":"1990-01-20", "gender":"Male", "nationalities":[ "GB" ], "address":{ "lineOne":"123 Road", "city":"London", "country":"GB", "postalCode":"SW1 1AA" } }, "metadata":{ "yourAccountId":"123" } } ``` -------------------------------- ### USD Payout Method Request Example Source: https://developer.ryftpay.com/docs/platforms/payouts/payout-methods Example JSON payload for creating a payout method for a USD bank account in the United States. It specifies the 'RoutingNumber' and 'UnitedStates' account number types. ```JSON { "type": "BankAccount", "currency": "USD", "country": "US", "bankAccount": { "bankIdType": "RoutingNumber", "bankId": "122105155", "accountNumberType": "UnitedStates", "accountNumber": "13719713158835300" } } ``` -------------------------------- ### EUR Payout Method Request Example Source: https://developer.ryftpay.com/docs/platforms/payouts/payout-methods Example JSON payload for creating a payout method for a EUR bank account, likely in Ireland or another Eurozone country. It uses the 'Iban' account number type, omitting bankIdType and bankId. ```JSON { "type": "BankAccount", "currency": "EUR", "country": "IE", "bankAccount": { "accountNumberType": "Iban", "accountNumber": "IE64IRCE92050112345678" } } ``` -------------------------------- ### Create Business Entity Account Request Source: https://developer.ryftpay.com/docs/platforms/onboarding-accounts/non-hosted-onboarding This example illustrates the JSON payload for creating an account with business entity details. It requires the entityType to be 'Business' and includes fields such as name, type, registration number, registered address, and contact email. ```json { "onboardingFlow":"NonHosted", "entityType":"Business", "business":{ "name":"Test Ltd", "type":"PublicCompany", "registrationNumber":"12345678", "registeredAddress":{ "lineOne":"123 Street", "city":"Manchester", "country":"GB", "postalCode":"M1 1AA" }, "contactEmail":"contact@test.com" }, "metadata":{ "yourAccountId":"123" } } ``` -------------------------------- ### Successful Account Creation Response Source: https://developer.ryftpay.com/docs/platforms/onboarding-accounts/non-hosted-onboarding This JSON response indicates a successful account creation. It includes the unique account ID, entity type, onboarding flow, business details, frozen status, verification status, and metadata. ```json { "id":"ac_6138b313-d1e7-4ed7-8c7f-5263753a234b", "type":"Sub", "entityType":"Business", "onboardingFlow":"NonHosted", "business":{ "name":"Test Ltd", "type":"PublicCompany", "registrationNumber":"12345678", "registeredAddress":{ "lineOne":"123 Street", "city":"Manchester", "country":"GB", "postalCode":"M1 1AA" }, "contactEmail":"contact@test.com" }, "frozen":false, "verification":{...}, "metadata":{ "yourAccountId":"123" } } ``` -------------------------------- ### Create Payment Session JSON with Example Values Source: https://developer.ryftpay.com/docs/reference-guides/develop/accounts/standard-account/collect-payment-details This JSON object demonstrates a payment session request with concrete values populated into the fields. These values are typically sourced from the application's user interface or backend logic. ```JSON { "amount":54550, "currency":"GBP", "customerEmail":"jane@mail.com", "metadata":{ "orderId":"1", "customerId":"Jane" }, "returnUrl":"https://ryftpay.com/checkout?orderId=1" } ``` -------------------------------- ### Refunds API Endpoint Examples Source: https://developer.ryftpay.com/docs/platforms/process-payments/platform-fee-payments Provides examples for the /refunds endpoint to process different refund types. Supports full refunds including or excluding the platform fee, and partial refunds. The `refundPlatformFee` parameter controls whether the platform fee is refunded. ```APIDOC POST /refunds --- **Full refund including platform fee** Scenario: Customer returns goods, both sub-account and platform owner share the loss. Request Example: ```json { "amount":5000, "refundPlatformFee":true } ``` Result: Sub-account refunds £45, platform owner refunds £5. --- **Full refund excluding platform fee** Scenario: Customer returns goods, sub-account covers the full loss. Request Example: ```json { "amount":5000 } ``` Result: Sub-account refunds £50. Platform owner keeps £5. Sub-account effectively covers £50 + £5 platform fee. --- **Partial Refunds** Scenario: Customer returns part of an order, refunding a partial amount. Request Example: ```json { "amount":1000, "refundPlatformFee":true } ``` Result: £10 returned to customer. Sub-account covers £9, platform owner covers £1 (proportional to partial amount). ``` -------------------------------- ### RyftPay SDK Integration for 3D Secure Source: https://developer.ryftpay.com/docs/integrate/web/server-to-server Provides instructions for integrating the RyftPay SDK to handle 3D Secure authentication when a payment session is in the 'PendingAction' state. It specifies the required arguments for SDK initialization. ```APIDOC SDK Integration for 3D Secure: To handle a `PendingAction` status, use the RyftPay SDK. Required Arguments for SDK Integration: - Your public API key - The client secret of the customer's payment session - The `requiredAction` value from the customer's payment session Sub-Account Payments: If processing payments on behalf of a Sub-Account, also provide the Sub-Account ID. ``` -------------------------------- ### Send Payment Session Request to Ryft API Source: https://developer.ryftpay.com/docs/reference-guides/develop/accounts/standard-account/collect-payment-details These code examples demonstrate how to send a POST request to the Ryft API to create a payment session. They include setting up the request with the correct URL, headers (including Authorization), and the JSON payload. Examples are provided for Node.js, Python, and PHP. ```Node.js var request =require('request'); var options ={ 'method':'POST', 'url':'https://sandbox-api.ryftpay.com/v1/payment-sessions', 'headers':{ 'Authorization':'{{Your API Secret key}}', 'Content-Type':'application/json' }, body:JSON.stringify({ "amount":{{pence}}, "currency":"GBP", "customerEmail":"{{customer email}}", "metadata":{ "orderId":"{{your order number}}" }, "returnUrl":"{{your checkout URL}}" }) }; request(options,function(error, response){ if(error)thrownewError(error); console.log(response.body); }); ``` ```Python import http.client import json conn = http.client.HTTPSConnection("sandbox-api.ryftpay.com") payload = json.dumps({ "amount":{{pence}}, "currency":"GBP", "customerEmail":"{{customer email}}", "metadata":{ "orderId":"{{your order number}}" }, "returnUrl":"{{your checkout URL}}" }) headers ={ 'Authorization':'{{Your API Secret key}}', 'Content-Type':'application/json' } conn.request("POST","/v1/payment-sessions", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```PHP setUrl('https://sandbox-api.ryftpay.com/v1/payment-sessions'); $request->setMethod(HTTP_Request2::METHOD_POST); $request->setConfig(array( 'follow_redirects' => TRUE )); $request->setHeader(array( 'Authorization' => '{{Your API Secret key}}', 'Content-Type' => 'application/json' )); $request->setBody('{ "amount": 115, "currency": "GBP", "customerEmail": "{{customer email}}", "metadata": { "orderId": "{{your order number}}" }, "returnUrl": "{{your checkout URL}}"}'); try { $response = $request->send(); if ($response->getStatus() == 200) { echo $response->getBody(); } else { echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' . $response->getReasonPhrase(); } } catch(HTTP_Request2_Exception $e) { echo 'Error: ' . $e->getMessage(); } ``` -------------------------------- ### API Request Example: Pay with Saved Card Source: https://developer.ryftpay.com/docs/integrate/web/server-to-server/saved-cards This example demonstrates the structure of an API request to process a payment using a previously saved card. It includes the client secret for authentication and the payment method ID of the saved card. ```APIDOC { "clientSecret":"ps_01FCTS1XMKH9FF43CAFA4CXT3P_secret_b83f2653-06d7-44a9-a548-5825e8186004", "paymentMethod":{ "id":"pmt_01G0EYVFR02KBBVE2YWQ8AKMGJ" } } ``` -------------------------------- ### Example API Request Payload Source: https://developer.ryftpay.com/docs/integrate/web/server-to-server/supplying-additional-information This snippet shows an example JSON payload for an API request to Ryftpay, used for supplying sensitive card details and client secrets. It includes fields for client secret, card number, expiry date, CVC, and cardholder name. ```JSON { "clientSecret":"ps_01FCTS1XMKH9FF43CAFA4CXT3P_secret_b83f2653-06d7-44a9-5825e8186004", "cardDetails":{ "number":"4444333322221111", "expiryMonth":"10", "expiryYear":"2024", "cvc":"100", "name":"MR F MULDER" } } ``` -------------------------------- ### Ryftpay API: Create Sub Account Source: https://developer.ryftpay.com/docs/platforms/onboarding-accounts/hosted-onboarding Endpoint for creating a new sub account within the Ryftpay platform. Supports optional pre-population of entity details like business or individual information. ```APIDOC Endpoint: POST /accounts Description: Initiates the creation of a new sub account. This is a prerequisite for hosted onboarding if no existing account is found. Parameters: - email (string, optional): The email address of the user onboarding on behalf of the sub entity. Required if 'business' or 'individual' details are not provided. - onboardingFlow (string, optional): Specifies the onboarding flow. Omit or set to 'Hosted' for the hosted flow. - metadata (object, optional): Custom key-value pairs for attaching additional information, such as your internal IDs. - entityType (string, optional): The type of entity ('Business' or 'Individual'). Required if 'business' or 'individual' details are provided. - business (object, optional): Pre-populates business details. Required if entityType is 'Business'. - name (string, required): The legal name of the business. - type (string, required): The type of business (e.g., 'PublicCompany', 'PrivateCompany', 'SoleTrader'). - registrationNumber (string, optional): The business registration number. - registeredAddress (object, optional): - lineOne (string, required) - city (string, required) - country (string, required): ISO 3166-1 alpha-2 country code. - postalCode (string, required) - contactEmail (string, optional): Contact email for the business. - individual (object, optional): Pre-populates individual details. Required if entityType is 'Individual'. - firstName (string, required) - lastName (string, required) - email (string, optional): Email address for the individual. - dateOfBirth (string, required): Date of birth in YYYY-MM-DD format. - gender (string, optional): Gender of the individual. - nationalities (array of strings, optional): List of ISO 3166-1 alpha-2 country codes for nationalities. - address (object, optional): - lineOne (string, required) - city (string, required) - country (string, required): ISO 3166-1 alpha-2 country code. - postalCode (string, required) Request Examples: 1. Email Only: ```json { "email": "contact@test.com" } ``` 2. Pre-populate Business Details: ```json { "entityType": "Business", "business": { "name": "Test Ltd", "type": "PublicCompany", "registrationNumber": "12345678", "registeredAddress": { "lineOne": "123 Street", "city": "Manchester", "country": "GB", "postalCode": "M1 1AA" }, "contactEmail": "contact@test.com" } } ``` 3. Pre-populate Individual Details: ```json { "entityType": "Individual", "individual": { "firstName": "Fred", "lastName": "Jones", "email": "fred.jones@example.com", "dateOfBirth": "1990-01-20", "gender": "Male", "nationalities": [ "GB" ], "address": { "lineOne": "123 Road", "city": "London", "country": "GB", "postalCode": "SW1 1AA" } } } ``` ``` -------------------------------- ### Webhook Event: PaymentSession.refund_failed Source: https://developer.ryftpay.com/docs/reference-guides/develop/accounts/standard-account/webhook-events Example JSON response body for a PaymentSession.refund_failed event. Indicates an issue during the refund process. ```json { "id":"ev_01FGNPAY1DB5TKPB35M1MNT6PN", "eventType":"PaymentSession.refund_failed", "data":{ "id":"ps_01FCTS1XMKH9FF43CAFA4CXT3P", "amount":500, "platformFee":50, "currency":"GBP", "metadata":{ "customerId":"123" } }, "createdTimestamp":1570989538 } ``` -------------------------------- ### PaymentSession Captured Event Payload Source: https://developer.ryftpay.com/docs/reference-guides/develop/stored-payment-methods/payment-methods Example JSON payload received when a payment session is captured, containing details about the payment and the stored payment method. ```JSON { "id": "ev_01FGNPAY1DB5TKPB35M1MNT6PN", "eventType": "PaymentSession.captured", "data": { "id": "ps_01FCTS1XMKH9FF43CAFA4CXT3P", "amount": 500, "platformFee": 50, "currency": "GBP", "metadata": { "customerId": "123" }, "customer": { "id": "cus_01G9MKP4RD0E8RP5D7R6S9GNQ3" }, "paymentMethod": { "id": "pmt_01G9MP90WN8RESJD0CC17GVKZ1" } }, "createdTimestamp": 1570989538 } ``` -------------------------------- ### Ryft Sub-Account Creation and Update API Source: https://developer.ryftpay.com/docs/platforms/onboarding-accounts/non-hosted-onboarding This documentation covers the Ryft API endpoints for creating and updating sub-accounts. It details the parameters required for non-hosted onboarding, including onboarding flow types and entity-specific information, and explains how these fields influence account verification and payout capabilities. ```APIDOC Ryft Accounts API: Sub-Account Creation and Update: 1. Create Sub Account: Endpoint: POST /accounts Description: Creates a new sub-account entity with Ryft. Parameters: - onboardingFlow: string, required. Must be set to "NonHosted" for this flow. - metadata: object, optional. Custom information, e.g., your unique ID for the entity. - entityType: string, recommended. Defines the entity type: "Individual" or "Business". - If "Individual", the account undergoes KYC (Know Your Customer) verification. - If "Business", the account undergoes KYB (Know Your Business) verification. - If not supplied, payout methods cannot be created until this field and related "business"/"individual" fields are populated. Returns: Details of the created sub-account. Example Usage: POST /accounts { "onboardingFlow": "NonHosted", "entityType": "Business", "metadata": { "yourInternalId": "cust_12345" } } 2. Update Sub Account: Endpoint: PATCH /accounts/{accountId} Description: Updates an existing sub-account. Primarily used to populate entity details if not provided during creation. Parameters: - accountId: string, required. The ID of the sub-account to update. - entityType: string, optional. Can be updated if initially omitted. - business: object, required if entityType is "Business". Contains business-specific details. - individual: object, required if entityType is "Individual". Contains individual-specific details. Returns: Details of the updated sub-account. Error Conditions: - If entityType is "Individual" but `individual` object is missing or incomplete, KYC verification may fail. - If entityType is "Business" but `business` object is missing or incomplete, KYB verification may fail. - Cannot create payout methods until `entityType` and corresponding `business`/`individual` fields are populated. ``` -------------------------------- ### Ryft Embedded SDK Card-Only Integration Source: https://developer.ryftpay.com/docs/integrate/web/embedded-sdk Demonstrates a basic integration of the Ryft Embedded SDK for handling card payments only. Includes SDK initialization, event handling for card validation changes, and submitting payments. This example omits wallet-specific configurations. ```html
``` -------------------------------- ### Dispute Acceptance Response Source: https://developer.ryftpay.com/docs/reference-guides/develop/manage-disputes/responding-to-disputes Example JSON response received upon successful acceptance of a dispute, indicating the dispute has been closed and updated. ```json { "items":[ { "id":"dsp_01G0EYVFR02KBBVE2YWQ8AKMGJ", "amount":500, "currency":"GBP", "status":"Accepted", "category":"Fraudulent", "reason":{ "code":"13.6", "description":"Merchandise/Services Not Received" }, "respondBy":1685059200, "recommendedEvidence":["ProofOfDelivery"], "paymentSession":{ "id":"ps_01G0EYVFR02KBBVE2YWQ8AKMGJ", "paymentType":"Standard", "paymentMethod":{ "card":{ "scheme":"Mastercard", "last4":"4444" } } }, "customer":{ "email":"john.doe@ryftpay.com", "id":"cus_01G0EYVFR02KBBVE2YWQ8AKMGJ", "createdTimestamp":1470989538 }, "createdTimestamp":1470989538, "lastUpdatedTimestamp":1470989538 } ], "paginationToken":"dsp_01FCTS1XMKH9FF43CAFA4CXT3P_1641912473" } ``` -------------------------------- ### Webhook Event: Account.verification_status_updated Source: https://developer.ryftpay.com/docs/reference-guides/develop/accounts/standard-account/webhook-events Example JSON response body for an Account.verification_status_updated event. Includes the account ID and its new verification status. ```json { "id":"ev_01FGNPAY1DB5TKPB35M1MNT6PN", "eventType":"Account.verification_status_updated", "data":{ "id":"ac_b83f2653-06d7-44a9-a548-5825e8186004", "status":"Required" }, "createdTimestamp":1570989538 } ``` -------------------------------- ### RyftPay Transfer Response Example Source: https://developer.ryftpay.com/docs/platforms/transfers Illustrates the JSON structure of a successful response when a transfer is initiated. Includes key details like the transfer ID, status, amount, currency, and timestamps. ```JSON { "id": "tfr_01HCMT97VM5ZN531EXRXS2JF5S", "status": "Pending", "amount": 5000, "currency": "GBP", "destination": { "accountId": "ac_6e3721da-9186-42cb-bc93-bf938be86403" }, "createdTimestamp": 1697210736, "lastUpdatedTimestamp": 1697210736 } ```