# Retrieve Payment API (Compliant with Payment Services Directive for UK customers)
source: https://developer.mastercard.com/cross-border-services/documentation/api-ref/psd2-uk-retrieve-payment-api/index.md

You can use this API to retrieve the payment transaction using the transaction Id or transaction Reference.   
When using the Retrieve Payment API resource to check the status of a PENDING payment, it should be used no more than every 30 minutes for each payment being retrieved.

## Environment Domains {#environment-domains}

### Retrieve Payment by Transaction Id {#retrieve-payment-by-transaction-id}

* Sandbox
* MTF
* Production

```Sandbox
https://sandbox.api.xbs.mastercard.uk/send/v1/partners/{partner-id}/crossborder/{payment-id}
```

```MTF
https://mtf.api.xbs.mastercard.uk/send/v1/partners/{partner-id}/crossborder/{payment-id}
```

```Production
https://api.xbs.mastercard.uk/send/v1/partners/{partner-id}/crossborder/{payment-id}
```

### Retrieve Payment by Transaction Reference {#retrieve-payment-by-transaction-reference}

* Sandbox
* MTF
* Production

```Sandbox
https://sandbox.api.xbs.mastercard.uk/send/v1/partners/{partner-id}/crossborder?ref={payment-reference}
```

```MTF
https://mtf.api.xbs.mastercard.uk/send/v1/partners/{partner-id}/crossborder?ref={payment-reference}
```

```Production
https://api.xbs.mastercard.uk/send/v1/partners/{partner-id}/crossborder?ref={payment-reference}
```

## API {#api}

To download the Open API specifications (or swagger file) click on the expandable section below.
Once expanded, scroll down to the body of the request/ response and click on Model tab and then on the request/ response objects to look at the request/ response parameters.  

Alternatively, here is a tabular view of the request/ response parameter:
[Retrieve_Payment_Specifications.pdf](https://static.developer.mastercard.com/content/cross-border-services/uploads/Retrieve_Payment_Specifications.pdf) (1MB)   

## Retrieve Payment by Transaction Id {#retrieve-payment-by-transaction-id-1}


API Reference: `GET /send/v1/partners/{partner-id}/crossborder/{payment-id}`

## Retrieve Payment by Transaction Reference {#retrieve-payment-by-transaction-reference-1}


API Reference: `GET /send/v1/partners/{partner-id}/crossborder`

* **Formats supported** : XML/ JSON   
* **HTTP Version**: 1.0/ 1.1
* **Required HTTP header parameters** :   
  content-type : Format of the inbound content being submitted. example: application/json   
  content-length: Length of the inbound content body in octets.   
  Accept: Format of the expected response must be provided in this header field. Example - application/json

## API Convention {#api-convention}

Take a look at the [API Conventions](https://developer.mastercard.com/cross-border-services/documentation/api-basics/api-conventions/index.md) for general guidelines.

## Payload Encryption {#payload-encryption}

All the request payload sent by you to Mastercard must be encrypted. And you will need to decrypt the payload sent by Mastercard.   

For more detailed information on payload **Encryption/ Decryption** , please see [here](https://developer.mastercard.com/cross-border-services/documentation/api-ref/encryption/index.md)

## Sandbox Testing {#sandbox-testing}

You can make API calls to the Sandbox server from your application code using the [tutorials](https://developer.mastercard.com/cross-border-services/documentation/tutorials/index.md), which involves creating a Mastercard Developers project and using the Sandbox keys to generate the required Authorization Header.
Tip: During the onboarding process, Mastercard will assign a registered partner ID to test in the higher environments (MTF Test and Production). This partner ID will not be able to access the sandbox environment, but the customer can still access sandbox by using the non-registered partner ID.   
Any correctly formatted partner ID can be used in the sandbox. As a best practice, use the first 15 digits of your institution's name (alphanumeric and/or special characters, no spaces) as the Partner_ID.   
For testing in sandbox, please use unique transaction_reference on each run. Note: The sandbox does not return parameters unique to a specific Customer; such as pricing, limits, and corridor-specific data requirements, but allows you to test general call structure and responses outside of the production environment. After sandbox testing is completed, Customers meeting the eligibility requirements will be assigned a project manager to do integrated testing in the test environment that has been configured to include requested receiving corridors, current foreign exchange rates, and fixed and variable fees specific to the Customer.

## Sandbox Test cases {#sandbox-test-cases}

The Sandbox server returns simulated, static responses.

### **Retrieve Payment For Return Reason Message Version 3** {#retrieve-payment-for-return-reason-message-version-3}

Please refer column 'Code Value' to complete list of Return Reason Message Version 3 codes [here](https://developer.mastercard.com/cross-border-services/documentation/response-error-codes/error-codes/index.md).

#### Retrieve Payment by Transaction Id {#retrieve-payment-by-transaction-id}

You can use the following test cases to produce specific responses.

| Status  |             Test Case              |                           Action                           |
|---------|------------------------------------|------------------------------------------------------------|
| Success | Retrieve payment by transaction Id | Use the transaction Id of an existing payment transaction. |

| Status  |                                             Test Case                                             |                                                                                                                         Action                                                                                                                          |
|---------|---------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Success | Retrieve a returned Payment by Transaction Id having return message as per the Return Reason Code | 1. Create Payment with Transaction Reference starting with '8' and ending with RR######, where '######' is one of the Return Reason Code. Example:8XXXXXXRR130101 (where 'XXXXXX' can be any alphanumeric value) 2. Retrieve payment by Transaction Id. |

#### Retrieve Payment by Transaction Reference {#retrieve-payment-by-transaction-reference}

You can use the following test cases to produce specific responses.

| Status  |                 Test Case                 |                                Action                                |
|---------|-------------------------------------------|----------------------------------------------------------------------|
| Success | Retrieve payment by transaction reference | Use the transaction reference Id of an existing payment transaction. |

| Status  |                                                Test Case                                                 |                                                                                                                             Action                                                                                                                             |
|---------|----------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Success | Retrieve a returned Payment by Transaction Reference having return message as per the Return Reason Code | 1. Create Payment with Transaction Reference starting with '8' and ending with RR######, where '######' is one of the Return Reason Code. Example:8XXXXXXRR130101 (where 'XXXXXX' can be any alphanumeric value) 2. Retrieve payment by Transaction Reference. |

## Sample Requests {#sample-requests}

### Retrieve Payment by Transaction ID {#retrieve-payment-by-transaction-id-1}

No Request body

### Retrieve Payment by Transaction Reference {#retrieve-payment-by-transaction-reference-1}

No Request body

## Sample Responses {#sample-responses}

### Retrieve Payment by Transaction ID {#retrieve-payment-by-transaction-id-2}

#### Retrieve success examples {#retrieve-success-examples}

A few examples of successful Retrieve calls are:

##### 1.Successful Payment Response: {#1successful-payment-response}

* XML
* JSON

```XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<payment>
    <transaction_reference>07-GPYT-SR-NFWTIOBVCsdRGH-7009_93103546</transaction_reference>
    <status>SUCCESS</status>
    <id>rem_L1qZ8BLdmK9qUAFaGmpOwrpE6N0</id>
    <resource_type>payment</resource_type>
    <created>2019-09-09T04:32:52-05:00</created>
    <status_timestamp>2019-09-09T05:28:57-05:00</status_timestamp>
    <fees_amount>
        <currency>USD</currency>
        <amount>5.25</amount>
    </fees_amount>
    <charged_amount>
        <currency>USD</currency>
        <amount>10.25</amount>
    </charged_amount>
    <credited_amount>
        <currency>GBP</currency>
        <amount>82.63</amount>
    </credited_amount>
    <principal_amount>
        <currency>USD</currency>
        <amount>105.50</amount>
    </principal_amount>
    <sender_account_uri>tel:+254108989</sender_account_uri>
    <recipient_account_uri>tel:+254068989</recipient_account_uri>
    <payment_amount>
        <currency>USD</currency>
        <amount>121.10</amount>
    </payment_amount>
    <payment_origination_country>USA</payment_origination_country>
    <fx_type>
        <forward>
            <fees_included>true</fees_included>
        </forward>
    </fx_type>
    <receiving_bank_name>Royal Exchange</receiving_bank_name>
    <receiving_bank_branch_name>Quad Cities</receiving_bank_branch_name>
    <bank_code>NP021</bank_code>
    <payment_type>P2B</payment_type>
    <source_of_income>Bank</source_of_income>
    <settlement_details>
        <currency>EUR</currency>
        <amount>23.12</amount>
    </settlement_details>
    <cashout_code>123456</cashout_code>
    <fx_rate>19.12</fx_rate>
    <additional_data_list>
        <resource_type>list</resource_type>
        <item_count>3</item_count>
        <data>
            <data_field>
                <name>810</name>
                <value>123</value>
            </data_field>
            <data_field>
                <name>851</name>
                <value>456</value>
            </data_field>
            <data_field>
                <name>813</name>
                <value>18.22</value>
            </data_field>
        </data>
    </additional_data_list>
    <payment_file_identifier>1jgdhj421</payment_file_identifier>
</payment>
```

```JSON
{
	"payment": {
		"transaction_reference": "07-GPYT-SR-NFWTIOBVCsdRGH-7009_93103546",
		"status": "SUCCESS",
		"id": "rem_L1qZ8BLdmK9qUAFaGmpOwrpE6N0",
		"resource_type": "payment",
		"created": "2019-09-09T04:32:52-05:00",
		"status_timestamp": "2019-09-09T05:28:57-05:00",
		"fees_amount": {
			"currency": "USD",
			"amount": "5.35"
		},
		"charged_amount": {
			"currency": "USD",
			"amount": "10.25"
		},
		"credited_amount": {
			"currency": "GBP",
			"amount": "82.63"
		},
		"principal_amount": {
			"currency": "USD",
			"amount": "105.50"
		},
		"sender_account_uri": "tel:+254108989",
		"recipient_account_uri": "tel:+254068989",
		"payment_amount": {
			"currency": "USD",
			"amount": "121.10"
		},
		"payment_origination_country": "USA",
		"fx_type": {
			"forward": {
				"fees_included": "true"
			}
		},
		"receiving_bank_name": "Royal Exchange",
		"receiving_bank_branch_name": "Quad Cities",
		"bank_code": "NP021",
		"payment_type": "P2B",
		"source_of_income": "Bank",
		"settlement_details": {
			"currency": "EUR",
			"amount": "23.12"
		},
		"cashout_code": "123456",
		"fx_rate": "19.12",
		"additional_data_list": {
			"resource_type": "list",
			"item_count": "3",
			"data": {
				"data_field": [
					{
						"name": "810",
						"value": "123"
					},
					{
						"name": "851",
						"value": "456"
					},
					{
						"name": "813",
						"value": "18.22"
					}
				]
			}
		},
		"payment_file_identifier": "1jgdhj421"
	}
}
```

##### 2.Rejected Payment Response With Source: {#2rejected-payment-response-with-source}

* XML
* JSON

```XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<payment>
    <transaction_reference>04-GPYT-RRWS-MKMFWYIUVKH-700_swr4567475</transaction_reference>
    <status>REJECTED</status>
    <id>rem_IaCIDKldIs40_EzDRyPv-EPVDK8</id>
    <resource_type>payment</resource_type>
    <rejected_status>
        <Code>082000</Code>
        <Message>INVALID_INPUT_VALUE:Invalid Input Value:Additional Data-121-Sender Mobile Phone Number</Message>
    </rejected_status>
</payment>
```

```JSON
{
   "payment": {
      "transaction_reference": "04-GPYT-RRWS-MKMFWYIUVKH-700_swr4567475",
      "status": "REJECTED",
      "id": "rem_IaCIDKldIs40_EzDRyPv-EPVDK8",
      "resource_type": "payment",
      "rejected_status": {
         "Code": "082000",
         "Message": "INVALID_INPUT_VALUE:Invalid Input Value:Additional Data-121-Sender Mobile Phone Number"
      }
   }
}
```

##### 3.Rejected Payment Response Without Source: {#3rejected-payment-response-without-source}

* XML
* JSON

```XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<payment>
    <transaction_reference>04-GPYT-RRWTS-FWLBCXWUONBFD_70045674750</transaction_reference>
    <status>REJECTED</status>
    <id>rem_IaCIDKldIs40_EzDRyPv-EPVDK8</id>
    <resource_type>payment</resource_type>
    <rejected_status>
        <Code>130120</Code>
        <Message>DECLINE:Maximum cumulative transactions exceeded by sending consumer</Message>
    </rejected_status>
</payment>
```

```JSON
 {
   "payment": {
      "transaction_reference": "04-GPYT-RRWTS-FWLBCXWUONBFD_70045674750",
      "status": "REJECTED",
      "id": "rem_IaCIDKldIs40_EzDRyPv-EPVDK8",
      "resource_type": "payment",
      "rejected_status": {
         "Code": "130120",
         "Message": "DECLINE:Maximum cumulative transactions exceeded by sending consumer"
      }
   }
}
```

##### 4.Pending Payment Response: {#4pending-payment-response}

* XML
* JSON

```XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<payment>
    <transaction_reference>06-GPYT-PR-TQVNKODDF-7009hajsa673345035</transaction_reference>
    <status>PENDING</status>
    <id>rem_S8XcPv5Jjy6n4llKwnrXXBMAr2Y</id>
    <resource_type>payment</resource_type>
    <created>2019-09-09T05:36:49-05:00</created>
    <status_timestamp>2019-09-09T05:38:31-05:00</status_timestamp>
    <pending_stage>Processing</pending_stage>
    <pending_max_completion_date>2019-09-09T05:41:27.416-05:00</pending_max_completion_date>
    <fees_amount>
        <currency>USD</currency>
        <amount>5.35</amount>
    </fees_amount>
    <charged_amount>
        <currency>USD</currency>
        <amount>10.25</amount>
    </charged_amount>
    <credited_amount>
        <currency>GBP</currency>
        <amount>82.63</amount>
    </credited_amount>
    <principal_amount>
        <currency>USD</currency>
        <amount>105.50</amount>
    </principal_amount>
    <sender_account_uri>tel:+254108989</sender_account_uri>
    <recipient_account_uri>tel:+254068989</recipient_account_uri>
    <payment_amount>
        <currency>USD</currency>
        <amount>121.10</amount>
    </payment_amount>
    <payment_origination_country>USA</payment_origination_country>
    <fx_type>
        <forward>
            <fees_included>true</fees_included>
        </forward>
    </fx_type>
    <receiving_bank_name>Royal Exchange</receiving_bank_name>
    <receiving_bank_branch_name>Quad Cities</receiving_bank_branch_name>
    <bank_code>NP021</bank_code>
    <payment_type>P2B</payment_type>
    <source_of_income>Bank</source_of_income>
    <settlement_details>
        <currency>EUR</currency>
        <amount>23.12</amount>
    </settlement_details>
    <cashout_code>123456</cashout_code>
    <fx_rate>19.19</fx_rate>
    <additional_data_list>
        <resource_type>list</resource_type>
        <item_count>2</item_count>
        <data>
            <data_field>
                <name>810</name>
                <value>123</value>
            </data_field>
            <data_field>
                <name>851</name>
                <value>456</value>
            </data_field>
        </data>
    </additional_data_list>
    <payment_file_identifier>5spltew62</payment_file_identifier>
</payment>
```

```JSON
{
	"payment": {
		"transaction_reference": "06-GPYT-PR-TQVNKODDF-7009hajsa673345035",
		"status": "PENDING",
		"id": "rem_S8XcPv5Jjy6n4llKwnrXXBMAr2Y",
		"resource_type": "payment",
		"created": "2019-09-09T05:36:49-05:00",
		"status_timestamp": "2019-09-09T05:38:31-05:00",
		"pending_stage": "Processing",
		"pending_max_completion_date": "2019-09-09T05:41:27.416-05:00",
		"fees_amount": {
			"currency": "USD",
			"amount": "5.35"
		},
		"charged_amount": {
			"currency": "USD",
			"amount": "10.25"
		},
		"credited_amount": {
			"currency": "GBP",
			"amount": "82.63"
		},
		"principal_amount": {
			"currency": "USD",
			"amount": "105.50"
		},
		"sender_account_uri": "tel:+254108989",
		"recipient_account_uri": "tel:+254068989",
		"payment_amount": {
			"currency": "USD",
			"amount": "121.10"
		},
		"payment_origination_country": "USA",
		"fx_type": {
			"forward": {
				"fees_included": "true"
			}
		},
		"receiving_bank_name": "Royal Exchange",
		"receiving_bank_branch_name": "Quad Cities",
		"bank_code": "NP021",
		"payment_type": "P2B",
		"source_of_income": "Bank",
		"settlement_details": {
			"currency": "EUR",
			"amount": "23.12"
		},
		"cashout_code": "123456",
		"fx_rate": "19.19",
		"additional_data_list": {
			"resource_type": "list",
			"item_count": "2",
			"data": {
				"data_field": [
					{
						"name": "810",
						"value": "123"
					},
					{
						"name": "851",
						"value": "456"
					}
				]
			}
		},
		"payment_file_identifier": "5spltew62"
	}
}
```

##### 5.Returned Payment Response For Returned Reason Version 2: {#5returned-payment-response-for-returned-reason-version-2}

* XML
* JSON

```XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<payment>
  <transaction_reference>099d9b1f09805a407691659</transaction_reference>
  <status>RETURNED</status>
  <id>rem_6JFlIxjCOz4GJZXsldiZejK8b5A</id>
  <resource_type>payment</resource_type>
  <payment_type>P2P</payment_type>
  <return_status>
    <Message>Returned per sending service provider's request</Message>
  </return_status>
</payment>
```

```JSON
{
  "payment": {
    "transaction_reference": "099d9b1f09805a407691659",
    "status": "RETURNED",
    "id": "rem_6JFlIxjCOz4GJZXsldiZejK8b5A",
    "resource_type": "payment",
    "payment_type": "P2P",
    "return_status": {
      "Message": "Returned per sending service provider's request"
    }
  }
}
```

##### 6.Returned Payment Response For Returned Reason Version 3: {#6returned-payment-response-for-returned-reason-version-3}

* XML
* JSON

```XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<payment>
  <transaction_reference>099d9b1f09805a407691659</transaction_reference>
  <status>RETURNED</status>
  <id>rem_6JFlIxjCOz4GJZXsldiZejK8b5A</id>
  <resource_type>payment</resource_type>
  <payment_type>P2P</payment_type>
  <rejected_status>
    <Code>130134</Code>
    <Message> DECLINE:The recipient cannot receive funds due to inactive account </Message>
  </rejected_status>
</payment>
```

```JSON
{
  "payment": {
    "transaction_reference": "099d9b1f09805a407691659",
    "status": "RETURNED",
    "id": "rem_6JFlIxjCOz4GJZXsldiZejK8b5A",
    "resource_type": "payment",
    "payment_type": "P2P",
    "rejected_status": {
      "Code": "130134",
      "Message": "DECLINE:The recipient cannot receive funds due to inactive account"
    }
  }
}
```

#### Retrieve failures examples {#retrieve-failures-examples}

A few examples of Retrieve failures are:

##### 1.System Failure: {#1system-failure}

* XML
* JSON

```XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Errors>
    <Error>
        <RequestId>343242</RequestId>
        <Source></Source>
        <ReasonCode>SYSTEM_ERROR</ReasonCode>
        <Description>A system error has occurred</Description>
        <Recoverable>false</Recoverable>
        <Details>
            <Detail>
                <Name>ErrorDetailCode</Name>
                <Value>150001</Value>
            </Detail>
        </Details>
    </Error>
</Errors>
```

```JSON
{
	"Errors": {
		"Error": {
			"RequestId": "343242",
			"Source": "",
			"ReasonCode": "SYSTEM_ERROR",
			"Description": "A system error has occurred",
			"Recoverable": "false",
			"Details": {
				"Detail": {
					"Name": "ErrorDetailCode",
					"Value": "150001"
				}
			}
		}
	}
}
```

##### 2.Payment Id Not Found: {#2payment-id-not-found}

* XML
* JSON

```XML
<?xml version="1.0" encoding="UTF-8" ?>
<Errors>
	<Error>
		<RequestId>38694624</RequestId>
		<Source>GetPayment</Source>
		<ReasonCode>RESOURCE_UNKNOWN</ReasonCode>
		<Description>Record Not Found</Description>
		<Recoverable>false</Recoverable>
		<Details>
			<Detail>
				<Name>ErrorDetailCode</Name>
				<Value>110507</Value>
			</Detail>
		</Details>
	</Error>
</Errors>
```

```JSON
{
    "Errors": {
        "Error": {
            "RequestId": "38694624",
            "Source": "GetPayment",
            "ReasonCode": "RESOURCE_UNKNOWN",
            "Description": "Record Not Found",
            "Recoverable": "false",
            "Details": {
                "Detail": {
                    "Name": "ErrorDetailCode",
                    "Value": "110507"
                }
            }
        }
    }
}
```

### Retrieve Payment by Transaction Reference {#retrieve-payment-by-transaction-reference-2}

#### Retrieve success examples {#retrieve-success-examples-1}

A few examples of successful Retrieve calls are:

##### 1.Successful Payment Response: {#1successful-payment-response-1}

* XML
* JSON

```XML
<?xml version="1.0" encoding="UTF-8" ?>
<payment>
  <transaction_reference>05-GPYT-SR-GAWERBNseYIOFUE-009675675_52</transaction_reference>
  <id>rem_CsmBxbCtt9opPMXzD5JGx_DJNWQ</id>
  <resource_type>payment</resource_type>
  <created>2019-09-09T05:36:49-05:00</created>
  <proposal_id>suc_10000807120579256064528158</proposal_id>
  <status>SUCCESS</status>
  <status_timestamp>2019-09-09T05:38:31-05:00</status_timestamp>
  <fees_amount>
    <amount>5.35</amount>
    <currency>USD</currency>
  </fees_amount>
  <charged_amount>
    <amount>10.25</amount>
    <currency>USD</currency>
  </charged_amount>
  <credited_amount>
    <amount>82.63</amount>
    <currency>GBP</currency>
  </credited_amount>
  <principal_amount>
    <amount>105.50</amount>
    <currency>USD</currency>
  </principal_amount>
  <sender_account_uri>tel:+2130000</sender_account_uri>
  <recipient_account_uri>tel:+254060005</recipient_account_uri>
  <payment_amount>
    <amount>121.10</amount>
    <currency>USD</currency>
  </payment_amount>
  <payment_origination_country>USA</payment_origination_country>
  <C>
    <forward>
      <fees_included>true</fees_included>
    </forward>
  </C>
  <receiving_bank_name>Royal Exchange</receiving_bank_name>
  <receiving_bank_branch_name>Quad Cities</receiving_bank_branch_name>
  <payment_type>P2P</payment_type>
  <source_of_income>Sal</source_of_income>
  <settlement_details>
    <amount>23.12</amount>
    <currency>EUR</currency>
  </settlement_details>
  <cashout_code>123456</cashout_code>
  <fx_rate>18.22</fx_rate>
  <additional_data_list>
    <resource_type>list</resource_type>
    <item_count>2</item_count>
    <data>
      <data_field>
        <name>810</name>
        <value>123</value>
      </data_field>
      <data_field>
        <name>851</name>
        <value>456</value>
      </data_field>
    </data>
  </additional_data_list>
</payment>
```

```JSON
{
	"payment": {
		"transaction_reference": "05-GPYT-SR-GAWERBNseYIOFUE-009675675_52",
		"id": "rem_CsmBxbCtt9opPMXzD5JGx_DJNWQ",
		"resource_type": "payment",
		"created": "2019-09-09T05:36:49-05:00",
		"proposal_id": "suc_10000807120579256064528158",
		"status": "SUCCESS",
		"status_timestamp": "2019-09-09T05:38:31-05:00",
		"fees_amount": {
			"amount": "5.35",
			"currency": "USD"
		},
		"charged_amount": {
			"amount": "10.25",
			"currency": "USD"
		},
		"credited_amount": {
			"amount": "82.63",
			"currency": "GBP"
		},
		"principal_amount": {
			"amount": "105.50",
			"currency": "USD"
		},
		"sender_account_uri": "tel:+2130000",
		"recipient_account_uri": "tel:+254060005",
		"payment_amount": {
			"amount": "121.10",
			"currency": "USD"
		},
		"payment_origination_country": "USA",
		"fx_type": {
			"forward": {
				"fees_included": "true"
			}
		},
		"receiving_bank_name": "Royal Exchange",
		"receiving_bank_branch_name": "Quad Cities",
		"payment_type": "P2P",
		"source_of_income": "Sal",
		"settlement_details": {
			"amount": "23.12",
			"currency": "EUR"
		},
		"cashout_code": "123456",
		"fx_rate": "18.22",
		"additional_data_list": {
			"resource_type": "list",
			"item_count": "2",
			"data": {
				"data_field": [
					{
						"name": "810",
						"value": "123"
					},
					{
						"name": "851",
						"value": "456"
					}
				]
			}
		}
	}
}
```

##### 2.Rejected Payment Response With Source: {#2rejected-payment-response-with-source-1}

* XML
* JSON

```XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<payment>
    <transaction_reference>04-GPYT-RR-FWLWSTYONBFD_70045674752400</transaction_reference>
    <status>REJECTED</status>
    <id>rem_IaCIDKldIs40_EzDRyPv-EPVDK8</id>
    <resource_type>payment</resource_type>
    <rejected_status>
        <Code>082000</Code>
        <Message>INVALID_INPUT_VALUE:Invalid Input Value:Additional Data-121-Sender Mobile Phone Number</Message>
    </rejected_status>
</payment>
```

```JSON
{
   "payment": {
      "transaction_reference": "04-GPYT-RR-FWLWSTYONBFD_70045674752400",
      "status": "REJECTED",
      "id": "rem_IaCIDKldIs40_EzDRyPv-EPVDK8",
      "resource_type": "payment",
      "rejected_status": {
         "Code": "082000",
         "Message": "INVALID_INPUT_VALUE:Invalid Input Value:Additional Data-121-Sender Mobile Phone Number"
      }
   }
}
```

##### 3.Rejected Payment Response Without Source: {#3rejected-payment-response-without-source-1}

* XML
* JSON

```XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<payment>
    <transaction_reference>04-GPYT-RRWS-LWSTYONBFD_70045674752400</transaction_reference>
    <status>REJECTED</status>
    <id>rem_IaCIDKldIs40_EzDRyPv-EPVDK8</id>
    <resource_type>payment</resource_type>
    <rejected_status>
        <Code>130120</Code>
        <Message>DECLINE:Maximum cumulative transactions exceeded by sending consumer</Message>
    </rejected_status>
</payment>
```

```JSON
{
   "payment": {
      "transaction_reference": "04-GPYT-RRWS-LWSTYONBFD_70045674752400",
      "status": "REJECTED",
      "id": "rem_IaCIDKldIs40_EzDRyPv-EPVDK8",
      "resource_type": "payment",
      "rejected_status": {
         "Code": "130120",
         "Message": "DECLINE:Maximum cumulative transactions exceeded by sending consumer"
      }
   }
}
```

##### 4.Pending Payment Response: {#4pending-payment-response-1}

* XML
* JSON

```XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<payment>
    <transaction_reference>06-GPYT-PR-TQVNKODDF-7009hajsa673345035</transaction_reference>
    <status>PENDING</status>
    <id>rem_S8XcPv5Jjy6n4llKwnrXXBMAr2Y</id>
    <resource_type>payment</resource_type>
    <created>2019-09-09T05:36:49-05:00</created>
    <status_timestamp>2019-09-09T05:38:31-05:00</status_timestamp>
    <pending_stage>Processing</pending_stage>
    <pending_max_completion_date>2019-09-09T05:41:27.416-05:00</pending_max_completion_date>
    <fees_amount>
        <currency>USD</currency>
        <amount>5.95</amount>
    </fees_amount>
    <charged_amount>
        <currency>USD</currency>
        <amount>15.16</amount>
    </charged_amount>
    <credited_amount>
        <currency>GBP</currency>
        <amount>82.63</amount>
    </credited_amount>
    <principal_amount>
        <currency>USD</currency>
        <amount>124.65</amount>
    </principal_amount>
    <sender_account_uri>tel:+254108989</sender_account_uri>
    <recipient_account_uri>tel:+254068989</recipient_account_uri>
    <payment_amount>
        <currency>USD</currency>
        <amount>145.76</amount>
    </payment_amount>
    <payment_origination_country>USA</payment_origination_country>
    <fx_type>
        <forward>
            <fees_included>true</fees_included>
        </forward>
    </fx_type>
    <receiving_bank_name>Royal Exchange</receiving_bank_name>
    <receiving_bank_branch_name>Quad Cities</receiving_bank_branch_name>
    <bank_code>NP021</bank_code>
    <payment_type>P2B</payment_type>
    <source_of_income>Bank</source_of_income>
    <settlement_details>
        <currency>EUR</currency>
        <amount>23.12</amount>
    </settlement_details>
    <cashout_code>123456</cashout_code>
    <fx_rate>19.19</fx_rate>
    <additional_data_list>
        <resource_type>list</resource_type>
        <item_count>2</item_count>
        <data>
            <data_field>
                <name>810</name>
                <value>123</value>
            </data_field>
            <data_field>
                <name>851</name>
                <value>456</value>
            </data_field>
        </data>
    </additional_data_list>
    <payment_file_identifier>6trwqs73</payment_file_identifier>
</payment>
```

```JSON
{
	"payment": {
		"transaction_reference": "06-GPYT-PR-TQVNKODDF-7009hajsa673345035",
		"status": "PENDING",
		"id": "rem_S8XcPv5Jjy6n4llKwnrXXBMAr2Y",
		"resource_type": "payment",
		"created": "2019-09-09T05:36:49-05:00",
		"status_timestamp": "2019-09-09T05:38:31-05:00",
		"pending_stage": "Processing",
		"pending_max_completion_date": "2019-09-09T05:41:27.416-05:00",
		"fees_amount": {
			"currency": "USD",
			"amount": "5.95"
		},
		"charged_amount": {
			"currency": "USD",
			"amount": "15.16"
		},
		"credited_amount": {
			"currency": "GBP",
			"amount": "82.63"
		},
		"principal_amount": {
			"currency": "USD",
			"amount": "124.65"
		},
		"sender_account_uri": "tel:+254108989",
		"recipient_account_uri": "tel:+254068989",
		"payment_amount": {
			"currency": "USD",
			"amount": "145.76"
		},
		"payment_origination_country": "USA",
		"fx_type": {
			"forward": {
				"fees_included": "true"
			}
		},
		"receiving_bank_name": "Royal Exchange",
		"receiving_bank_branch_name": "Quad Cities",
		"bank_code": "NP021",
		"payment_type": "P2B",
		"source_of_income": "Bank",
		"settlement_details": {
			"currency": "EUR",
			"amount": "23.12"
		},
		"cashout_code": "123456",
		"fx_rate": "19.19",
		"additional_data_list": {
			"resource_type": "list",
			"item_count": "2",
			"data": {
				"data_field": [
					{
						"name": "810",
						"value": "123"
					},
					{
						"name": "851",
						"value": "456"
					}
				]
			}
		},
		"payment_file_identifier": "6trwqs73"
	}
}
```

##### 5.Returned Payment Response For Returned Reason Version 2: {#5returned-payment-response-for-returned-reason-version-2-1}

* XML
* JSON

```XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<payment>
  <transaction_reference>099d9b1f09805a407691659</transaction_reference>
  <status>RETURNED</status>
  <id>rem_6JFlIxjCOz4GJZXsldiZejK8b5A</id>
  <resource_type>payment</resource_type>
  <payment_type>P2P</payment_type>
  <return_status>
    <Message>Returned per sending service provider's request</Message>
  </return_status>
</payment>
```

```JSON
{
  "payment": {
    "transaction_reference": "099d9b1f09805a407691659",
    "status": "RETURNED",
    "id": "rem_6JFlIxjCOz4GJZXsldiZejK8b5A",
    "resource_type": "payment",
    "payment_type": "P2P",
    "return_status": {
      "Message": "Returned per sending service provider's request"
    }
  }
}
```

##### 6.Returned Payment Response For Returned Reason Version 3: {#6returned-payment-response-for-returned-reason-version-3-1}

* XML
* JSON

```XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<payment>
  <transaction_reference>099d9b1f09805a407691659</transaction_reference>
  <status>RETURNED</status>
  <id>rem_6JFlIxjCOz4GJZXsldiZejK8b5A</id>
  <resource_type>payment</resource_type>
  <payment_type>P2P</payment_type>
  <rejected_status>
    <Code>130134</Code>
    <Message> DECLINE:The recipient cannot receive funds due to inactive account </Message>
  </rejected_status>
</payment>
```

```JSON
{
  "payment": {
    "transaction_reference": "099d9b1f09805a407691659",
    "status": "RETURNED",
    "id": "rem_6JFlIxjCOz4GJZXsldiZejK8b5A",
    "resource_type": "payment",
    "payment_type": "P2P",
    "rejected_status": {
      "Code": "130134",
      "Message": "DECLINE:The recipient cannot receive funds due to inactive account"
    }
  }
}
```

#### Retrieve failures examples {#retrieve-failures-examples-1}

A few examples of Retrieve failures are provided below:

##### 1.System Failure: {#1system-failure-1}

* XML
* JSON

```XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Errors>
    <Error>
        <RequestId>343242</RequestId>
        <Source></Source>
        <ReasonCode>SYSTEM_ERROR</ReasonCode>
        <Description>A system error has occurred</Description>
        <Recoverable>false</Recoverable>
        <Details>
            <Detail>
                <Name>ErrorDetailCode</Name>
                <Value>150001</Value>
            </Detail>
        </Details>
    </Error>
</Errors>
```

```JSON
{
	"Errors": {
		"Error": {
			"RequestId": "343242",
			"Source": "",
			"ReasonCode": "SYSTEM_ERROR",
			"Description": "A system error has occurred",
			"Recoverable": "false",
			"Details": {
				"Detail": {
					"Name": "ErrorDetailCode",
					"Value": "150001"
				}
			}
		}
	}
}
```

##### 2.Transaction Reference Not Found: {#2transaction-reference-not-found}

* XML
* JSON

```XML
<?xml version="1.0" encoding="UTF-8" ?>
<Errors>
	<Error>
		<RequestId>38694624</RequestId>
		<Source>GetPayment</Source>
		<ReasonCode>RESOURCE_UNKNOWN</ReasonCode>
		<Description>Record Not Found</Description>
		<Recoverable>false</Recoverable>
		<Details>
			<Detail>
				<Name>ErrorDetailCode</Name>
				<Value>110507</Value>
			</Detail>
		</Details>
	</Error>
</Errors>
```

```JSON
{
    "Errors": {
        "Error": {
            "RequestId": "38694624",
            "Source": "GetPayment",
            "ReasonCode": "RESOURCE_UNKNOWN",
            "Description": "Record Not Found",
            "Recoverable": "false",
            "Details": {
                "Detail": {
                    "Name": "ErrorDetailCode",
                    "Value": "110507"
                }
            }
        }
    }
}
```

## Error Codes {#error-codes}

Refer to complete list of error codes [here](https://developer.mastercard.com/cross-border-services/documentation/response-error-codes/index.md).
For information about the HTTP response codes that may be returned for your API requests, see [HTTP Response Codes](https://developer.mastercard.com/cross-border-services/documentation/response-error-codes/http-response-codes/index.md).

## Sample Responses {#sample-responses}

### Retrieve Payment by Transaction Id {#retrieve-payment-by-transaction-id}

A few examples of successful Retrieve calls are provided below:

#### 1.Successful Payment Response: {#1successful-payment-response}

* XML
* JSON

```XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<payment>
    <transaction_reference>07-GPYT-SR-NFWTIOBVCsdRGH-7009_93103546</transaction_reference>
    <status>SUCCESS</status>
    <id>rem_L1qZ8BLdmK9qUAFaGmpOwrpE6N0</id>
    <resource_type>payment</resource_type>
    <created>2019-09-09T04:32:52-05:00</created>
    <status_timestamp>2019-09-09T05:28:57-05:00</status_timestamp>
    <fees_amount>
        <currency>USD</currency>
        <amount>5.25</amount>
    </fees_amount>
    <charged_amount>
        <currency>USD</currency>
        <amount>10.25</amount>
    </charged_amount>
    <credited_amount>
        <currency>GBP</currency>
        <amount>82.63</amount>
    </credited_amount>
    <principal_amount>
        <currency>USD</currency>
        <amount>105.50</amount>
    </principal_amount>
    <sender_account_uri>tel:+254108989</sender_account_uri>
    <recipient_account_uri>tel:+254068989</recipient_account_uri>
    <payment_amount>
        <currency>USD</currency>
        <amount>121.10</amount>
    </payment_amount>
    <payment_origination_country>USA</payment_origination_country>
    <fx_type>
        <forward>
            <fees_included>true</fees_included>
        </forward>
    </fx_type>
    <receiving_bank_name>Royal Exchange</receiving_bank_name>
    <receiving_bank_branch_name>Quad Cities</receiving_bank_branch_name>
    <bank_code>NP021</bank_code>
    <payment_type>P2B</payment_type>
    <source_of_income>Bank</source_of_income>
    <settlement_details>
        <currency>EUR</currency>
        <amount>23.12</amount>
    </settlement_details>
    <cashout_code>123456</cashout_code>
    <fx_rate>19.12</fx_rate>
    <additional_data_list>
        <resource_type>list</resource_type>
        <item_count>3</item_count>
        <data>
            <data_field>
                <name>810</name>
                <value>123</value>
            </data_field>
            <data_field>
                <name>851</name>
                <value>456</value>
            </data_field>
            <data_field>
                <name>813</name>
                <value>18.22</value>
            </data_field>
        </data>
    </additional_data_list>
    <payment_file_identifier>1jgdhj421</payment_file_identifier>
</payment>
```

```JSON
{
	"payment": {
		"transaction_reference": "07-GPYT-SR-NFWTIOBVCsdRGH-7009_93103546",
		"status": "SUCCESS",
		"id": "rem_L1qZ8BLdmK9qUAFaGmpOwrpE6N0",
		"resource_type": "payment",
		"created": "2019-09-09T04:32:52-05:00",
		"status_timestamp": "2019-09-09T05:28:57-05:00",
		"fees_amount": {
			"currency": "USD",
			"amount": "5.35"
		},
		"charged_amount": {
			"currency": "USD",
			"amount": "10.25"
		},
		"credited_amount": {
			"currency": "GBP",
			"amount": "82.63"
		},
		"principal_amount": {
			"currency": "USD",
			"amount": "105.50"
		},
		"sender_account_uri": "tel:+254108989",
		"recipient_account_uri": "tel:+254068989",
		"payment_amount": {
			"currency": "USD",
			"amount": "121.10"
		},
		"payment_origination_country": "USA",
		"fx_type": {
			"forward": {
				"fees_included": "true"
			}
		},
		"receiving_bank_name": "Royal Exchange",
		"receiving_bank_branch_name": "Quad Cities",
		"bank_code": "NP021",
		"payment_type": "P2B",
		"source_of_income": "Bank",
		"settlement_details": {
			"currency": "EUR",
			"amount": "23.12"
		},
		"cashout_code": "123456",
		"fx_rate": "19.12",
		"additional_data_list": {
			"resource_type": "list",
			"item_count": "3",
			"data": {
				"data_field": [
					{
						"name": "810",
						"value": "123"
					},
					{
						"name": "851",
						"value": "456"
					},
					{
						"name": "813",
						"value": "18.22"
					}
				]
			}
		},
		"payment_file_identifier": "1jgdhj421"
	}
}
```

#### 2.Rejected Payment Response With Source: {#2rejected-payment-response-with-source}

* XML
* JSON

```XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<payment>
    <transaction_reference>04-GPYT-RRWS-MKMFWYIUVKH-700_swr4567475</transaction_reference>
    <status>REJECTED</status>
    <id>rem_IaCIDKldIs40_EzDRyPv-EPVDK8</id>
    <resource_type>payment</resource_type>
    <rejected_status>
        <Code>082000</Code>
        <Message>INVALID_INPUT_VALUE:Invalid Input Value:Additional Data-121-Sender Mobile Phone Number</Message>
    </rejected_status>
</payment>
```

```JSON
{
   "payment": {
      "transaction_reference": "04-GPYT-RRWS-MKMFWYIUVKH-700_swr4567475",
      "status": "REJECTED",
      "id": "rem_IaCIDKldIs40_EzDRyPv-EPVDK8",
      "resource_type": "payment",
      "rejected_status": {
         "Code": "082000",
         "Message": "INVALID_INPUT_VALUE:Invalid Input Value:Additional Data-121-Sender Mobile Phone Number"
      }
   }
}
```

#### 3.Rejected Payment Response Without Source: {#3rejected-payment-response-without-source}

* XML
* JSON

```XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<payment>
    <transaction_reference>04-GPYT-RRWTS-FWLBCXWUONBFD_70045674750</transaction_reference>
    <status>REJECTED</status>
    <id>rem_IaCIDKldIs40_EzDRyPv-EPVDK8</id>
    <resource_type>payment</resource_type>
    <rejected_status>
        <Code>130120</Code>
        <Message>DECLINE:Maximum cumulative transactions exceeded by sending consumer</Message>
    </rejected_status>
</payment>
```

```JSON
 {
   "payment": {
      "transaction_reference": "04-GPYT-RRWTS-FWLBCXWUONBFD_70045674750",
      "status": "REJECTED",
      "id": "rem_IaCIDKldIs40_EzDRyPv-EPVDK8",
      "resource_type": "payment",
      "rejected_status": {
         "Code": "130120",
         "Message": "DECLINE:Maximum cumulative transactions exceeded by sending consumer"
      }
   }
}
```

#### 4.Pending Payment Response: {#4pending-payment-response}

* XML
* JSON

```XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<payment>
    <transaction_reference>06-GPYT-PR-TQVNKODDF-7009hajsa673345035</transaction_reference>
    <status>PENDING</status>
    <id>rem_S8XcPv5Jjy6n4llKwnrXXBMAr2Y</id>
    <resource_type>payment</resource_type>
    <created>2019-09-09T05:36:49-05:00</created>
    <status_timestamp>2019-09-09T05:38:31-05:00</status_timestamp>
    <pending_stage>Processing</pending_stage>
    <pending_max_completion_date>2019-09-09T05:41:27.416-05:00</pending_max_completion_date>
    <fees_amount>
        <currency>USD</currency>
        <amount>5.35</amount>
    </fees_amount>
    <charged_amount>
        <currency>USD</currency>
        <amount>10.25</amount>
    </charged_amount>
    <credited_amount>
        <currency>GBP</currency>
        <amount>82.63</amount>
    </credited_amount>
    <principal_amount>
        <currency>USD</currency>
        <amount>105.50</amount>
    </principal_amount>
    <sender_account_uri>tel:+254108989</sender_account_uri>
    <recipient_account_uri>tel:+254068989</recipient_account_uri>
    <payment_amount>
        <currency>USD</currency>
        <amount>121.10</amount>
    </payment_amount>
    <payment_origination_country>USA</payment_origination_country>
    <fx_type>
        <forward>
            <fees_included>true</fees_included>
        </forward>
    </fx_type>
    <receiving_bank_name>Royal Exchange</receiving_bank_name>
    <receiving_bank_branch_name>Quad Cities</receiving_bank_branch_name>
    <bank_code>NP021</bank_code>
    <payment_type>P2B</payment_type>
    <source_of_income>Bank</source_of_income>
    <settlement_details>
        <currency>EUR</currency>
        <amount>23.12</amount>
    </settlement_details>
    <cashout_code>123456</cashout_code>
    <fx_rate>19.19</fx_rate>
    <additional_data_list>
        <resource_type>list</resource_type>
        <item_count>2</item_count>
        <data>
            <data_field>
                <name>810</name>
                <value>123</value>
            </data_field>
            <data_field>
                <name>851</name>
                <value>456</value>
            </data_field>
        </data>
    </additional_data_list>
    <payment_file_identifier>5spltew62</payment_file_identifier>
</payment>
```

```JSON
{
	"payment": {
		"transaction_reference": "06-GPYT-PR-TQVNKODDF-7009hajsa673345035",
		"status": "PENDING",
		"id": "rem_S8XcPv5Jjy6n4llKwnrXXBMAr2Y",
		"resource_type": "payment",
		"created": "2019-09-09T05:36:49-05:00",
		"status_timestamp": "2019-09-09T05:38:31-05:00",
		"pending_stage": "Processing",
		"pending_max_completion_date": "2019-09-09T05:41:27.416-05:00",
		"fees_amount": {
			"currency": "USD",
			"amount": "5.35"
		},
		"charged_amount": {
			"currency": "USD",
			"amount": "10.25"
		},
		"credited_amount": {
			"currency": "GBP",
			"amount": "82.63"
		},
		"principal_amount": {
			"currency": "USD",
			"amount": "105.50"
		},
		"sender_account_uri": "tel:+254108989",
		"recipient_account_uri": "tel:+254068989",
		"payment_amount": {
			"currency": "USD",
			"amount": "121.10"
		},
		"payment_origination_country": "USA",
		"fx_type": {
			"forward": {
				"fees_included": "true"
			}
		},
		"receiving_bank_name": "Royal Exchange",
		"receiving_bank_branch_name": "Quad Cities",
		"bank_code": "NP021",
		"payment_type": "P2B",
		"source_of_income": "Bank",
		"settlement_details": {
			"currency": "EUR",
			"amount": "23.12"
		},
		"cashout_code": "123456",
		"fx_rate": "19.19",
		"additional_data_list": {
			"resource_type": "list",
			"item_count": "2",
			"data": {
				"data_field": [
					{
						"name": "810",
						"value": "123"
					},
					{
						"name": "851",
						"value": "456"
					}
				]
			}
		},
		"payment_file_identifier": "5spltew62"
	}
}
```

#### 5.Returned Payment Response For Returned Reason Version 2: {#5returned-payment-response-for-returned-reason-version-2}

* XML
* JSON

```XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<payment>
  <transaction_reference>099d9b1f09805a407691659</transaction_reference>
  <status>RETURNED</status>
  <id>rem_6JFlIxjCOz4GJZXsldiZejK8b5A</id>
  <resource_type>payment</resource_type>
  <payment_type>P2P</payment_type>
  <return_status>
    <Message>Returned per sending service provider's request</Message>
  </return_status>
</payment>
```

```JSON
{
  "payment": {
    "transaction_reference": "099d9b1f09805a407691659",
    "status": "RETURNED",
    "id": "rem_6JFlIxjCOz4GJZXsldiZejK8b5A",
    "resource_type": "payment",
    "payment_type": "P2P",
    "return_status": {
      "Message": "Returned per sending service provider's request"
    }
  }
}
```

#### 6.Returned Payment Response For Returned Reason Version 3: {#6returned-payment-response-for-returned-reason-version-3}

* XML
* JSON

```XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<payment>
  <transaction_reference>099d9b1f09805a407691659</transaction_reference>
  <status>RETURNED</status>
  <id>rem_6JFlIxjCOz4GJZXsldiZejK8b5A</id>
  <resource_type>payment</resource_type>
  <payment_type>P2P</payment_type>
  <rejected_status>
    <Code>130134</Code>
    <Message> DECLINE:The recipient cannot receive funds due to inactive account </Message>
  </rejected_status>
</payment>
```

```JSON
{
  "payment": {
    "transaction_reference": "099d9b1f09805a407691659",
    "status": "RETURNED",
    "id": "rem_6JFlIxjCOz4GJZXsldiZejK8b5A",
    "resource_type": "payment",
    "payment_type": "P2P",
    "rejected_status": {
      "Code": "130134",
      "Message": "DECLINE:The recipient cannot receive funds due to inactive account"
    }
  }
}
```

A few examples of Retrieve failures are provided below:

#### 1.System Failure: {#1system-failure}

* XML
* JSON

```XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Errors>
    <Error>
        <RequestId>343242</RequestId>
        <Source></Source>
        <ReasonCode>SYSTEM_ERROR</ReasonCode>
        <Description>A system error has occurred</Description>
        <Recoverable>false</Recoverable>
        <Details>
            <Detail>
                <Name>ErrorDetailCode</Name>
                <Value>150001</Value>
            </Detail>
        </Details>
    </Error>
</Errors>
```

```JSON
{
	"Errors": {
		"Error": {
			"RequestId": "343242",
			"Source": "",
			"ReasonCode": "SYSTEM_ERROR",
			"Description": "A system error has occurred",
			"Recoverable": "false",
			"Details": {
				"Detail": {
					"Name": "ErrorDetailCode",
					"Value": "150001"
				}
			}
		}
	}
}
```

#### 2.Payment Id Not Found: {#2payment-id-not-found}

* XML
* JSON

```XML
<?xml version="1.0" encoding="UTF-8" ?>
<Errors>
	<Error>
		<RequestId>38694624</RequestId>
		<Source>GetPayment</Source>
		<ReasonCode>RESOURCE_UNKNOWN</ReasonCode>
		<Description>Record Not Found</Description>
		<Recoverable>false</Recoverable>
		<Details>
			<Detail>
				<Name>ErrorDetailCode</Name>
				<Value>110507</Value>
			</Detail>
		</Details>
	</Error>
</Errors>
```

```JSON
{
    "Errors": {
        "Error": {
            "RequestId": "38694624",
            "Source": "GetPayment",
            "ReasonCode": "RESOURCE_UNKNOWN",
            "Description": "Record Not Found",
            "Recoverable": "false",
            "Details": {
                "Detail": {
                    "Name": "ErrorDetailCode",
                    "Value": "110507"
                }
            }
        }
    }
}
```

### Retrieve Payment by Transaction Reference {#retrieve-payment-by-transaction-reference}

A few examples of successful Retrieve calls are provided below:

#### 1.Successful Payment Response: {#1successful-payment-response-1}

* XML
* JSON

```XML
<?xml version="1.0" encoding="UTF-8" ?>
<payment>
  <transaction_reference>05-GPYT-SR-GAWERBNseYIOFUE-009675675_52</transaction_reference>
  <id>rem_CsmBxbCtt9opPMXzD5JGx_DJNWQ</id>
  <resource_type>payment</resource_type>
  <created>2019-09-09T05:36:49-05:00</created>
  <proposal_id>suc_10000807120579256064528158</proposal_id>
  <status>SUCCESS</status>
  <status_timestamp>2019-09-09T05:38:31-05:00</status_timestamp>
  <fees_amount>
    <amount>5.35</amount>
    <currency>USD</currency>
  </fees_amount>
  <charged_amount>
    <amount>10.25</amount>
    <currency>USD</currency>
  </charged_amount>
  <credited_amount>
    <amount>82.63</amount>
    <currency>GBP</currency>
  </credited_amount>
  <principal_amount>
    <amount>105.50</amount>
    <currency>USD</currency>
  </principal_amount>
  <sender_account_uri>tel:+2130000</sender_account_uri>
  <recipient_account_uri>tel:+254060005</recipient_account_uri>
  <payment_amount>
    <amount>121.10</amount>
    <currency>USD</currency>
  </payment_amount>
  <payment_origination_country>USA</payment_origination_country>
  <C>
    <forward>
      <fees_included>true</fees_included>
    </forward>
  </C>
  <receiving_bank_name>Royal Exchange</receiving_bank_name>
  <receiving_bank_branch_name>Quad Cities</receiving_bank_branch_name>
  <payment_type>P2P</payment_type>
  <source_of_income>Sal</source_of_income>
  <settlement_details>
    <amount>23.12</amount>
    <currency>EUR</currency>
  </settlement_details>
  <cashout_code>123456</cashout_code>
  <fx_rate>18.22</fx_rate>
  <additional_data_list>
    <resource_type>list</resource_type>
    <item_count>2</item_count>
    <data>
      <data_field>
        <name>810</name>
        <value>123</value>
      </data_field>
      <data_field>
        <name>851</name>
        <value>456</value>
      </data_field>
    </data>
  </additional_data_list>
</payment>
```

```JSON
{
	"payment": {
		"transaction_reference": "05-GPYT-SR-GAWERBNseYIOFUE-009675675_52",
		"id": "rem_CsmBxbCtt9opPMXzD5JGx_DJNWQ",
		"resource_type": "payment",
		"created": "2019-09-09T05:36:49-05:00",
		"proposal_id": "suc_10000807120579256064528158",
		"status": "SUCCESS",
		"status_timestamp": "2019-09-09T05:38:31-05:00",
		"fees_amount": {
			"amount": "5.35",
			"currency": "USD"
		},
		"charged_amount": {
			"amount": "10.25",
			"currency": "USD"
		},
		"credited_amount": {
			"amount": "82.63",
			"currency": "GBP"
		},
		"principal_amount": {
			"amount": "105.50",
			"currency": "USD"
		},
		"sender_account_uri": "tel:+2130000",
		"recipient_account_uri": "tel:+254060005",
		"payment_amount": {
			"amount": "121.10",
			"currency": "USD"
		},
		"payment_origination_country": "USA",
		"fx_type": {
			"forward": {
				"fees_included": "true"
			}
		},
		"receiving_bank_name": "Royal Exchange",
		"receiving_bank_branch_name": "Quad Cities",
		"payment_type": "P2P",
		"source_of_income": "Sal",
		"settlement_details": {
			"amount": "23.12",
			"currency": "EUR"
		},
		"cashout_code": "123456",
		"fx_rate": "18.22",
		"additional_data_list": {
			"resource_type": "list",
			"item_count": "2",
			"data": {
				"data_field": [
					{
						"name": "810",
						"value": "123"
					},
					{
						"name": "851",
						"value": "456"
					}
				]
			}
		}
	}
}
```

#### 2.Rejected Payment Response With Source: {#2rejected-payment-response-with-source-1}

* XML
* JSON

```XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<payment>
    <transaction_reference>04-GPYT-RR-FWLWSTYONBFD_70045674752400</transaction_reference>
    <status>REJECTED</status>
    <id>rem_IaCIDKldIs40_EzDRyPv-EPVDK8</id>
    <resource_type>payment</resource_type>
    <rejected_status>
        <Code>082000</Code>
        <Message>INVALID_INPUT_VALUE:Invalid Input Value:Additional Data-121-Sender Mobile Phone Number</Message>
    </rejected_status>
</payment>
```

```JSON
{
   "payment": {
      "transaction_reference": "04-GPYT-RR-FWLWSTYONBFD_70045674752400",
      "status": "REJECTED",
      "id": "rem_IaCIDKldIs40_EzDRyPv-EPVDK8",
      "resource_type": "payment",
      "rejected_status": {
         "Code": "082000",
         "Message": "INVALID_INPUT_VALUE:Invalid Input Value:Additional Data-121-Sender Mobile Phone Number"
      }
   }
}
```

#### 3.Rejected Payment Response Without Source: {#3rejected-payment-response-without-source-1}

* XML
* JSON

```XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<payment>
    <transaction_reference>04-GPYT-RRWS-LWSTYONBFD_70045674752400</transaction_reference>
    <status>REJECTED</status>
    <id>rem_IaCIDKldIs40_EzDRyPv-EPVDK8</id>
    <resource_type>payment</resource_type>
    <rejected_status>
        <Code>130120</Code>
        <Message>DECLINE:Maximum cumulative transactions exceeded by sending consumer</Message>
    </rejected_status>
</payment>
```

```JSON
{
   "payment": {
      "transaction_reference": "04-GPYT-RRWS-LWSTYONBFD_70045674752400",
      "status": "REJECTED",
      "id": "rem_IaCIDKldIs40_EzDRyPv-EPVDK8",
      "resource_type": "payment",
      "rejected_status": {
         "Code": "130120",
         "Message": "DECLINE:Maximum cumulative transactions exceeded by sending consumer"
      }
   }
}
```

#### 4.Pending Payment Response: {#4pending-payment-response-1}

* XML
* JSON

```XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<payment>
    <transaction_reference>06-GPYT-PR-TQVNKODDF-7009hajsa673345035</transaction_reference>
    <status>PENDING</status>
    <id>rem_S8XcPv5Jjy6n4llKwnrXXBMAr2Y</id>
    <resource_type>payment</resource_type>
    <created>2019-09-09T05:36:49-05:00</created>
    <status_timestamp>2019-09-09T05:38:31-05:00</status_timestamp>
    <pending_stage>Processing</pending_stage>
    <pending_max_completion_date>2019-09-09T05:41:27.416-05:00</pending_max_completion_date>
    <fees_amount>
        <currency>USD</currency>
        <amount>5.95</amount>
    </fees_amount>
    <charged_amount>
        <currency>USD</currency>
        <amount>15.16</amount>
    </charged_amount>
    <credited_amount>
        <currency>GBP</currency>
        <amount>82.63</amount>
    </credited_amount>
    <principal_amount>
        <currency>USD</currency>
        <amount>124.65</amount>
    </principal_amount>
    <sender_account_uri>tel:+254108989</sender_account_uri>
    <recipient_account_uri>tel:+254068989</recipient_account_uri>
    <payment_amount>
        <currency>USD</currency>
        <amount>145.76</amount>
    </payment_amount>
    <payment_origination_country>USA</payment_origination_country>
    <fx_type>
        <forward>
            <fees_included>true</fees_included>
        </forward>
    </fx_type>
    <receiving_bank_name>Royal Exchange</receiving_bank_name>
    <receiving_bank_branch_name>Quad Cities</receiving_bank_branch_name>
    <bank_code>NP021</bank_code>
    <payment_type>P2B</payment_type>
    <source_of_income>Bank</source_of_income>
    <settlement_details>
        <currency>EUR</currency>
        <amount>23.12</amount>
    </settlement_details>
    <cashout_code>123456</cashout_code>
    <fx_rate>19.19</fx_rate>
    <additional_data_list>
        <resource_type>list</resource_type>
        <item_count>2</item_count>
        <data>
            <data_field>
                <name>810</name>
                <value>123</value>
            </data_field>
            <data_field>
                <name>851</name>
                <value>456</value>
            </data_field>
        </data>
    </additional_data_list>
    <payment_file_identifier>6trwqs73</payment_file_identifier>
</payment>
```

```JSON
{
	"payment": {
		"transaction_reference": "06-GPYT-PR-TQVNKODDF-7009hajsa673345035",
		"status": "PENDING",
		"id": "rem_S8XcPv5Jjy6n4llKwnrXXBMAr2Y",
		"resource_type": "payment",
		"created": "2019-09-09T05:36:49-05:00",
		"status_timestamp": "2019-09-09T05:38:31-05:00",
		"pending_stage": "Processing",
		"pending_max_completion_date": "2019-09-09T05:41:27.416-05:00",
		"fees_amount": {
			"currency": "USD",
			"amount": "5.95"
		},
		"charged_amount": {
			"currency": "USD",
			"amount": "15.16"
		},
		"credited_amount": {
			"currency": "GBP",
			"amount": "82.63"
		},
		"principal_amount": {
			"currency": "USD",
			"amount": "124.65"
		},
		"sender_account_uri": "tel:+254108989",
		"recipient_account_uri": "tel:+254068989",
		"payment_amount": {
			"currency": "USD",
			"amount": "145.76"
		},
		"payment_origination_country": "USA",
		"fx_type": {
			"forward": {
				"fees_included": "true"
			}
		},
		"receiving_bank_name": "Royal Exchange",
		"receiving_bank_branch_name": "Quad Cities",
		"bank_code": "NP021",
		"payment_type": "P2B",
		"source_of_income": "Bank",
		"settlement_details": {
			"currency": "EUR",
			"amount": "23.12"
		},
		"cashout_code": "123456",
		"fx_rate": "19.19",
		"additional_data_list": {
			"resource_type": "list",
			"item_count": "2",
			"data": {
				"data_field": [
					{
						"name": "810",
						"value": "123"
					},
					{
						"name": "851",
						"value": "456"
					}
				]
			}
		},
		"payment_file_identifier": "6trwqs73"
	}
}
```

#### 5.Returned Payment Response For Returned Reason Version 2: {#5returned-payment-response-for-returned-reason-version-2-1}

* XML
* JSON

```XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<payment>
  <transaction_reference>099d9b1f09805a407691659</transaction_reference>
  <status>RETURNED</status>
  <id>rem_6JFlIxjCOz4GJZXsldiZejK8b5A</id>
  <resource_type>payment</resource_type>
  <payment_type>P2P</payment_type>
  <return_status>
    <Message>Returned per sending service provider's request</Message>
  </return_status>
</payment>
```

```JSON
{
  "payment": {
    "transaction_reference": "099d9b1f09805a407691659",
    "status": "RETURNED",
    "id": "rem_6JFlIxjCOz4GJZXsldiZejK8b5A",
    "resource_type": "payment",
    "payment_type": "P2P",
    "return_status": {
      "Message": "Returned per sending service provider's request"
    }
  }
}
```

#### 6.Returned Payment Response For Returned Reason Version 3: {#6returned-payment-response-for-returned-reason-version-3-1}

* XML
* JSON

```XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<payment>
  <transaction_reference>099d9b1f09805a407691659</transaction_reference>
  <status>RETURNED</status>
  <id>rem_6JFlIxjCOz4GJZXsldiZejK8b5A</id>
  <resource_type>payment</resource_type>
  <payment_type>P2P</payment_type>
  <rejected_status>
    <Code>130134</Code>
    <Message> DECLINE:The recipient cannot receive funds due to inactive account </Message>
  </rejected_status>
</payment>
```

```JSON
{
  "payment": {
    "transaction_reference": "099d9b1f09805a407691659",
    "status": "RETURNED",
    "id": "rem_6JFlIxjCOz4GJZXsldiZejK8b5A",
    "resource_type": "payment",
    "payment_type": "P2P",
    "rejected_status": {
      "Code": "130134",
      "Message": "DECLINE:The recipient cannot receive funds due to inactive account"
    }
  }
}
```

A few examples of Retrieve failures are provided below:

#### 1.System Failure: {#1system-failure-1}

* XML
* JSON

```XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Errors>
    <Error>
        <RequestId>343242</RequestId>
        <Source></Source>
        <ReasonCode>SYSTEM_ERROR</ReasonCode>
        <Description>A system error has occurred</Description>
        <Recoverable>false</Recoverable>
        <Details>
            <Detail>
                <Name>ErrorDetailCode</Name>
                <Value>150001</Value>
            </Detail>
        </Details>
    </Error>
</Errors>
```

```JSON
{
	"Errors": {
		"Error": {
			"RequestId": "343242",
			"Source": "",
			"ReasonCode": "SYSTEM_ERROR",
			"Description": "A system error has occurred",
			"Recoverable": "false",
			"Details": {
				"Detail": {
					"Name": "ErrorDetailCode",
					"Value": "150001"
				}
			}
		}
	}
}
```

#### 2.Transaction Reference Not Found: {#2transaction-reference-not-found}

* XML
* JSON

```XML
<?xml version="1.0" encoding="UTF-8" ?>
<Errors>
	<Error>
		<RequestId>38694624</RequestId>
		<Source>GetPayment</Source>
		<ReasonCode>RESOURCE_UNKNOWN</ReasonCode>
		<Description>Record Not Found</Description>
		<Recoverable>false</Recoverable>
		<Details>
			<Detail>
				<Name>ErrorDetailCode</Name>
				<Value>110507</Value>
			</Detail>
		</Details>
	</Error>
</Errors>
```

```JSON
{
    "Errors": {
        "Error": {
            "RequestId": "38694624",
            "Source": "GetPayment",
            "ReasonCode": "RESOURCE_UNKNOWN",
            "Description": "Record Not Found",
            "Recoverable": "false",
            "Details": {
                "Detail": {
                    "Name": "ErrorDetailCode",
                    "Value": "110507"
                }
            }
        }
    }
}
```

## Error Codes {#error-codes}

Please refer to complete list of error codes [here](https://developer.mastercard.com/cross-border-services/documentation/response-error-codes/index.md).

For information about the HTTP response codes that may be returned for your API requests, see [HTTP Response Codes](https://developer.mastercard.com/cross-border-services/documentation/response-error-codes/http-response-codes/index.md).
