4οΈβ£Customer Creation
Last updated
Last updated
This step assumes you have successfully authenticated your API credentials using Authentication and have followed Request Signatures and Idempotency guides to configure your requests
Now that you can make authenticated requests to the API, you are officially ready to onboard new customers with our platform. To do so, you need to use /customers
POST
request.
Specified chainId
is expected to follow the convention outlined in . For example, in order to onboard a customer using zkSync Era wallet with address 0x22227A31dd842196A246d8f3b775998560eAa61d
on Goerli Testnet, you can submit a following request:
If a customer with specified chainId
and externalId
is not onboarded in our system yet, you will receive a response with status 201 (Created)
which looks similar to the following:
If everything went well, you will receive a customer challenge to sign as a base64 encoded string. This is required to proceed to verification stage. Please, follow Sign in With X guide for more details on signing a customer challenge.
In order to submit a signed challenge, use a POST
request to /customers/{customerId}/challenge/sign
endpoint.
Please, not that the signature also must be a base64 encoded string. If signature is verified, you will receive an empty response with status code 204 (No Content)
.
If, for any reason, the original challenge is lost or cannot be signed immediately, you can fetch it again using a dedicated endpoint. If we encounter an error during signature validation via /sign
endpoint, a new challenge will be issued for you to retrieve.
We enforce a 1 hour expiration window via our API for all issued challenges for security purposes. If a challenge hasn't been signed within 1 hour from issue, we will generate a new one and make it available through this endpoint.
Creates new customer and generates a cryptographic challenge to verify ownership of blockchain account
Universal unique on-chain identifier of the account following CAIP-10 specification
Unique customer ID in a form of an external identifier. This would normally correspond to customer's ID in your system
Successful operation
Unique customer ID in a form of an external ID
Universal unique on-chain identifier of the account following CAIP-10 specification
Customer status
ISO-8601 timestamp
ISO-8601 timestamp
Base64 encoded message provided by this API for owner to sign
Retrieves challenge to verify customer's ownership of their blockchain account
Unique customer ID
Successful operation
Base64 encoded message provided by this API for owner to sign
Signs previously issued challenge to verify customer's ownership of their blockchain account
ID of customer to be challenged
Universal unique on-chain identifier of the account following CAIP-10 specification
Original base64 encoded challenge provided by this API for owner to sign
Base64 encoded signature
Successful operation