Merchants

GET/merchants

List merchants

Request

GET/merchants
curl -G https://YOUR_DOMAIN/api/merchants \
  -H "Authorization: Bearer {token}" \
  -H "Accept: application/json"
Loading response...
POST/merchants

Create a merchant

Required attributes

  • Name
    name
    Type
    string
    Description
    The name of the merchant ACME Corp
  • Name
    primary_email
    Type
    string
    Description
    The primary email address of the merchant contact@acme.com

Optional attributes

  • Name
    invite_email
    Type
    string
    Description
    Email address to invite as the merchant owner. When provided, invite_role is required. owner@acme.com
  • Name
    invite_role
    Type
    string
    Description
    Role to assign to the invited user. Required when invite_email is provided. owner

Request

POST/merchants
curl -X POST https://YOUR_DOMAIN/api/merchants \
  -H "Authorization: Bearer {token}" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "ACME Corp",
    "primary_email": "contact@acme.com",
    "invite_email": "owner@acme.com",
    "invite_role": "owner"
}'
Loading response...
GET/merchants/{merchant}

Show a merchant

Get a single merchant by its ID.

Required attributes

  • Name
    merchant
    Type
    integer
    Description
    The ID of the merchant 1

Request

GET/merchants/{merchant}
curl -G https://YOUR_DOMAIN/api/merchants/{merchant} \
  -H "Authorization: Bearer {token}" \
  -H "Accept: application/json"
Loading response...
PUT/merchants/{merchant}

Update a merchant

Update one or more fields on a merchant. All fields are optional.

Required attributes

  • Name
    merchant
    Type
    integer
    Description
    The ID of the merchant 1

Optional attributes

  • Name
    name
    Type
    string
    Description
    The name of the merchant ACME Corp
  • Name
    email
    Type
    string
    Description
    The primary email address of the merchant contact@acme.com
  • Name
    phone_number
    Type
    string
    Description
    The phone number of the merchant owner +1-555-0100
  • Name
    notes
    Type
    string
    Description
    Notes for the merchant VIP customer
  • Name
    billing_cycle
    Type
    string
    Description
    The billing cycle for the merchant monthly
  • Name
    billing_cycle_day
    Type
    integer
    Description
    The day of the billing cycle (1–28) 1
  • Name
    per_item_adjustment
    Type
    number
    Description
    The per-item price adjustment 0
  • Name
    disabled
    Type
    boolean
    Description
    Whether the merchant is disabled
  • Name
    is_orders_enabled
    Type
    boolean
    Description
    Whether orders are enabled for the merchant
  • Name
    is_amazon_shipments_enabled
    Type
    boolean
    Description
    Whether Amazon shipments are enabled for the merchant

Request

PUT/merchants/{merchant}
curl -X PUT https://YOUR_DOMAIN/api/merchants/{merchant} \
  -H "Authorization: Bearer {token}" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "ACME Corp",
    "email": "contact@acme.com",
    "phone_number": "+1-555-0100",
    "notes": "VIP customer",
    "billing_cycle": "monthly",
    "billing_cycle_day": 1,
    "per_item_adjustment": 0,
    "disabled": true,
    "is_orders_enabled": true,
    "is_amazon_shipments_enabled": true
}'
Loading response...
POST/merchants/{merchant_id}/webhooks

Create a merchant webhook

Create a webhook subscription for a merchant. Merchant tokens can create subscriptions for their own merchant when the user has webhooks:create permission. The response includes the full signing secret; store it immediately because subsequent reads mask it. Webhook requests include a Signature header containing the lowercase hexadecimal HMAC-SHA256 of the entire raw JSON request body, using the webhook secret as the key. Verify the raw bytes received, before parsing or reserializing JSON, using a constant-time comparison. Compute the digest over the complete CloudEvent envelope and data.

Required attributes

  • Name
    merchant_id
    Type
    integer
    Description
    The integer ID of the merchant that owns the webhook 42
  • Name
    url
    Type
    string
    Description
    The URL that receives webhook requests https://integration.example.com/webhooks/prepbusiness
  • Name
    types
    Type
    object
    Description
    Map of supported webhook event names to booleans. Set an event to true to subscribe; false disables it. Unknown events are rejected. Available names are listed in the webhook event documentation. {"inbound_shipment.created":true,"inbound_shipment.tracking_updated":true}

Request

POST/merchants/{merchant_id}/webhooks
curl -X POST https://YOUR_DOMAIN/api/merchants/{merchant-id}/webhooks \
  -H "Authorization: Bearer {token}" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://integration.example.com/webhooks/prepbusiness",
    "types": {
        "inbound_shipment.created": true,
        "inbound_shipment.tracking_updated": true
    }
}'
Loading response...