Sending API requests
The gateway API is a REST API that sends and receives JSON over HTTPS. This guide walks you through authenticating, making a first request in the sandbox, and confirming the result.
Note
Step 1: Authentication
Every request is authenticated with HTTP Basic authentication. Use your merchant alias as the username and your secret key as the password.
- Send requests from your server only. Never put the secret key in browser or mobile app code.
- Use the sandbox address for testing and the production address only after certification. Both are provided with your credentials.
- Always send requests over HTTPS.
Authorization: Basic base64(<merchant_alias>:<secret_key>)
Content-Type: application/json
Accept: application/jsonStep 2: Send a request to create a customer
A good first call is creating a customer record (called a shopper in the API). It needs no card data, so it's a safe way to confirm your credentials work.
POST https://<sandbox-api-host>/shoppers
{
"fullName": "Jordan Lee",
"email": "jordan@example.com",
"primaryAddress": {
"street1": "100 Main St",
"city": "Columbus",
"postalCode": "43215",
"countryCode": "USA"
}
}A successful response returns the new customer's id and href. Keep the href: you use it to attach stored cards and to reference the customer in later transactions.
Warning
Step 3: View the customer in the merchant portal
- 1Sign in to the merchant portal with the login sent with your sandbox account.
- 2Open Customers from the main menu.
- 3Find the customer you just created. API shoppers appear as customers in the portal.
Step 4: Start coding
Pick a starting point based on the integration you chose. Sample code for each quickstart comes with your sandbox access.
Gateway services in this section are provided through ONKORE's processing partner, Elavon. Developer accounts, sandbox and production credentials, the developer portal, and the merchant portal are provided by Elavon, so you'll see the Elavon name in those emails, portals, and API addresses. ONKORE remains your point of contact.
