Kanorio

API reference

Addresses

Customer API: GET /addresses, POST /addresses, PATCH /addresses/{id}, …

Base URL https://{site}/api/v1/customerErrorsPagination

List saved addresses

GET/addresses
beta

Shipping and billing addresses in the customer's address book. Each kind has one default.

Response 200

  • addressesobject[]required
  • addresses[].idstringrequired
  • addresses[].kind"SHIPPING" | "BILLING"required
  • addresses[].countryCodestringrequired
  • addresses[].recipientNamestringrequired
  • addresses[].phonestring | nullrequired
  • addresses[].addressLine1stringrequired
  • addresses[].addressLine2string | nullrequired
  • addresses[].localitystring | nullrequired
  • addresses[].regionstring | nullrequired
  • addresses[].postalCodestring | nullrequired
  • addresses[].isDefaultbooleanrequired

    The default address of its kind.

  • addresses[].createdAtstringrequired
curlTypeScript
curl -X GET "https://{site}/api/v1/customer/addresses" \
  -H "Authorization: Bearer $KANORIO_CUSTOMER_TOKEN"

Add an address

POST/addresses
beta

Fields and required parts follow the country's postal format (the same registry the checkout and form address fields use). An address identical to an existing one of the same kind returns that one instead of creating a duplicate. The first address of a kind becomes the default.

Request body

  • kind"SHIPPING" | "BILLING"
  • addressobjectrequired
  • address.countryCodestringrequired

    ISO 3166-1 alpha-2; decides which parts are required.

  • address.recipientNamestringrequired
  • address.phonestring | null

    E.164, or a national number of the address country.

  • address.addressLine1stringrequired
  • address.addressLine2string | null
  • address.localitystring | null

    City / district.

  • address.regionstring | null

    State / province / prefecture.

  • address.postalCodestring | null
  • setDefaultboolean

Response 200

  • addressobjectrequired
  • address.idstringrequired
  • address.kind"SHIPPING" | "BILLING"required
  • address.countryCodestringrequired
  • address.recipientNamestringrequired
  • address.phonestring | nullrequired
  • address.addressLine1stringrequired
  • address.addressLine2string | nullrequired
  • address.localitystring | nullrequired
  • address.regionstring | nullrequired
  • address.postalCodestring | nullrequired
  • address.isDefaultbooleanrequired

    The default address of its kind.

  • address.createdAtstringrequired
  • createdboolean

Errors

  • ADDRESS_INVALID 400
  • ADDRESS_LIMIT_REACHED 403
curlTypeScript
curl -X POST "https://{site}/api/v1/customer/addresses" \
  -H "Authorization: Bearer $KANORIO_CUSTOMER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Replace an address

PATCH/addresses/{id}
beta

The whole address is replaced. When the result equals another saved address of the same kind, the two are merged into that one.

Parameters

  • idstring · pathrequired

Request body

  • addressobjectrequired
  • address.countryCodestringrequired

    ISO 3166-1 alpha-2; decides which parts are required.

  • address.recipientNamestringrequired
  • address.phonestring | null

    E.164, or a national number of the address country.

  • address.addressLine1stringrequired
  • address.addressLine2string | null
  • address.localitystring | null

    City / district.

  • address.regionstring | null

    State / province / prefecture.

  • address.postalCodestring | null

Response 200

  • addressobjectrequired
  • address.idstringrequired
  • address.kind"SHIPPING" | "BILLING"required
  • address.countryCodestringrequired
  • address.recipientNamestringrequired
  • address.phonestring | nullrequired
  • address.addressLine1stringrequired
  • address.addressLine2string | nullrequired
  • address.localitystring | nullrequired
  • address.regionstring | nullrequired
  • address.postalCodestring | nullrequired
  • address.isDefaultbooleanrequired

    The default address of its kind.

  • address.createdAtstringrequired
  • createdboolean

Errors

  • NOT_FOUND 404
  • ADDRESS_INVALID 400
curlTypeScript
curl -X PATCH "https://{site}/api/v1/customer/addresses/{id}" \
  -H "Authorization: Bearer $KANORIO_CUSTOMER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Remove an address

DELETE/addresses/{id}
beta

When the default of a kind is removed, the most recently added address of that kind becomes the default.

Parameters

  • idstring · pathrequired

Errors

  • NOT_FOUND 404
curlTypeScript
curl -X DELETE "https://{site}/api/v1/customer/addresses/{id}" \
  -H "Authorization: Bearer $KANORIO_CUSTOMER_TOKEN"

Make an address the default of its kind

POST/addresses/{id}/default
beta

Parameters

  • idstring · pathrequired

Response 200

  • addressobjectrequired
  • address.idstringrequired
  • address.kind"SHIPPING" | "BILLING"required
  • address.countryCodestringrequired
  • address.recipientNamestringrequired
  • address.phonestring | nullrequired
  • address.addressLine1stringrequired
  • address.addressLine2string | nullrequired
  • address.localitystring | nullrequired
  • address.regionstring | nullrequired
  • address.postalCodestring | nullrequired
  • address.isDefaultbooleanrequired

    The default address of its kind.

  • address.createdAtstringrequired
  • createdboolean

Errors

  • NOT_FOUND 404
curlTypeScript
curl -X POST "https://{site}/api/v1/customer/addresses/{id}/default" \
  -H "Authorization: Bearer $KANORIO_CUSTOMER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'