Skip to main content

Payment

payment.get​

This is an API for acquiring settlement information.

API definitions​

REST Base URIhttp://app.mbga-platform.jp/social/api/restful/v2 ( Service ) http://app.sb.mbga-platform.jp/social/api/restful/v2 ( Sandbox )
REST HTTP MethodGET
REST URI Fragment``` payment/{userId}/{groupId}/{appId}{-prefix
REST Query ParametersGetPayment-Request-Parameters
Return ObjectPayment

Approval​

typepermissiondescription
ANONYMOUSfalseUnauthorized access
SECURITY_TOKENfalseAuthorization using a security token
OAUTH_MOBILEfalseAuthorization using an OAuth Token issued for a mobile device
OAUTH_CONSUMERtrueAuthorization using a Consumer Request

RESTful API response codes​

HTTP Status CodeHTTP Status MessageJSON-RPC Error CodesMeaning
200OK–Data successfully acquired
400Bad Request-32700, -32600, -32601, -32602, 400Corrupt request data on the client side
401Unauthorized401Authorization error
403Forbidden403The resource exists, but access is not possible due to a reason other than an authorization error
404Not Found404The resource doesn’t exist
405Method Not Allowed405That operation is not allowed
500Internal Server Error-32603An error on the API server side
503Service Unavailable–The API cannot be used temporarily

JSON-RPC error codes​

These are values are included in the code field of the Error object when an error has occurred.

RPC CodeMeaning
-32700 (Parse error)Invalid JSON format
-32600 (Invalid Request)Invalid JSON-RPC request
-32601 (Method not found)The method either doesn’t exist or is an unusable method
-32602 (Invalid params)Invalid API request parameters
-32603 (Internal server error)An error on the API server side
400 (Bad Request)A bad request on the client side that does not correspond to any other error
401 (Unauthorized)Authorization error
403 (Forbidden)The resource exists, but access is not possible due to a reason other than an authorization error
404 (Not Found)The resource doesn’t exist
405 (Method Not Allowed)That operation is not allowed

Data types​

Get-Payment-Request-Parameters​

UserId, groupId, appId and paymentId are specified as URI Template Parameters, and all other parameters are specified as Query String.

NameTypeDescription
userIdUserIdRequired
groupIdGroupIdRequired Only '@self' is specifiable.
appIdAppIdRequired Only '@app' is specifiable.
paymentIdPaymentIdRequired UUID format

Base data types

  • Starndard-Request-Parameters
Starndard-Request-Parameters​

The following is a list of the supported fields.

NameTypeDescription
formatStringOptional Only 'json' is specifiable.

See here for details.

Payment​

NameTypeDescription
idStringThe id value of the Payment object. In UUID format.
appIdIntegerThe id of the application executing this settlement transaction.
userIdStringThe guid of the user executing this settlement transaction.
statusIntegerThe status value of this settlement transaction.
entryArrayThe PaymentEntry object collection.
callbackUrlStringThe URL for the notification of settlement completion on the partner side (for mobile)
finishUrlStringThe URL for the settlement completion screen on the partner side (for mobile)
endpointUrlStringThe Mobage URL for executing this settlement transaction
deviceIdStringThis is the type of device that was used to settle the account. PC: PC / Mobile: Mobile
publishedDateDate published
updatedDateDate updated
status column values​
ValueDescription
0Start of settlement
1Error
10Successful
20Cancel

PaymentEntry​

NameTypeDescription
paymentIdStringThe id of the Payment object.
itemIdIntegerAn identifier for partners to distinguish between items.
nameStringThe name of the item.
unitPriceIntegerThe unit price of the item (Coin).
amountIntegerThe number of items purchased.
imageUrlStringThe URL of the item image.
descriptionStringA description of the item.

Sample data​

RESTful API​

Acquiring payment information​
GET /social/api/restful/v2/payment/99999/@self/@app/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Host: app.sb.mbga-platform.jp

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
"entry" : [
{
"itemId" : 1,
"amount" : 5,
"imageUrl" : "http://example.com/img/example.gif",
"paymentId" : "3E37C512-6891-35C1-84FE-B081B5443997",
"name" : "cash box",
"unitPrice" : 100,
"description" : "This is a legendary item that cannot be purchased at this moment."
}
],
"status" : 10,
"userId" : "sb.mbga.jp:99999",
"endpointUrl" : "",
"appId" : 99999999,
"callbackUrl" : "",
"finishUrl" : "",
"id" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"deviceId": "PC",
"published" : "2010-02-15T11:21:58",
"updated" : "2010-02-15T11:21:58"
}

Revision History​

  • 12/2010
    • Initial Release.