Create a google geocoder

How to create a google geocoder via API

To create a new google geocoder, send a POST request to the /api/google_geocoders endpoint, passing the resource arguments in the request body.

Request

POST https://yourdomain.commercelayer.io/api/google_geocoders

Arguments

Body ParameterTypeRequired

type

string

Required

attributes.name

string

Required

attributes.reference

string

Optional

attributes.reference_origin

string

Optional

attributes.metadata

object

Optional

attributes.api_key

string

Required

Example

The following request creates a new google geocoder:

curl -g -X POST \
  'https://yourdomain.commercelayer.io/api/google_geocoders' \
  -H 'Accept: application/vnd.api+json' \
  -H 'Authorization: Bearer your-access-token' \
  -H 'Content-Type: application/vnd.api+json' \
  -d '{
  "data": {
    "type": "google_geocoders",
    "attributes": {
      "name": "Default geocoder",
      "api_key": "xxxx-yyyy-zzzz"
    }
  }
}'

Last updated