Refresh a customer now
const url = 'https://api.strent.dev/v1/customers/refresh';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"stripe_customer_id":"cus_123"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.strent.dev/v1/customers/refresh \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "stripe_customer_id": "cus_123" }'Refreshes one customer from Stripe and waits up to 10 seconds for the refresh to finish. It waits for a successful refresh whose Stripe read starts after the call arrives; queued work may be reused. Returns no billing data; read the customer’s facts after success. A timeout does not cancel the durable synchronization. Uses a separate 60 requests per minute project and bearer limit.
Authorizations
Section titled “ Authorizations ”Request Bodyrequired
Section titled “ Request Bodyrequired ”object
Example
{ "stripe_customer_id": "cus_123"}Responses
Section titled “ Responses ”Customer refresh finished successfully.
object
Example
{}The request body is invalid.
object
object
object
Example
{ "error": { "code": "VALIDATION_FAILED", "message": "The request body is invalid.", "requestId": "req_123" }}The Authorization header or project API key is invalid or revoked.
object
object
object
Example
{ "error": { "code": "INVALID_AUTH_HEADER", "message": "The Authorization header or project API key is invalid or revoked.", "requestId": "req_123" }}The customer does not exist in the project’s Stripe mode.
object
object
object
Example
{ "error": { "code": "CUSTOMER_REFRESH_STRIPE_CUSTOMER_NOT_FOUND", "message": "The customer does not exist in the project's Stripe mode.", "requestId": "req_123" }}The Stripe connection is missing or invalid.
object
object
object
Example
{ "error": { "code": "STRIPE_CONNECTION_REQUIRED", "message": "The Stripe connection is missing or invalid.", "requestId": "req_123" }}The request body is too large.
object
object
object
Example
{ "error": { "code": "VALIDATION_FAILED", "message": "The request body is too large.", "requestId": "req_123" }}The request failed.
object
object
object
Example
{ "error": { "code": "VALIDATION_FAILED", "message": "The request failed.", "requestId": "req_123" }}The project or pre-authentication rate limit was exceeded.
object
object
object
Example
{ "error": { "code": "RATE_LIMIT_EXCEEDED", "message": "The project or pre-authentication rate limit was exceeded.", "requestId": "req_123" }}Headers
Section titled “ Headers ”Seconds before another request is advised.
Strent could not complete the request.
object
object
object
Example
{ "error": { "code": "INTERNAL_ERROR", "message": "Strent could not complete the request.", "requestId": "req_123" }}Customer refresh failed.
object
object
object
Example
{ "error": { "code": "CUSTOMER_REFRESH_FAILED", "message": "Customer refresh failed.", "requestId": "req_123" }}Customer refresh is unavailable.
object
object
object
Example
{ "error": { "code": "CUSTOMER_REFRESH_UNAVAILABLE", "message": "Customer refresh is unavailable.", "requestId": "req_123" }}Customer refresh has not finished; durable work continues.
object
object
object
Example
{ "error": { "code": "CUSTOMER_REFRESH_NOT_FINISHED", "message": "Customer refresh has not finished; durable work continues.", "requestId": "req_123" }}