跳转到内容
EN

Delete an end user

Code Mode: praxis.customer.customers.delete

HTTP: DELETE /customer/v1/customers/{customer_id}

Delete one end user on the merchant’s own confirmation, for a deletion request the person made to you. The confirm query parameter must repeat the path’s customer_id; the door passes it through verbatim and the service refuses any other value with 400 INVALID_PARAMS, so a missing confirm never deletes anything. The deletion is announced on the platform event bus and each product deletes its own sessions, events and files for that person, so the call returns as soon as the directory record is gone, not when every product has finished. An unknown or foreign id answers 404 CUSTOMER_NOT_FOUND.

签名

praxis.customer.customers.delete(args:{path:{customer_id:string};query:{confirm:string}}):Promise<{/** Object type, always customer.deleted. */ type?:"customer.deleted";/** The end-user id that was deleted. */ id?:string;/** Always true; the call would have failed otherwise. */ deleted?:boolean}>;

参数

名称位置类型必填说明
customer_idpathstring是End-user id from customers.list or customers.get; an id of another organization answers CUSTOMER_NOT_FOUND.
confirmquerystring是The customer_id being deleted, repeated exactly; the service compares it with the path and refuses a mismatch with 400.

响应

状态码内容类型说明
200application/jsonThe directory record is gone and the deletion has been announced to the products.
400application/jsonINVALID_PARAMS: the request is not shaped the way this face accepts — an unknown or misspelled field, a repeated query parameter, a resource scope not in the form <type>:<id>:<action>, an expand value that is not products, sign_ins or usage, or a confirm that does not repeat the path customer id. The error names the field at fault and what it accepts; correct that field and send the request again.
401application/jsonThe credential is missing, malformed or expired. Merchant routes answer UNAUTHENTICATED when the API key or session names no organization; the pre-auth doors answer GRANT_CODE_INVALID when a grant code is unknown, already used, expired or foreign, and ACCESS_TOKEN_EXPIRED when the end-user token cannot be verified (a sign-in that is over answers SIGN_IN_EXPIRED or SIGN_IN_REVOKED). Send a valid API key, request a fresh grant code, or sign the end user in again.
404application/jsonCUSTOMER_NOT_FOUND: no end user of this organization has that id, or the id belongs to another organization; a deleted key answers the same way. Read the current id from customers.list (or publishable_keys.list for a key) and retry with that; never construct an id.
502application/jsonUPSTREAM_UNAVAILABLE: the token issuer or another dependency refused the call, so nothing was issued or changed. Retry later, and if it persists report the time and the request path.
503application/jsonUPSTREAM_UNAVAILABLE: this face is not usable in this environment — the CUSTOMER service binding is unwired, or the anonymous rate limiter is unavailable or misconfigured so the door fails closed. Use an environment where the face is wired, or retry when the dependency is back.