Documentation

ConfirmPurchase

Confirms with the payment provider that the purchase was approved (if applicable) and adjusts inventory and virtual currency balances as appropriate

Request Details

The final step in the purchasing process, this API finalizes the purchase with the payment provider, where applicable, adding virtual goods to the player inventory (including random drop table resolution and recursive addition of bundled items) and adjusting virtual currency balances for funds used or added. Note that this is a pull operation, and should be polled regularly when a purchase is in progress. Please note that the processing time for inventory grants and purchases increases fractionally the more items are in the inventory, and the more items are in the grant/purchase operation.

ConfirmPurchaseRequest
Request Properties
OrderId (required) String

Purchase order identifier returned from StartPurchase.

POST https://{{TitleID}}.playfabapi.com/Client/ConfirmPurchase
    Content-Type: application/json
    X-Authentication: <user_session_ticket_value>
{
  "OrderId": "8853591446005860822"
}
        

Response Details

When the FailedByPaymentProvider error is returned, it's important to check the ProviderErrorCode, ProviderErrorMessage, and ProviderErrorDetails to understand the specific reason the payment was rejected, as in some rare cases, this may mean that the provider hasn't completed some operation required to finalize the purchase.

ConfirmPurchaseResult
Result Properties
Items List<ItemInstance>

Array of items purchased.

OrderId String

Purchase order identifier.

PurchaseDate (required) DateTime

Date and time of the purchase.

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "code": 200,
  "status": "OK",
  "data": {
    "OrderId": "8853591446005860822",
    "PurchaseDate": "2014-04-07T09:04:28Z",
    "Items": [
      {
        "ItemId": "shield_level_5",
        "ItemInstanceId": "40895075594",
        "CatalogVersion": "5",
        "DisplayName": "Level 5 Shield",
        "UnitCurrency": "GV",
        "UnitPrice": 25
      }
    ]
  }
}

Authentication

SessionTicket

Possible Error Codes

Name Code
FailedByPaymentProvider 1015
PurchaseDoesNotExist 1080