Manage payments
On this page:
Query a payment
You can query the state of a payment by sending a GET request to the REST API.
Example request
Send a GET
request to the transactions endpoint.
GET
https://apitest.cybersource.com/tss/v2/transactions/{id}
transaction_id
field used in the gateway response to your POST URL after the payment. Response
A successful request returns an HTTP code 200
along with the following parameters:
Parameter | Data type | Description |
---|---|---|
id | stringMaxLength (26) | A unique identification number generated by Cybersource to identify the submitted request. Returned by all services. It is also appended to the endpoint of the resource. |
rootId | stringMaxLength (26) | Contains the transaction identifier for the first transaction in the series of transactions. For example, you might send an authorization request for a payment, followed by a capture request for that payment, and then a refund request for that captured payment. Each of those requests, if successful, creates a resource that is assigned an identifier, which is returned in the response. The rootId identifies the first ID in the series, which in this case would be the ID of the original authorization. |
reconciliationId | StringMaxLength (60) | Reference number for the transaction. |
merchantId | String | Your Cybersource merchant ID. |
submitTimeUTC | String | Time of request in UTC. Format: YYYY-MM-DDThh:mm:ssZ Example 2016-08-11T22:47:57Z equals August 11, 2016, at 22:47:57 (10:47:57 p.m.) The T separates the date and the time. The Z indicates UTC. |
applicationInformation | Object | - |
applicationInformation status | String | The status of the submitted transaction. |
reasonCode | String | Indicates the reason why a request succeeded or failed and possible action to take if a request fails. |
Reverse an authorization
You can use the authorization reversal service to reverse an unnecessary or undesired authorization.
A successful authorization reversal releases the hold that the authorization placed on your customer's payment card funds.
You can only reverse an authorization that has not been captured and settled. Each issuing bank has its own rules for deciding whether a full authorization reversal succeeds or fails.
If the authorization has been captured, we recommend you refund the payment.
Authorization reversal example request
POST
the authorization information to the REST API Reversals resource.
POST
https://apitest.cybersource.com/pts/v2/payments/{id}/reversals
The id used in the resource URL is the transaction_id
field used in the gateway response to your POST URL after the payment.
Authorization reversal request body:
{ "reversalInformation": { "amountDetails": { "totalAmount": "102.21", "currency": "GBP" } } }
Response
A successful request returns an HTTP code 200
along with the following parameters:
Parameter | Data type | Description |
---|---|---|
_links | Object | - |
id | StringMaxLength 26 | A unique identification number generated by Cybersource to identify the submitted request. Returned by all services. It is also appended to the endpoint of the resource. On incremental authorizations, this value will be the same as the identification number returned in the original authorization response. |
submitTimeUtc | string | Time of request in UTC. Format: YYYY-MM-DDThh:mm:ssZ Example 2016-08-11T22:47:57Z equals August 11, 2016, at 22:47:57 (10:47:57 p.m.). The T separates the date and the time. The Z indicates UTC. Returned by Cybersource for all services. |
status | String | The status of the submitted transaction. Possible values:
|
reversalAmountDetails | Object | - |
reversalAmountDetails reversedAmount | StringMaxLength 15 | Total reversed amount. Returned by authorization reversal. |
originalTransactionAmount | StringMaxLength 15 | Amount of the original transaction. Returned by authorization reversal and void. |
currency | StringMaxLength 3 | Currency used for the order. Use the three-character ISO Standard Currency Codes. |
Capture an authorization
When you are ready to fulfill a customer's order and transfer funds from your customer's bank to your bank, capture the authorization for that order.
If you can fulfill only part of a customer's order, do not capture the full amount of the authorization. Capture only the cost of the items that you can ship. When you ship the remaining items, request a new authorization, then capture the new authorization.
Unlike authorizations, a capture does not happen in real time. All of the capture requests for a day are placed in a batch file and sent to the processor.
In most cases, the batch is settled at night. It usually takes two to four days for your acquiring bank to deposit funds in your merchant bank account.
Capture authorization example request
POST
the authorization information to the REST API Capture resource.
POST
https://apitest.cybersource.com/pts/v2/payments/{id}/captures
The id used in the resource URL is the transaction_id
field used in the gateway response to your POST URL after the payment.
Authorization capture request body:
{ "orderInformation": { "amountDetails": { "totalAmount": "102.21", "currency": "GBP" } } }
Response
A successful request returns an HTTP code 201
along with the following parameters:
Parameter | Data type | Description |
---|---|---|
_links | Object | - |
id | StringMaxLength 26 | A unique identification number generated by Cybersource to identify the submitted request. Returned by all services. It is also appended to the endpoint of the resource. |
submitTimeUtc | String | Time of request in UTC. Format: YYYY-MM-DDThh:mm:ssZ Example 2016-08-11T22:47:57Z equals August 11, 2016, at 22:47:57 (10:47:57 p.m.). The T separates the date and the time. The Z indicates UTC. |
status | String | The status of the submitted transaction. Possible values:
|
Refund a captured payment
A refund is linked to a capture in the payment system. You can request multiple refunds against a single capture.
When your request for a refund is successful, the issuing bank for the payment card takes money out of your merchant bank account and returns it to your customer.
It usually takes two to four days for your acquiring bank to transfer funds from your merchant bank account.
Refund example request
POST
the value from the id field of the capture response to your REST API refund resource.
POST
https://apitest.cybersource.com/pts/v2/payments/{id}/refunds
The id used in the resource URL is the transaction_id
field used in the gateway response to your POST URL after the payment.
Refund request body:
{ "orderInformation": { "amountDetails": { "totalAmount": "10", "currency": "GBP" } } }
Response
A successful request returns an HTTP code 201
along with the following parameters:
Parameter | Data type | Description |
---|---|---|
_links | Object | - |
id | StringMaxLength 26 | A unique identification number generated by Cybersource to identify the submitted request. Returned by all services. It is also appended to the endpoint of the resource. |
submitTimeUtc | String | Time of request in UTC. Format: YYYY-MM-DDThh:mm:ssZ Example 2016-08-11T22:47:57Z equals August 11, 2016, at 22:47:57 (10:47:57 p.m.). The T separates the date and the time. The Z indicates UTC. |
status | String | The status of the submitted transaction. Possible values:
|