Create a braintree gateway

How to create a braintree gateway via API

To create a new braintree gateway, send a POST request to the /api/braintree_gateways endpoint, passing the resource arguments in the request body.

Request

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

Arguments

Body ParameterTypeRequired

type

string

Required

attributes.name

string

Required

attributes.reference

string

Optional

attributes.reference_origin

string

Optional

attributes.metadata

object

Optional

attributes.merchant_account_id

string

Required

attributes.merchant_id

string

Required

attributes.public_key

string

Required

attributes.private_key

string

Required

attributes.descriptor_name

string

Optional

attributes.descriptor_phone

string

Optional

attributes.descriptor_url

string

Optional

relationships.braintree_payments

array

Optional

Example

The following request creates a new braintree gateway:

curl -g -X POST \
  'https://yourdomain.commercelayer.io/api/braintree_gateways' \
  -H 'Accept: application/vnd.api+json' \
  -H 'Authorization: Bearer your-access-token' \
  -H 'Content-Type: application/vnd.api+json' \
  -d '{
  "data": {
    "type": "braintree_gateways",
    "attributes": {
      "name": "US payment gateway",
      "merchant_account_id": "xxxx-yyyy-zzzz",
      "merchant_id": "xxxx-yyyy-zzzz",
      "public_key": "xxxx-yyyy-zzzz",
      "private_key": "xxxx-yyyy-zzzz"
    }
  }
}'

Last updated