Withdrawal templates
Use these methods to manage client withdrawal templates.
When making withdrawals via the B2Core UI, clients can save data about withdrawal transactions as templates to avoid specifying the same information repeatedly for frequent withdrawals.
GET[host]/api/v2/my/withdrawals/patterns |
|
GET[host]/api/v2/my/withdrawals/patterns/{patternId} |
|
POST[host]/api/v2/my/withdrawals/patterns |
|
PUT[host]/api/v2/my/withdrawals/patterns/{patternId} PATCH[host]/api/v2/my/withdrawals/patterns/{patternId} |
|
DELETE[host]/api/v2/my/withdrawals/patterns/{patternId} |
Get a list of withdrawal templates
Use this method to obtain a list of available withdrawal templates.
Use a separate method to get withdrawal template details.
Request
Header parameters:
Authorization: Bearer <access_token>
Query parameters:
The following filter parameters are available for this method:
- name
The name of a withdrawal template.
- fromCreateTime
The start date of a period when withdrawal templates were created.
- toCreateTime
The end date of a period when withdrawal templates were created.
The following sorting parameters are available for this method:
- createTime
The date and time when a withdrawal template was created.
- name
The name of a withdrawal template.
Refer to the Query parameters section in the API Overview for details on applying filter and sorting parameters.
GET[host]/api/v2/my/withdrawals/patterns
curl --location -g --request GET 'https://host.name/api/v2/my/withdrawals/patterns?offset=0&limit=10&sort_by=createTime&filter[name]=Nick&filter[fromCreateTime]=2022-12-01T07:23:59%2B00:00&filter[toCreateTime]=2022-12-01T07:23:59%2B00:00' \
--header 'Authorization: Bearer <token>'
Response
A response contains an array of Withdrawal Template objects providing information about the withdrawal templates matching the request parameters.
Get withdrawal template details
Use this method to obtain detailed information about a specified withdrawal template.
Use a separate method to get a list of withdrawal templates.
Request
Path parameters:
- patternId required
The identifier of a withdrawal template.
GET[host]/api/v2/my/withdrawals/patterns/{patternId}
curl --location --request GET 'https://host.name/api/v2/my/withdrawals/patterns/1' \
--header 'Authorization: Bearer <token>'
Response
A response contains a Withdrawal Template object providing information about the specified withdrawal template.
Create a withdrawal template
Use this method to create a withdrawal template.
Request
Header parameters:
Authorization: Bearer <access_token>
Body
- data object required
The withdrawal data.
Show object fields- account_id integer
The identifier of an account from which funds are to be withdrawn.
- amount string
The withdrawal amount.
- currency_code string
The numeric code of a currency in which a withdrawal transaction is made.
- method_id integer
The identifier of a withdrawal method.
- groupName string
The name of a group in which a withdrawal method is included.
- data object
The data specific to a withdrawal method.
- name string required
The name of a withdrawal template.
POST[host]/api/v2/my/withdrawals/patterns
curl --location --request POST 'https://host.name/api/v2/my/withdrawals/patterns/1' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"data": {
"account_id": 275,
"amount": "0.0001",
"currency_code": 1000,
"method_id": 1,
"groupName": "Crypto",
"data": {
"wallet_address": "2NGWBeEcAau98dLd4CPyXfFTJCUViEXo81f",
"comment": "Withdrawal via B2BinPay"
}
"name": "My withdrawal template"
}'
Response
A response contains a Withdrawal Template object providing information about the newly created withdrawal template.
Update a withdrawal template
Use this method to update a withdrawal template.
Note
Instead of the method described below, you can use a similar method that uses the HTTP verbĀ PATCH.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- patternId required
The identifier of a withdrawal template.
Body:
The following field values can be updated for a withdrawal template:
- data object
The withdrawal data.
Show object fields- account_id integer
The identifier of an account from which funds are to be withdrawn.
- amount string
The withdrawal amount.
- currency_code string
The numeric code of a currency in which a withdrawal transaction is made.
- method_id integer
The identifier of a withdrawal method.
- groupName string
The name of a group in which a withdrawal method is included.
- data object
The data specific to a withdrawal method.
- name string
The name of a withdrawal template.
PUT[host]/api/v2/my/withdrawals/patterns/{patternId}
curl --location --request PUT 'https://host.name/api/v2/my/withdrawals/patterns/1' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"data": {
"account_id": 275,
"amount": "0.0001",
"currency_code": 1000,
"method_id": 1,
"groupName": "Crypto",
"data": {
"wallet_address": "2NGWBeEcAau98dLd4CPyXfFTJCUViEXo81f",
"comment": "Withdrawal via B2BinPay"
}
"name": "My withdrawal template"
}'
Response
A response includes a Withdrawal Template object providing information about the withdrawal template that was updated.
Delete a withdrawal template
Use this method to remove a specified withdrawal template.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- patternId required
The identifier of a withdrawal template.
DELETE[host]/api/v2/my/withdrawals/patterns/{patternId}
curl --location --request DELETE 'https://host.name/api/v2/my/withdrawals/patterns/1' \
--header 'Authorization: Bearer <token>'
Response
In case of success, no response body is returned.