On This Page

{#jumplink-list}  
[Markdown](/docs/cybs/en-us/platform/developer/all/rest/rest-getting-started/restgs-sdk-intro/restgs-sdk-test.md)  
Filter  
FILTER BY TAG

Test Your Setup {#restgs-sdk-test}
==================================

![](/content/dam/documentation/cybs/en-us/topics/platform/rest/getting-started/images/restgs-sdk-flow-5-750x200.svg/jcr:content/renditions/original)  
`Cybersource` recommends that you test and verify that your payment system can securely send and receive REST API messages before transitioning to a production account. Use the test examples provided in this section to test your set up. You should also test any additional API requests that you will use in your live environment.  
If you receive unsuccessful responses, verify that your security keys work and that the key information is correctly entered into the SDK.

Completing a Test Transaction {#restgs-sdk-test-transaction}
============================================================

After setting up your system to be REST compliant, you can send these test requests to verify that you can send and receive REST API messages.

> IMPORTANT  
> Depending on your payment processor, you may be required to send additional fields that are not shown in these examples.  
> Follow these steps to verify that you can complete a test transaction:

1. **Authorize a Payment**

2. You send this POST request to the `https://apitest.cybersource.com``/pts/v2/payments` endpoint:

   ```keyword
   {
       "orderInformation": {
           "billTo": {
               "country": "US",
               "lastName": "Kim",
               "address1": "201 S. Division St.",
               "postalCode": "48104-2201",
               "locality": "Ann Arbor",
               "administrativeArea": "MI",
               "firstName": "Kyong-Jin",
               "email": "test@cybs.com"
           },
           "amountDetails": {
               "totalAmount": "100.00",
               "currency": "USD"
           }
       },
       "paymentInformation": {
           "card": {
               "expirationYear": "2031",
               "number": "4111111111111111",
               "expirationMonth": "12",
               "type": "001"
           }
       }
   }
   ```
3. You receive a successful response and store the authorization transaction ID in the id field. A successful response is indicated by a 201 HTTP status code.

   ```
   "id" : "6461731521426399003473"
   ```
4. **Capture an Authorized Payment**

5. You send this POST request to the `https://apitest.sa.cybersource.com``/pts/v2/payments/`*{id}*`/captures` endpoint and include the authorization transaction ID as the *`{id}`*:

   ```keyword
   https://apitest.sa.cybersource.com/pts/v2/payments/6461731521426399003473/captures
   ```

   ```
   {
       "clientReferenceInformation": {
           "code": "ABC123"
       },
       "orderInformation": {
           "amountDetails": {
               "totalAmount": "100.00",
               "currency": "USD"
       }
   }
   ```
6. You receive a successful response and store the capture transaction ID in the id field. A successful response is indicated by a 201 HTTP status code.

   ```
   "id": "6772994431376681303954"
   ```
7. **Refund a Captured Payment**

8. You send this POST request to the `https://apitest.cybersource.com``/pts/v2/payments/`*{id}*`/refunds` endpoint and include the capture transaction ID as the *{id}*:

   ```keyword
   https://apitest.cybersource.com/pts/v2/payments/6772994431376681303954/refunds
   ```

   ```
   {
       "orderInformation": {
           "amountDetails": {
               "totalAmount": "100.00",
               "currency": "USD"
           }
       }
   }
   ```
9. You receive a successful response, which verifies that your system can complete a transaction. A successful response is indicated by a 201 HTTP status code.  
   RELATED TO THIS PAGE

* [Getting Started with REST](https://developer.cybersource.com/docs/cybs/en-us/platform/developer/all/rest/rest-getting-started/restgs-intro.md)
* [Response Codes](https://developer.cybersource.com/api/reference/response-codes.md)
* [API Field Reference Guide](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/rest-api-fields-intro.md)
* [API Reference Sandbox](https://developer.cybersource.com/api-reference-assets/index.md#static-home-section)
* [Business Center Test](https://businesscentertest.cybersource.com/ebc2/)
* [Business Center Production](https://businesscenter.cybersource.com/ebc2/)
* [Customer Support](https://support.visaacceptance.com/)

