

The AWS Partner Central API Reference was restructured. For more information about the supported API operations, see the [AWS Partner Central API Reference](https://docs.aws.amazon.com/partner-central/latest/APIReference/Welcome.html).

# Testing in a sandbox for the AWS Partner Central Revenue Measurement API
<a name="testing-sandbox-prm"></a>

## How to use the sandbox
<a name="prm-use-sandbox"></a>

To use the sandbox, complete the following steps:

1. Create an IAM role:

   Create an IAM role in the AWS account linked with your AWS Partner Central account.

1. Assign Policy:

   Assign the following policy to the IAM role. For more information, see [Adding and removing IAM identity permissions](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_manage-attach-detach.html).

   ```
   {
       "Version": "2012-10-17",
       "Statement": [
           {
               "Sid": "RevenueMeasurementCreation",
               "Effect": "Allow",
               "Action": [
                   "partnercentral:CreateRevenueAttribution",
                   "partnercentral:CreateMarketplaceRevenueShare",
                   "partnercentral:CreateMarketplaceRevenueShareAllocation"
               ],
               "Resource": "*",
               "Condition": {
                   "StringEquals": {
                       "partnercentral:Catalog": [
                           "Sandbox"
                       ]
                   }
               }
           },
           {
               "Sid": "RevenueMeasurementListing",
               "Effect": "Allow",
               "Action": [
                   "partnercentral:ListRevenueAttributions",
                   "partnercentral:ListRevenueAttributionAllocations",
                   "partnercentral:ListMarketplaceRevenueShares",
                   "partnercentral:ListMarketplaceRevenueShareAllocations"
               ],
               "Resource": "*",
               "Condition": {
                   "StringEquals": {
                       "partnercentral:Catalog": [
                           "Sandbox"
                       ]
                   }
               }
           },
           {
               "Sid": "RevenueAttributionManagement",
               "Effect": "Allow",
               "Action": [
                   "partnercentral:GetRevenueAttribution",
                   "partnercentral:UpdateRevenueAttribution",
                   "partnercentral:GetRevenueAttributionAllocation",
                   "partnercentral:StartRevenueAttributionAllocationsTask",
                   "partnercentral:GetRevenueAttributionAllocationsTask"
               ],
               "Resource": "arn:aws:partnercentral:*:*:catalog/Sandbox/revenue-attribution/*",
               "Condition": {
                   "StringEquals": {
                       "partnercentral:Catalog": [
                           "Sandbox"
                       ]
                   }
               }
           },
           {
               "Sid": "MarketplaceRevenueShareManagement",
               "Effect": "Allow",
               "Action": [
                   "partnercentral:GetMarketplaceRevenueShare",
                   "partnercentral:GetMarketplaceRevenueShareAllocation",
                   "partnercentral:UpdateMarketplaceRevenueShareAllocation"
               ],
               "Resource": "arn:aws:partnercentral:*:*:catalog/Sandbox/marketplace-revenue-share/*",
               "Condition": {
                   "StringEquals": {
                       "partnercentral:Catalog": [
                           "Sandbox"
                       ]
                   }
               }
           },
           {
               "Sid": "TaggingAccess",
               "Effect": "Allow",
               "Action": [
                   "partnercentral:TagResource",
                   "partnercentral:UntagResource",
                   "partnercentral:ListTagsForResource"
               ],
               "Resource": [
                   "arn:aws:partnercentral:*:*:catalog/Sandbox/revenue-attribution/*",
                   "arn:aws:partnercentral:*:*:catalog/Sandbox/marketplace-revenue-share/*"
               ],
               "Condition": {
                   "StringEquals": {
                       "partnercentral:Catalog": [
                           "Sandbox"
                       ]
                   }
               }
           },
           {
               "Sid": "OpportunityAccess",
               "Effect": "Allow",
               "Action": [
                   "partnercentral:ListOpportunities",
                   "partnercentral:GetOpportunity"
               ],
               "Resource": "*",
               "Condition": {
                   "StringEquals": {
                       "partnercentral:Catalog": [
                           "Sandbox"
                       ]
                   }
               }
           },
           {
               "Sid": "ListingAWSMarketplaceEntities",
               "Effect": "Allow",
               "Action": [
                   "aws-marketplace:ListEntities"
               ],
               "Resource": "*"
           },
           {
               "Sid": "AWSMarketplaceEntityAccess",
               "Effect": "Allow",
               "Action": [
                   "aws-marketplace:DescribeEntity"
               ],
               "Resource": [
                   "arn:aws:aws-marketplace:*:*:AWSMarketplace*/Offer/*"
               ]
           }
       ]
   }
   ```

1. Use IAM role credentials:

   Use the credentials (secret key and access key) of this IAM role in your solution to perform the API actions.

## Testing AWS actions
<a name="prm-testing-aws-actions"></a>

During the testing phase, it is often necessary to simulate AWS actions. This simulation enables partners to thoroughly test the complete end-to-end flow of their integration with AWS services. Each request includes a catalog parameter, which determines the data environment.

### Simulating the creation of a Revenue Attribution ID
<a name="simulating-revenue-attribution-creation"></a>

To simulate the creation of a Revenue Attribution ID, in the payload of the `CreateRevenueAttribution` action, include `"Catalog": "Sandbox"` in the payload.

For example:

```
{
  "Catalog": "Sandbox",
  "ClientToken": "String",
  "Name": "String",
  "Description": "String",
  "TenancyModel": "MULTI_TENANT | SINGLE_TENANT",
  "ProductIdentifier": "String",
  "Tags": [
    {
      "Key": "String",
      "Value": "String"
    }
  ]
}
```

## Additional testing notes
<a name="prm-additional-testing-notes"></a>

1. To test other actions, set `"Catalog": "Sandbox"` in the payload.

1. To move to production, change the catalog value from `Sandbox` to `AWS`.