Process payments with Ryft: authorizations, voids, captures, refunds etc.
- Retrieve an Apple Pay web domain
Ryft Payment API (1.1.0)
Ryft provides a collection of APIs that you can use to accept and process payments + marketplace functionality (payouts). We have a testing environment called sandbox, which you can sign up for to test API calls without affecting live data.
When you sign up for an account, you are given a secret and public API key pair. You authenticate with our API by providing the appropriate key in the request Authorization header. Never share your secret keys. Keep them guarded and secure.
Public keys should only be used in JavaScript or native applications. This key is solely used to identify the partner making requests. Supply this key in the Authorization header.
Your secret key should always be supplied in the Authorization header. Make sure this key is stored securely on your backend and never surfaced client-side.
We use rate limiting on a per-user basis to protect our APIs against abuse. Our Sandbox environment is limited to 5 requests per second. Our production environment is limited to 50 requests per second.
We also allow a brief burst above this limit to accommodate a sudden increase in traffic.
If you exceed the above quota then the API will respond with a 429 status code and you will need to retry the API call (we recommend implementing a retry policy with an exponential back-off).
Events
Events are persisted throughout the lifecycle of a payment/action as you use our API. We use events to notify you when something important happens in your account (or a linked sub account). The most commonly used event occurs when a payment is captured, in which case we persist a PaymentSession.captured event and then (optionally) send it to any webhooks you have registered that are listening for that event type.
Note that if you are taking payments as a platform (for sub accounts), events are saved against the sub account accountId, but will be sent to any webhooks that your account has configured.
Payouts
A payout represents the transfer of money from Ryft to a connected payout method (bank account), i.e. when we send money you're owed. Typically this is automated.
However, the payouts API allows you to explicitly create payouts for your sub accounts. Generally we'd recommend this if you are a marketplace who wants to control exactly when payouts should be sent out.
Transfers
A Transfer represents the movement of money between Ryft accounts.
This API allows platforms/marketplaces to transfer money from/to particular sub accounts, useful when:
- you owe a sub account money from a particular transaction and want to explicitly send it after the fact
- you want to recoup funds from a sub account, such as when dealing with disputes
- you want to collect additional/new commission from the sub account
Subscriptions
The subscriptions API allows you to automatically have Ryft schedule and charge recurring payments for a specific day and time. This API is not required to process recurring payments. After additional configuration, you can use our payment-sessions API to create and charge the recurring payments yourself.
Request
Registers a domain name for Apple Pay on the web. Note that this is required if relying on Ryft's Apple Pay processing certificate.
A Maxiumum of 99 domains can be registered against a single Ryft account.
Each domain must host our verification file under /.well-known/apple-developer-merchantid-domain-association.
Important: the Content-Type of the hosted file must be application/octet-stream.
- Sandbox environmmenthttps://sandbox-api.ryftpay.com/v1/apple-pay/web-domains
- Production environmenthttps://api.ryftpay.com/v1/apple-pay/web-domains
- cURL
- Node
- Python
curl -i -X POST \
https://sandbox-api.ryftpay.com/v1/apple-pay/web-domains \
-H 'Authorization: YOUR_API_KEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"domainName": "ryftpay.com"
}'{ "id": "apwd_01FCTS1XMKH9FF43CAFA4CXT3P", "domainName": "ryftpay.com", "createdTimestamp": 1631696701 }
Control the order (newest or oldest) in which the payment sessions are returned. false will arrange the results with newest first, whereas true shows oldest first. The default is false.
Control how many items are return in a given page The max limit we allow is 50. The default is 20.
- Sandbox environmmenthttps://sandbox-api.ryftpay.com/v1/apple-pay/web-domains
- Production environmenthttps://api.ryftpay.com/v1/apple-pay/web-domains
- cURL
- Node
- Python
curl -i -X GET \
https://sandbox-api.ryftpay.com/v1/apple-pay/web-domains \
-H 'Authorization: YOUR_API_KEY_HERE'{ "items": [ { … } ], "paginationToken": "apwd_01FCTS1XMKH9FF43CAFA4CXT3P_1641912473" }
- Sandbox environmmenthttps://sandbox-api.ryftpay.com/v1/apple-pay/web-domains/{id}
- Production environmenthttps://api.ryftpay.com/v1/apple-pay/web-domains/{id}
- cURL
- Node
- Python
curl -i -X GET \
https://sandbox-api.ryftpay.com/v1/apple-pay/web-domains/apwd_01FCTS1XMKH9FF43CAFA4CXT3P \
-H 'Authorization: YOUR_API_KEY_HERE'{ "id": "apwd_01FCTS1XMKH9FF43CAFA4CXT3P", "domainName": "ryftpay.com", "createdTimestamp": 1631696701 }
- Sandbox environmmenthttps://sandbox-api.ryftpay.com/v1/apple-pay/web-domains/{id}
- Production environmenthttps://api.ryftpay.com/v1/apple-pay/web-domains/{id}
- cURL
- Node
- Python
curl -i -X DELETE \
https://sandbox-api.ryftpay.com/v1/apple-pay/web-domains/apwd_01FCTS1XMKH9FF43CAFA4CXT3P \
-H 'Authorization: YOUR_API_KEY_HERE'{ "id": "apwd_01FCTS1XMKH9FF43CAFA4CXT3P" }
Request
Request a new Apple Pay web session. Use this endpoint if you process Apple Pay on the web and:
- you want to rely on Ryft's Apple Pay processing certificate
- have an existing integration or want to implement Apple Pay via our API (without using our SDKs)
This is the name displayed within the Apple Pay payment sheet. Must contain UTF-8 characters.
- Sandbox environmmenthttps://sandbox-api.ryftpay.com/v1/apple-pay/sessions
- Production environmenthttps://api.ryftpay.com/v1/apple-pay/sessions
- cURL
- Node
- Python
curl -i -X POST \
https://sandbox-api.ryftpay.com/v1/apple-pay/sessions \
-H 'Authorization: YOUR_API_KEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"displayName": "Ryft Merchandise",
"domainName": "ryftpay.com"
}'Apple Pay session successfully created
The opaque Apple Pay session object. This will be a JSON escaped string.
Supply this value to completeMerchantValidation
{ "sessionObject": "..." }