Skip to content

Commit 3b2e1dd

Browse files
committed
Update individual GET endpoint info
1 parent 57b39e9 commit 3b2e1dd

7 files changed

Lines changed: 350 additions & 169 deletions

File tree

source/includes/beneficiaries.md

Lines changed: 69 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ The `id` is needed when instructing a payment.
8282

8383
## List all beneficiaries
8484

85-
Get a list of beneficiaries you have access to
85+
Get a list of beneficiaries you have access to.
8686

8787
> Example request:
8888
8989
```bash
90-
curl -X GET http://api-test.cleartreasury.co.uk/api/beneficiaries \
90+
curl -X GET http://api-test.cleartreasury.co.uk/api/beneficiaries?client_ref={client_ref} \
9191
-H 'Authorization: Bearer <your auth token>'
9292
```
9393

@@ -116,7 +116,11 @@ curl -X GET http://api-test.cleartreasury.co.uk/api/beneficiaries \
116116

117117
### Request
118118

119-
`GET /beneficiaries`
119+
`GET /beneficiaries?client_ref={client_ref}`
120+
121+
| Name | Description | Required | Type |
122+
| -------------- | ---------------------------- | -------- | ------ |
123+
| beneficiary_id | Unique ID of the beneficiary | Yes | string |
120124

121125
### Response
122126

@@ -137,4 +141,66 @@ Beneficiary `id` is needed for booking a trade.
137141
| email | Email address | string | |
138142
| ben_address | Contact address | string | |
139143
| notes | Noteworthy information | string | |
144+
| id | Unique ID of the beneficiary | string | |
145+
| client_ref | Client reference to associate the beneficiary with | string | |
146+
147+
## Get a beneficiary
148+
149+
Retrieve a single beneficiary by beneficiary ID.
150+
151+
> Example request:
152+
153+
```bash
154+
curl -X GET http://api-test.cleartreasury.co.uk/api/beneficiaries/{beneficiary_id} \
155+
-H 'Authorization: Bearer <your auth token>'
156+
```
157+
158+
> Example response:
159+
160+
```json
161+
{
162+
"client_ref": "C00000001",
163+
"id": "1",
164+
"intermediary": "",
165+
"account_name": "Test bank account",
166+
"account_number": "01234567",
167+
"address": "",
168+
"bankname": "",
169+
"currency": "GBP",
170+
"notes": "Added from API 01/01/2020 00:00:00",
171+
"sort_code": "001122",
172+
"swift": "AAAAUK12345XXX",
173+
"country_code": "GB",
174+
"email": "test.beneficiary@example.com",
175+
"ben_address": "",
176+
"cnaps": ""
177+
}
178+
```
179+
180+
### Request
181+
182+
`GET /beneficiaries/{beneficiary_id}`
183+
184+
| Name | Description | Required | Type |
185+
| -------------- | ---------------------------- | -------- | ------ |
186+
| beneficiary_id | Unique ID of the beneficiary | Yes | string |
187+
188+
### Response
189+
190+
| Name | Description | Type | Additional information |
191+
| -------------- | -------------------------------------------------- | ------ | ----------------------------------------- |
192+
| intermediary | SWIFT code of the intermediary bank account | string | Max length 50 |
193+
| account_name | Bank account name | string | |
194+
| account_number | Bank account number | string | |
195+
| sort_code | Bank account sort code | string | 6 digits. No spaces or special characters |
196+
| bankname | Bank name | string | |
197+
| address | Bank Address | string | |
198+
| swift | Bank SWIFT code | string | |
199+
| cnaps | CNAPS account number | string | |
200+
| country_code | Country code | string | ISO 2 letter country code |
201+
| currency | Currency | string | ISO 3 letter currency code |
202+
| email | Email address | string | |
203+
| ben_address | Contact address | string | |
204+
| notes | Noteworthy information | string | |
205+
| id | Unique ID of the beneficiary | string |
140206
| client_ref | Client reference to associate the beneficiary with | string | |

source/includes/clients.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -233,27 +233,25 @@ Retrieve a single client by client reference.
233233
> Example request:
234234
235235
```bash
236-
curl -X GET http://api-test.cleartreasury.co.uk/api/clients?client_ref={client_ref} \
236+
curl -X GET http://api-test.cleartreasury.co.uk/api/clients/{client_ref} \
237237
-H 'Authorization: Bearer <your auth token>'
238238
```
239239

240240
> Example response:
241241
242242
```json
243-
[
244-
{
245-
"ClientName": "TEST Company Ltd",
246-
"ClientRef": "C00000002",
247-
"ContactFirstName": "Test",
248-
"ContactLastName": "Tester",
249-
"Status": "New"
250-
}
251-
]
243+
{
244+
"ClientName": "TEST Company Ltd",
245+
"ClientRef": "C00000002",
246+
"ContactFirstName": "Test",
247+
"ContactLastName": "Tester",
248+
"Status": "New"
249+
}
252250
```
253251

254252
### Request
255253

256-
`GET /clients?client_ref={client_ref}`
254+
`GET /clients/{client_ref}`
257255

258256
| Name | Description | Required | Type |
259257
| ---------- | ------------------------------ | -------- | ------ |

source/includes/payment-methods.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Payment methods
2+
3+
Different countries have different details required for making payments to them.
4+
5+
### Description
6+
7+
This is an informational read-only endpoint for listing the payment methods for the countries and currencies we accept.
8+
9+
## Get payment methods for a country
10+
11+
Retrieve the payment methods of a country.
12+
13+
> Example request:
14+
15+
```bash
16+
curl -X GET http://api-test.cleartreasury.co.uk/api/paymentmethod \
17+
-H 'Authorization: Bearer <your auth token>'
18+
-d '{
19+
"CountryCode": "GB",
20+
"CCY": "GBP"
21+
}'
22+
```
23+
24+
> Example response:
25+
26+
```json
27+
[
28+
{
29+
"CountryName": "United Kingdom",
30+
"CCY": "GBP",
31+
"RequiredField": "(Account Number, SortCode, Beneficiary Address) OR (IBAN, SWIFT)"
32+
}
33+
]
34+
```
35+
36+
### Request
37+
38+
`GET /paymentmethod`
39+
40+
| Name | Description | Type |
41+
| ------------- | ---------------------------------------------------------------------------------- | ------ |
42+
| CountryName | The full name of the country | string |
43+
| CCY | The currency | string |
44+
| RequiredField | Required fields when instructing payments of the requested currency to the country | string |
45+
46+
### Response
47+
48+
| Name | Description | Type |
49+
| ----------- | -------------------------------------- | ------- |
50+
| CountryName | Full name of the country | string |
51+
| ISO2 | 2 letter ISO country code | string |
52+
| ISO3 | 3 letter ISO country code | string |
53+
| RiskScore | Compliance risk score for this country | decimal |

source/includes/payments.md

Lines changed: 32 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,11 @@ curl -X POST http://api-test.cleartreasury.co.uk/api/payments \
6464

6565
### Response
6666

67-
<!-- TODO: Add response data -->
68-
6967
| Name | Description | Type |
7068
| ----------- | ------------------------------------- | ------ |
7169
| PaymentGuid | The GUID you specified in the request | string |
7270

73-
## List all payments
71+
<!-- ## List all payments
7472
7573
Retrieve a list of all payment you have access to.
7674
@@ -93,7 +91,8 @@ curl -X GET http://api-test.cleartreasury.co.uk/api/payments \
9391
"amount": "200.00",
9492
"trade_ref": "<trade reference>",
9593
"payment_guid": "<your GUID>",
96-
"client_ref": "<client reference>"
94+
"client_ref": "<client reference>",
95+
"status": "Pending"
9796
},
9897
{
9998
"beneficiary_id": "1",
@@ -103,7 +102,8 @@ curl -X GET http://api-test.cleartreasury.co.uk/api/payments \
103102
"amount": "100.00",
104103
"trade_ref": "<trade reference>",
105104
"payment_guid": "<your GUID>",
106-
"client_ref": "<client reference>"
105+
"client_ref": "<client reference>",
106+
"status": "Paid"
107107
}
108108
]
109109
```
@@ -126,8 +126,9 @@ curl -X GET http://api-test.cleartreasury.co.uk/api/payments \
126126
| trade_ref | Trade reference | string |
127127
| payment_guid | Payment GUID | string |
128128
| client_ref | Client reference | string |
129+
| status | Payment status | string | -->
129130

130-
<!-- ## Get a payment
131+
## Get a payment
131132

132133
Get payment instruction by ID
133134

@@ -142,73 +143,41 @@ curl -X GET http://api-test.cleartreasury.co.uk/api/payments/{id}?client_ref={{c
142143
143144
```json
144145
{
145-
"Intermediary": "string",
146-
"AccountName": "string",
147-
"AccountNumber": "string",
148-
"Address": "string",
149-
"BankName": "string",
150-
"CCY": "string",
151-
"Notes": "string",
152-
"SortCode": "string",
153-
"Swift": "string",
154-
"CountryCode": "string",
155-
"Email": "string",
156-
"BenAddress": "string",
157-
"CNAPS": "string",
158-
"Purpose": "string",
159-
"ChargeCode": "string",
160-
"Amount": 0,
161-
"PaymentReference": "string",
162-
"TradeReference": "string",
163-
"tra_client_id": 0,
164-
"pin_id": 0,
165-
"PaymentGUID": "00000000-0000-0000-0000-000000000000",
166-
"opi_id": 0,
167-
"CreationDate": "2019-10-17T11:27:23.691Z",
168-
"Status": "string",
169-
"exportedDate": "2019-10-17T11:27:23.691Z"
146+
"beneficiary_id": "2",
147+
"currency": "GBP",
148+
"purpose": "Making an investment",
149+
"fee": "SHA",
150+
"amount": "200.00",
151+
"trade_ref": "<trade reference>",
152+
"payment_guid": "<your GUID>",
153+
"client_ref": "<client reference>",
154+
"status": "Pending"
170155
}
171156
```
172157

173158
### Request
174159

175-
`GET /payments/{id}client_ref={{client_ref}}`
160+
`GET /payments/{payment_guid}`
176161

177-
| Name | Description | Required | Type |
178-
| ---------- | ------------------------------------------------------------ | -------- | ------ |
179-
| id | payment GUID | yes | string |
180-
| client_ref | Client reference you're instructing the payment on behalf of | yes | string |
162+
| Name | Description | Required | Type |
163+
| ------------ | ------------------------ | -------- | ------ |
164+
| payment_guid | Unique ID of the payment | yes | string |
181165

182166
### Response
183167

184-
| Name | Description | Type |
185-
| ---------------- | ----------- | ------- |
186-
| Intermediary | | string |
187-
| AccountName | | string |
188-
| AccountNumber | | string |
189-
| Address | | string |
190-
| BankName | | string |
191-
| CCY | | string |
192-
| Notes | | string |
193-
| SortCode | | string |
194-
| Swift | | string |
195-
| CountryCode | | string |
196-
| Email | | string |
197-
| BenAddress | | string |
198-
| CNAPS | | string |
199-
| Purpose | | string |
200-
| ChargeCode | | string |
201-
| Amount | | decimal |
202-
| PaymentReference | | string |
203-
| TradeReference | | string |
204-
| tra_client_id | | integer |
205-
| pin_id | | integer |
206-
| PaymentGUID | | string |
207-
| opi_id | | integer |
208-
| CreationDate | | date |
209-
| Status | | string |
210-
| exportedDate | | date |
168+
| Name | Description | Type |
169+
| -------------- | ---------------- | ------ |
170+
| beneficiary_id | Beneficiary ID | string |
171+
| currency | Currency | string |
172+
| purpose | Purpose | string |
173+
| fee | Fee | string |
174+
| amount | Amount | string |
175+
| trade_ref | Trade reference | string |
176+
| payment_guid | Payment GUID | string |
177+
| client_ref | Client reference | string |
178+
| status | Payment status | string |
211179

180+
<!--
212181
## List payments by date
213182
214183
Retrieve payment instruction list inclusive of from and to dates.

0 commit comments

Comments
 (0)