# Get payment status Retrieves detailed status information for a specific payment identified by its payment ID (also known as transaction ID). This endpoint provides comprehensive status details including: - Type: The type of payment (e.g., "Outward Swift Payment MT103 API") - Status: Current status of the payment (e.g., "Pending", "Completed", "Reversed") - TransactionId: Unique payment identifier (or Transaction Id) - ExternalReference: External reference number for the payment - RemittanceInformation: Free-text information about the purpose of the payment - DebitAmount: The amount debited from the account, including currency code - CreditAmount: The amount credited to the account, including currency code - ValueDate: The date when the payment was/will be processed - ExchangeRate: The exchange rate applied to the payment ### Content Negotiation Clients must use the HTTP Accept header to indicate the desired response format: - Set Accept: application/json for JSON responses (default) - Set Accept: text/csv for CSV responses If the Accept header is omitted, application/json is assumed. ### Base URL: All API requests use the versioned base URL: https://api.bcb.bm/v1/payments/{paymentId}/status ### Sample Request in JavaScript: javascript async function getPaymentStatus(paymentId) { try { const response = await fetch(https://api.bcb.bm/v1/payments/${paymentId}/status, { method: 'GET', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json', 'Accept': 'application/json' } }); if (!response.ok) { const errorData = await response.json(); throw new Error(Error: ${errorData.message || 'Unknown error'}); } const paymentStatus = await response.json(); console.log('Payment Status Details:'); console.log('Payment ID:', paymentStatus.transactionId); console.log('Type:', paymentStatus.type); console.log('Status:', paymentStatus.status); console.log('External Reference:', paymentStatus.externalReference); console.log('Remittance Information:', paymentStatus.remittanceInformation); console.log('Value Date:', paymentStatus.valueDate); console.log('Debit Amount:', ${paymentStatus.debitAmount.amount} ${paymentStatus.debitAmount.currency}); if (paymentStatus.creditAmount && paymentStatus.creditAmount.amount) { console.log('Credit Amount:', ${paymentStatus.creditAmount.amount} ${paymentStatus.creditAmount.currency}); } // Implement business logic based on payment status if (paymentStatus.status === 'Completed') { console.log('Payment has been successfully completed.'); } else if (paymentStatus.status === 'Pending') { console.log('Payment is still being processed.'); } else if (paymentStatus.status === 'Failed') { console.log('Payment failed. Please check the details or contact support.'); } } catch (error) { console.error('There was a problem retrieving the payment status:', error.message); } } // Example usage: getPaymentStatus('PAY-001-2023'); Required Permission: get-payment-status This endpoint requires the permission claim get-payment-status to be present in the JWT token. These permissions are embedded in the token during the authentication process and cannot be modified afterward. The token must be obtained with the appropriate permissions to access this endpoint. Endpoint: GET /v1/payments/{paymentId}/status Version: v1 Security: Authorization, Feature Permissions ## Path parameters: - `paymentId` (string, required) The unique identifier of the payment (also known as transactionId) to retrieve status for. ## Response 200 fields (application/json): - `type` (string, required) The type of transaction (e.g., "Outward Swift Payment MT103 API") - `externalReference` (string,null) External reference number for the transaction - `status` (string, required) Current status of the transaction (e.g., "Pending", "Completed", "Reversed") - `remittanceInformation` (string,null) Free-text remittance information provided by the client, describing the purpose of the transaction. - `transactionId` (string, required) Unique transaction number - `debitAmount` (object, required) The amount debited from the account - `debitAmount.currency` (string, required) Currency ISO code - `debitAmount.amount` (string, required) Amount - `valueDate` (string, required) The date when the transaction will be processed - `creditAmount` (object, required) The amount credited from the account - `exchangeRate` (number,null) Exchange rate applied to the transaction ## Response 400 fields (application/json): - `error` (string, required) Error code or type that identifies the specific error condition - `message` (string, required) Human-readable error message that describes the error condition ## Response 401 fields (application/json): - `error` (string, required) Error code or type that identifies the specific error condition - `message` (string, required) Human-readable error message that describes the error condition ## Response 403 fields (application/json): - `error` (string, required) Error code or type that identifies the specific error condition - `message` (string, required) Human-readable error message that describes the error condition ## Response 429 fields (application/json): - `error` (string, required) Error code or type that identifies the specific error condition - `message` (string, required) Human-readable error message that describes the error condition ## Response 500 fields (application/json): - `error` (string, required) Error code or type that identifies the specific error condition - `message` (string, required) Human-readable error message that describes the error condition