Customers

>>>
List customers

Examples

curl -X GET https://komoju.com/api/v1/customers \
  -u sk_123456:
{
  "resource": "list",
  "total": 3,
  "page": 1,
  "per_page": 10,
  "last_page": 1,
  "data": [
    {
      "id": "dejj1yw8sg9zim5lme67bfzoc",
      "resource": "customer",
      "email": "kallie@beatty.net",
      "source": null,
      "metadata": {
        "order_id": "abcdefg"
      },
      "created_at": "2018-11-13T06:20:21Z"
    },
    {
      "id": "9muf0fdpzkmtk8f5zxrgy84j7",
      "resource": "customer",
      "email": "francebarton@lemkeprohaska.net",
      "source": null,
      "metadata": {
        "order_id": "abcdefg"
      },
      "created_at": "2018-11-13T06:20:21Z"
    },
    {
      "id": "65ba4ibdjw8wzmj4iyyhlvfqu",
      "resource": "customer",
      "email": "jesusahackett@ritchie.name",
      "source": null,
      "metadata": {
        "order_id": "abcdefg"
      },
      "created_at": "2018-11-13T06:20:21Z"
    }
  ]
}
>>>
Show a customer

Examples

curl -X GET https://komoju.com/api/v1/customers/a790tjviahrpcsz561912k7az \
  -u sk_123456:
{
  "id": "a790tjviahrpcsz561912k7az",
  "resource": "customer",
  "email": "eldon@dare.co",
  "source": null,
  "metadata": {
    "order_id": "abcdefg"
  },
  "created_at": "2018-11-13T06:20:21Z"
}
>>>

POST /api/v1/customers
Create a customer

Create a customer

Examples

curl -X POST https://komoju.com/api/v1/customers \
  -u sk_123456: \
  -d "email=test@example.com" \
  -d "metadata[order_id]=abcdefg" \
  -d "payment_details=tok_38e6c5838b91e5d4e3771431b275f6de29fb3822e3471db31d682fb09d27b398cbvlxyj1jhhmcso2e3xytrmkr" 
{
  "id": "82xjd1dmxmwp775ddfjzqww04",
  "resource": "customer",
  "email": "test@example.com",
  "source": {
    "type": "credit_card",
    "brand": "visa",
    "last_four_digits": "1111",
    "month": 1,
    "year": 2023
  },
  "metadata": {
    "order_id": "abcdefg"
  },
  "created_at": "2018-11-13T06:20:21Z"
}

Params

Param name Description
payment_details
required
A hash or token describing the payment method used to make the payment.
currency
optional
3 letter ISO currency code of the transaction
email
optional
Customer's email address.
metadata
optional
A set of key-value pairs
>>>
Update customers

Examples

curl -X PATCH https://komoju.com/api/v1/customers/6yk4lnmluxa1qt6bkdgojeunz \
  -u sk_123456: \
  -d "payment_details=tok_840321a7a54204f7ddf2f11325f75fc82d7fe5d34febd8c43b915e3de1717f799uqdec0fhs2hp1y9jijetqe2m" 
{
  "id": "6yk4lnmluxa1qt6bkdgojeunz",
  "resource": "customer",
  "email": "valentine@pfeffer.net",
  "source": {
    "type": "credit_card",
    "brand": "visa",
    "last_four_digits": "1111",
    "month": 1,
    "year": 2023
  },
  "metadata": {
    "order_id": "abcdefg"
  },
  "created_at": "2018-11-13T06:20:21Z"
}

Params

Param name Description
currency
optional
3 letter ISO currency code of the transaction
payment_details
optional
A hash or token describing the payment method used to make the payment.
email
optional
Customer's email address.
metadata
optional
A set of key-value pairs
>>>
Destroy a customer

Examples

curl -X DELETE https://komoju.com/api/v1/customers/539haasgxj1dztcfn8j1c1lf4 \
  -u sk_123456:
{
  "id": "539haasgxj1dztcfn8j1c1lf4",
  "resource": "customer",
  "email": "chadsporer@kuhnledner.com",
  "source": null,
  "metadata": {
    "order_id": "abcdefg"
  },
  "created_at": "2018-11-13T06:20:21Z"
}