To retrieve the details of an existing standing order, you will need to send an HTTP GET request to the following endpoint:
GET https://<api-host>/v1/standingOrder/<standingOrderId>
Replace `<api-host>` with the appropriate API host URL, either `https://api-sandbox.trustistecommerce.com` for the sandbox environment or `https://api.trustistecommerce.com` for the production environment. Replace `<standingOrderId>` with the unique identifier of the standing order you want to retrieve.
Headers:
– `Authorization`: Hawk authentication header (generated using your client ID, private key, and other Hawk authentication parameters)
Example request:
GET https://api-sandbox.trustistecommerce.com/v1/standingorders/your_standing_order_id
Authorization: Hawk id=”your-client-id”, ts=”1618886397″, nonce=”a_random_nonce”, hash=”generated_request_hash”, ext=”hawk.1.header”, mac=”generated_mac”
Response:
The API will respond with a JSON object containing the following fields:
– `id`: The unique identifier for the payment
– `status`: The current status of the payment (e.g., “Pending”, “Active”, “Failed”, “Completed”)
– `amount`: Each payment amount as a decimal value
– ‘startDate’: The date the first payment is to be made, should be no earlier than tomorrow and in the format ‘yyyy-MM-dd’
– ‘frequency’: How often the standing order should be taken (Weekly, Monthly, Annually)
– ‘numberOfPayments’ – An integer to represent how many payments should be taken before the standing order ends or zero (0) to represent a standing order that is set to never expire
– `reference`: The unique reference for the payment If successful, the response will have a 200 OK status code. In case of an error, the API will return an appropriate error status code and a message describing the issue.