Step 1: Create Account
If you haven't created your Client Portal account, refer to Get Started guide to learn how to sign up to generate and access your API keys.
Download Postman Collection
Pro Tip ๐ก
Be sure and switch to the Rapyd Sandbox Environment in Postman and add in the values for your Access and Secret Keys to successfully hit endpoints.
Code Samples - Accept Payments - Collect API
Be sure and open the accept-payments repo from Rapyd Samples GitHub โ Explore samples written in PHP, Node, .NET, and Python.
Step 2: Test Endpoint
Using your preferred REST API testing tool make sure you are hitting the Rapyd endpoint.
GET https://sandboxapi.rapyd.net/v1/data/countries
You should have the following error response returned.
{
"status": {
"error_code": "MISSING_AUTHENTICATION_HEADERS",
"status": "ERROR",
"message": "The request did not contain the required headers
for authentication. The request was rejected. Corrective action:
Add authentication headers.",
"response_code": "MISSING_AUTHENTICATION_HEADERS",
"operation_id": "cb1d06f6-7f8d-480e-9df2-5f210a1dc86e"
}
}
Step 3: Get API Keys
From your sandbox account in the Rapyd Client Portal, locate your Secret key and Access key. You can find these by selecting 'Developers' from the left navigation.
In the Rapyd Client Portal, toggle the button switch to 'Sandbox' on the bottom of the left navigation.
Step 4: Build Auth Headers
Rapyd request headers are: access_key, content-Type, salt, signature, and timestamp
Read about message security and Request Signatures in the reference guide.
GitHub
For more Header details visit the List Countries page in our API reference.
Some API calls have their own set of headers, you can find more details in the API reference for each API endpoint.
Step 5: Calculate Signature
You must BASE64 encode (with URL safe encoding) a HASH output using HMAC-SHA256.
The formula for calculating the signature is:
signature = BASE64 ( HASH ( http_method + url_path + salt + timestamp + access_key + secret_key + body_string ) )
For more details, including code samples in a variety of programming languages visit the Request Signatures page in our API reference to read how to construct your Request Signature.
Step 6: Send Request
Now that you have your API keys, built your auth headers with signature, or have the Postman collection you are ready to send an HTTP GET Request to Rapyd - let's use the request โlist countriesโ GET method.
GET https://sandboxapi.rapyd.net/v1/data/countries
Your response should look something like this:
{
"status": {
"error_code": "",
"status": "SUCCESS",
"message": "",
"response_code": "",
"operation_id": "eda93fb4-fc97-4907-a282-c9676b37436a"
},
"data": [
{
"id": 379,
"name": "Albania",
"iso_alpha2": "AL",
"iso_alpha3": "ALB",
"currency_code": "ALL",
"currency_name": "Albanian lek",
"currency_sign": "L",
"phone_code": "355"
},
{
"id": 132,
"name": "Andorra",
"iso_alpha2": "AD",
"iso_alpha3": "AND",
"currency_code": "EUR",
"currency_name": "Euro",
"currency_sign": "โฌ",
"phone_code": "376"
},
{
"id": 133,
"name": "Angola",
"iso_alpha2": "AO",
"iso_alpha3": "AGO",
"currency_code": "AOA",
"currency_name": "Angolan kwanza",
"currency_sign": "Kz",
"phone_code": "244"
},
//...etc...
Updated about a month ago