The API uses Bearer (Token) Authentication to authenticate requests. The value of this bearer token is a JSON Web Token (JWT), which is passed in the Authorization HTTP header and signed by your private API Key.
Copy
Ask AI
curl -X GET https://api.example.gr4vy.app/transactions \ -H "authorization: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIi..."
To use the API you will need to generate a new API key. Please reach out to your Wpay representative who will provide you with the API key.
Using an SDK is the most simple way to call and authenticate with our API. When using one of our SDKs to call the API, authentication is handled by the SDK client. You will
only need to initialize the SDK with your private to handle authentication.
Use the package manager in your preferred programming language to install our
server-side SDK. Token generation can only be done server side and we do not recommend
doing this client side as it will expose your API key to your customers.
Copy
Ask AI
dotnet add package Gr4vy
Please always check and install the latest release of your preferred SDK.
Next, initialize the SDK with the ID of your instance and the private key.
Copy
Ask AI
using Gr4vy;using Gr4vy.Models.Components;using System.Collections.Generic;// Loaded the key from a file, env variable, // or anywhere elsevar privateKey = "..."; var sdk = new Gr4vySDK( id: "example", server: SDKConfig.Server.Sandbox, bearerAuthSource: Auth.WithToken(privateKey), merchantAccountId: "default");
The instance ID is the unique identifier for your deployment of our system and is included in every API call.
Together with the environment (sandbox or production) it is used to connect to the right APIs, as well as dashboard.The possible values for your ID are one of wpay, wpay1, wpay2, or wpay3. We will inform you
in which instance your account has been set up.