{
"deposit_session_id": "<string>",
"customer_id": "<string>",
"status": "active",
"allow_multiple_deposits": true,
"expires_at": 123,
"url": "<string>",
"metadata": {},
"created": 123
}{
"deposit_session_id": "<string>",
"customer_id": "<string>",
"status": "active",
"allow_multiple_deposits": true,
"expires_at": 123,
"url": "<string>",
"metadata": {},
"created": 123
}{
"code": 123,
"message": "<string>",
"errorCode": "<string>",
"data": null
}{
"code": 123,
"message": "<string>",
"errorCode": "<string>",
"data": null
}{
"code": 123,
"message": "<string>",
"errorCode": "<string>",
"data": null
}{
"code": 123,
"message": "<string>",
"errorCode": "<string>",
"data": null
}Create a customer deposit
Create a deposit session and hosted checkout link using the 10-digit customer ID from the merchant system. If the customer does not exist, it is automatically created within the current merchant.
external_customer_id must be exactly 10 digits, and allow_multiple_deposits is required. Creation requests must also include Idempotency-Key.
{
"deposit_session_id": "<string>",
"customer_id": "<string>",
"status": "active",
"allow_multiple_deposits": true,
"expires_at": 123,
"url": "<string>",
"metadata": {},
"created": 123
}{
"deposit_session_id": "<string>",
"customer_id": "<string>",
"status": "active",
"allow_multiple_deposits": true,
"expires_at": 123,
"url": "<string>",
"metadata": {},
"created": 123
}{
"code": 123,
"message": "<string>",
"errorCode": "<string>",
"data": null
}{
"code": 123,
"message": "<string>",
"errorCode": "<string>",
"data": null
}{
"code": 123,
"message": "<string>",
"errorCode": "<string>",
"data": null
}{
"code": 123,
"message": "<string>",
"errorCode": "<string>",
"data": null
}Authorizations
Bearer API Key, for example Bearer sk_live_xxx.
Unix timestamp in seconds. Must be within 5 minutes of the server time.
Random string for replay protection, 16–64 characters.
HMAC-SHA256 signature computed using the merchant API Secret, encoded as lowercase hex.
Headers
Unix timestamp in seconds. Must be within 5 minutes of the server time.
Random string for replay protection, 16–64 characters. A new UUID is recommended for each request.
16 - 64Compute HMAC-SHA256 over {timestamp}.{nonce}.{requestBody} using the merchant API Secret and encode the result as lowercase hex. For GET requests, requestBody is an empty string.
Request idempotency key scoped to the merchant, up to 128 characters.
1 - 128Body
Customer ID in the merchant system. Must be exactly 10 digits.
^[0-9]{10}$Whether multiple deposits are allowed using the same deposit link.
Customer name. Saved when the customer is first created; existing customer details are not overwritten.
255Customer email address. Saved when the customer is first created; existing customer details are not overwritten.
255Customer phone number. Saved when the customer is first created; existing customer details are not overwritten.
50Expiration time in Unix seconds. Must be in the future. Omit for a link that never expires; the response returns null.
Description of the deposit session.
500Redirect URL after successful payment. Must be an absolute HTTPS URL.
1024Redirect URL after the customer cancels payment. Must be an absolute HTTPS URL.
1024Merchant-defined metadata. Up to 50 entries, with keys of 1–64 characters and values of up to 500 characters.
Show child attributes
Show child attributes
Response
Idempotent replay. Returns the same deposit session that was already created.
Deposit session ID.
StablePay customer ID.
Deposit session status.
active, closed, expired Whether multiple deposits are allowed using the same link.
Expiration time in Unix seconds. Always null when the link never expires.
Hosted checkout URL.
Merchant-defined metadata.
Show child attributes
Show child attributes
Creation time in Unix seconds.
Was this page helpful?
