Class: CBCommerceClient
Legacy client for api.commerce.coinbase.com. Coinbase announced a 31 March 2026 migration deadline and the end of Commerce charge creation. These retained methods do not implement the Coinbase Business APIs or guarantee that legacy endpoints remain available.
See the Commerce transition notice and Coinbase Business Checkout APIs for migration guidance.
Extends
BaseRestClient
Constructors
Constructor
new CBCommerceClient(restClientOptions?: RestClientOptions, requestOptions?: AxiosRequestConfig): CBCommerceClient;Parameters
| Parameter | Type |
|---|---|
restClientOptions? | RestClientOptions |
requestOptions? | AxiosRequestConfig |
Returns
CBCommerceClient
Overrides
BaseRestClient.constructor
Methods
createCharge()
createCharge(params: object): Promise<any>;Legacy Commerce wrapper for POST /charges.
Parameters
| Parameter | Type |
|---|---|
params | { buyer_locale?: string; cancel_url?: string; checkout_id?: string; local_price: { amount: string; currency: string; }; metadata?: { custom_field?: string; custom_field_two?: string; }; pricing_type: string; redirect_url?: string; } |
params.buyer_locale? | string |
params.cancel_url? | string |
params.checkout_id? | string |
params.local_price | { amount: string; currency: string; } |
params.local_price.amount | string |
params.local_price.currency | string |
params.metadata? | { custom_field?: string; custom_field_two?: string; } |
params.metadata.custom_field? | string |
params.metadata.custom_field_two? | string |
params.pricing_type | string |
params.redirect_url? | string |
Returns
Promise<any>
createCheckout()
createCheckout(params: object): Promise<any>;Legacy Commerce wrapper for POST /checkouts.
Parameters
| Parameter | Type |
|---|---|
params | { buyer_locale?: string; metadata?: { custom_field?: string; custom_field_two?: string; }; pricing_type: string; requested_info?: string[]; total_price: { amount: string; currency: string; }; } |
params.buyer_locale? | string |
params.metadata? | { custom_field?: string; custom_field_two?: string; } |
params.metadata.custom_field? | string |
params.metadata.custom_field_two? | string |
params.pricing_type | string |
params.requested_info? | string[] |
params.total_price | { amount: string; currency: string; } |
params.total_price.amount | string |
params.total_price.currency | string |
Returns
Promise<any>
deletePrivate()
deletePrivate(endpoint: string, params?: ParamsInRequest): Promise<any>;Parameters
| Parameter | Type |
|---|---|
endpoint | string |
params? | ParamsInRequest |
Returns
Promise<any>
Inherited from
BaseRestClient.deletePrivate
generateNewOrderId()
generateNewOrderId(): string;Returns
string
Inherited from
BaseRestClient.generateNewOrderId
get()
get(endpoint: string, params?: object): Promise<any>;Parameters
| Parameter | Type |
|---|---|
endpoint | string |
params? | object |
Returns
Promise<any>
Inherited from
BaseRestClient.get
getAllCharges()
getAllCharges(): Promise<any>;Legacy Commerce wrapper for GET /charges. Returns one page, not every charge: the historical API uses cursor pagination and this method neither accepts a cursor nor fetches later pages automatically. This method targets api.commerce.coinbase.com, not Coinbase Business; current endpoint availability is not guaranteed.
Returns
Promise<any>
getAllCheckouts()
getAllCheckouts(): Promise<any>;Legacy Commerce wrapper for GET /checkouts. Returns one page, not every checkout: the historical API uses cursor pagination and this method neither accepts a cursor nor fetches later pages automatically. This method targets api.commerce.coinbase.com, not Coinbase Business; current endpoint availability is not guaranteed.
Returns
Promise<any>
getCharge()
getCharge(params: object): Promise<any>;Legacy Commerce wrapper for GET /charges/{charge_code_or_charge_id}.
Parameters
| Parameter | Type |
|---|---|
params | { charge_code_or_charge_id: string; } |
params.charge_code_or_charge_id | string |
Returns
Promise<any>
getCheckout()
getCheckout(params: object): Promise<any>;Legacy Commerce wrapper for GET /checkouts/{checkout_id}.
Parameters
| Parameter | Type |
|---|---|
params | { checkout_id: string; } |
params.checkout_id | string |
Returns
Promise<any>
getClientType()
getClientType(): RestClientType;Defines the client type (affecting how requests & signatures behave)
Returns
RestClientType
Overrides
BaseRestClient.getClientType
getPrivate()
getPrivate(endpoint: string, params?: object): Promise<any>;Parameters
| Parameter | Type |
|---|---|
endpoint | string |
params? | object |
Returns
Promise<any>
Inherited from
BaseRestClient.getPrivate
getSignTimestampMs()
getSignTimestampMs(): number;Timestamp used to sign the request. Override this method to implement your own timestamp/sync mechanism
Returns
number
Inherited from
BaseRestClient.getSignTimestampMs
listEvents()
listEvents(headers: object): Promise<any>;Legacy Commerce wrapper for GET /events. The historical API paginates event lists; this wrapper returns one response and does not fetch every page automatically. Pass the required X-CC-Version header argument. This method targets api.commerce.coinbase.com, not Coinbase Business; current endpoint availability is not guaranteed.
Parameters
| Parameter | Type |
|---|---|
headers | { "X-CC-Version": string; } |
headers.X-CC-Version | string |
Returns
Promise<any>
patchPrivate()
patchPrivate(endpoint: string, params?: ParamsInRequest): Promise<any>;Parameters
| Parameter | Type |
|---|---|
endpoint | string |
params? | ParamsInRequest |
Returns
Promise<any>
Inherited from
BaseRestClient.patchPrivate
post()
post(endpoint: string, params?: ParamsInRequest): Promise<any>;Parameters
| Parameter | Type |
|---|---|
endpoint | string |
params? | ParamsInRequest |
Returns
Promise<any>
Inherited from
BaseRestClient.post
postPrivate()
postPrivate(endpoint: string, params?: ParamsInRequest): Promise<any>;Parameters
| Parameter | Type |
|---|---|
endpoint | string |
params? | ParamsInRequest |
Returns
Promise<any>
Inherited from
BaseRestClient.postPrivate
putPrivate()
putPrivate(endpoint: string, params?: ParamsInRequest): Promise<any>;Parameters
| Parameter | Type |
|---|---|
endpoint | string |
params? | ParamsInRequest |
Returns
Promise<any>
Inherited from
BaseRestClient.putPrivate
showEvent()
showEvent(params: object, headers: object): Promise<any>;Legacy Commerce wrapper for GET /events/{event_id}. Pass the required X-CC-Version header argument.
Parameters
| Parameter | Type |
|---|---|
params | { event_id: string; } |
params.event_id | string |
headers | { "X-CC-Version": string; } |
headers.X-CC-Version | string |
Returns
Promise<any>