Skip to main content
POST
/
digital-wallets
Register digital wallet
using RestSharp;


var options = new RestClientOptions("https://api.sandbox.{id}.gr4vy.app/digital-wallets");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n  \"provider\": \"apple\",\n  \"merchant_name\": \"Gr4vy\",\n  \"domain_names\": [\n    \"example.com\"\n  ],\n  \"accept_terms_and_conditions\": true\n}", false);
var response = await client.PostAsync(request);

Console.WriteLine("{0}", response.Content);
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.sandbox.{id}.gr4vy.app/digital-wallets"

payload := strings.NewReader("{\n \"provider\": \"apple\",\n \"merchant_name\": \"Gr4vy\",\n \"domain_names\": [\n \"example.com\"\n ],\n \"accept_terms_and_conditions\": true\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.sandbox.{id}.gr4vy.app/digital-wallets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"provider\": \"apple\",\n \"merchant_name\": \"Gr4vy\",\n \"domain_names\": [\n \"example.com\"\n ],\n \"accept_terms_and_conditions\": true\n}")
.asString();
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.{id}.gr4vy.app/digital-wallets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'provider' => 'apple',
'merchant_name' => 'Gr4vy',
'domain_names' => [
'example.com'
],
'accept_terms_and_conditions' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import requests

url = "https://api.sandbox.{id}.gr4vy.app/digital-wallets"

payload = {
"provider": "apple",
"merchant_name": "Gr4vy",
"domain_names": ["example.com"],
"accept_terms_and_conditions": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
provider: 'apple',
merchant_name: 'Gr4vy',
domain_names: ['example.com'],
accept_terms_and_conditions: true
})
};

fetch('https://api.sandbox.{id}.gr4vy.app/digital-wallets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
curl --request POST \
--url https://api.sandbox.{id}.gr4vy.app/digital-wallets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"provider": "apple",
"merchant_name": "Gr4vy",
"domain_names": [
"example.com"
],
"accept_terms_and_conditions": true
}
'
{
  "type": "digital-wallet",
  "id": "8d3fe99b-1422-42e6-bbb3-932d95ae5f79",
  "merchant_account_id": "default",
  "provider": "apple",
  "merchant_name": "Gr4vy",
  "merchant_url": "https://example.com",
  "merchant_display_name": "Gr4vy",
  "merchant_country_code": "US",
  "domain_names": [
    "example.com"
  ],
  "fields": {
    "digital_payment_application_id": "<string>",
    "digital_payment_application_name": "<string>"
  },
  "created_at": "2012-12-12T10:53:43+00:00",
  "updated_at": "2012-12-12T10:53:43+00:00",
  "active_certificate_count": 1,
  "pending_certificate_count": 1,
  "expired_certificate_count": 1
}
{
"type": "error",
"code": "bad_request",
"status": 400,
"message": "Missing '****' field",
"details": [
{
"location": "body",
"type": "value_error.missing",
"pointer": "/payment_method/number",
"message": "field required"
}
]
}
{
"type": "error",
"code": "unauthorized",
"status": 401,
"message": "No valid API authentication found",
"details": []
}
{
"type": "error",
"code": "duplicate_record",
"status": 409,
"message": "A duplicate record exists with this external_identifier value",
"details": []
}
This endpoint requires the digital-wallets.write scope.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Merchant details used to register with a digital wallet provider.

provider
enum<string>
required

The name of the digital wallet provider.

Available options:
apple,
google
Example:

"apple"

merchant_name
string
required

The name of the merchant. This is used to register the merchant with a digital wallet provider and this name is not displayed to the buyer.

Example:

"Gr4vy"

domain_names
string[]
required

The list of domain names that a digital wallet can be used on. To use a digital wallet on a website, the domain of the site is required to be in this list.

Required array length: 1 - 99 elements
Example:
["example.com"]
accept_terms_and_conditions
boolean
required

The explicit acceptance of the digital wallet provider's terms and conditions by the merchant. Needs to be true to register a new digital wallet.

Example:

true

merchant_url
string<url> | null

The main URL of the merchant.

Example:

"https://example.com"

merchant_display_name
string | null

The consumer facing name of the merchant.

Example:

"Gr4vy"

merchant_country_code
string | null

The country code where the merchant is registered.

Required string length: 2
Example:

"US"

Response

Returns the newly registered digital wallet.

A digital wallet (e.g. Apple Pay) that has been registered.

type
enum<string>

digital-wallet.

Available options:
digital-wallet
Example:

"digital-wallet"

id
string<uuid>

The ID of the registered digital wallet.

Example:

"8d3fe99b-1422-42e6-bbb3-932d95ae5f79"

merchant_account_id
string

The unique ID for a merchant account.

Example:

"default"

provider
enum<string>

The name of the digital wallet provider.

Available options:
apple,
google
Example:

"apple"

merchant_name
string

The name of the merchant the digital wallet is registered to.

Example:

"Gr4vy"

merchant_url
string<url> | null

The main URL of the merchant.

Example:

"https://example.com"

merchant_display_name
string | null

The consumer facing name of the merchant.

Example:

"Gr4vy"

merchant_country_code
string | null

The country code where the merchant is registered.

Required string length: 2
Example:

"US"

domain_names
string[]

The list of domain names that a digital wallet can be used on. To use a digital wallet on a website, the domain of the site is required to be in this list.

Required array length: 1 - 99 elements
Example:
["example.com"]
fields
Click to Pay · object | null

Custom attributes for some digital wallets. Currently only used by Click to Pay.

created_at
string<date-time>

The date and time when this digital wallet was registered.

Example:

"2012-12-12T10:53:43+00:00"

updated_at
string<date-time>

The date and time when this digital wallet was last updated.

Example:

"2012-12-12T10:53:43+00:00"

active_certificate_count
integer

The number of active custom certificates registered for this digital wallet (Apple Pay only).

Example:

1

pending_certificate_count
integer

The number of pending custom certificates registered for this digital wallet (Apple Pay only).

Example:

1

expired_certificate_count
integer

The number of expired custom certificates registered for this digital wallet (Apple Pay only).

Example:

1