Get your account
Read the account your API key belongs to. Use it to check that a key works, to show which business it is connected to, or to see whether the account has a credit account before you confirm with "payment_method": "credit".
GET /api/v5/memberRequires your API key in the api-key header. The account is always the key’s own: there is no way to read another account.
Example request
Section titled “Example request”curl https://api.transdirect.com.au/api/v5/member \ -H "api-key: $TD_API_KEY"import { client, getApiV5Member } from '@transdirect/api-sdk';
client.setConfig({ headers: { 'api-key': process.env.TD_API_KEY! } });
const { data: member } = await getApiV5Member();const canUseCredit = (member?.credit_limit ?? 0) > 0;Response
Section titled “Response”200 OK
{ "id": 48213, "company_name": "Example Books Pty Ltd", "contact_name": "Sam Taylor", "address": "1 Martin Place", "suburb": "SYDNEY", "postcode": 2000, "state": "NSW", "phone": "0291234567", "discount_factor": 0, "credit_limit": 0, "credit_limit_available": 0, "charge_type": "cc", "last_invoice_timestamp": null, "terms": null, "active": "1"}| Field | Type | Description |
|---|---|---|
id | integer | Your Transdirect account id. |
company_name, contact_name | string or null | Business and contact name on the account. |
address, suburb, state, phone | string or null | Account address and phone. |
postcode | integer | Account postcode, as a number. |
credit_limit | number | Credit account limit in AUD. 0 means the account has no credit account, so "payment_method": "credit" is refused with 403 NO_PAYMENT_METHOD. |
credit_limit_available | number | Credit left to use, in AUD. |
terms | string, number or null | Payment terms in days for a credit account. |
charge_type | string or null | How the account is billed, as stored, for example cc. |
discount_factor | number | An internal pricing value. Quotes already include your account’s pricing, so you do not need to apply it. |
last_invoice_timestamp | string, number or null | When the account was last invoiced, as stored. |
active | string, number or null | Whether the account is active, as stored ("1" when active). |
To see the cards and PayPal accounts you can pay with, use list payment methods. To apply for a credit account, see payments.
Errors
Section titled “Errors”| Status | Body | Cause |
|---|---|---|
401 | {"error":"missing_api_key"} or {"error":"invalid_api_key"} | No key, or a key that is not active. |
404 | {"error":"member_not_found"} | The key is not linked to an account. Contact Transdirect support. |
429 | {"error":"rate_limited"} | More than 600 requests a minute on this key. Wait for the retry-after seconds. |
Try it
Section titled “Try it”Open the API Explorer, add your key, and find Get the currently authenticated member. It is a quick way to check your key.