Welcome‎ > ‎Version 3‎ > ‎Publisher Api‎ > ‎Methods‎ > ‎4 - Publisher Related‎ > ‎

Grant Credit

** The Authentication of this method will change.  If you'd like to be notified of the change, please post in the comment section below so you can be notified before the change. **

Will give the specified user credits for a number of reasons.

Method: POST /api/v3/publisher/consumer/{userKey}/credit

Authentication: oauth

Parameters
  userKey - The UserKey of the consumer receiving the credits.

 
Post
Required Form Name Data Type Explanation
Yes
Amount decimal The amount of the credit in the specified IsoCurrencyCode, can be negative with restrictions.
Yes
CreditType string The type of credit.
Yes
Description string The description that should be set on the credit.
No ExpirationDate int64
The optional expiration time for the credit in Unix time or POSIX time.
Yes IsoCurrencyCode string The 3 character iso currency code.  Must be supported by the publisher.  eg USD, JPY
No OrderId int The optional OrderId to be tracked along with the credit.

CreditTypes
Value Signage
Explanation
Marketing  + The credit is a result from a marketing operation.
CustomerSupport  +/- The credit is a result from a customer support inquiry.

Returns
success - Whether the credit was successfully applied to the consumer.


Sample Request:

POST https://api.groupcommerce.com/api/v3/publisher/consumer/UserKey1/credit

Form: Amount=10&CreditType=Marketing&Description=Because%20they%20were%20awesome!&ExpirationDate=1508472000&IsoCurrencyCode=USD&OrderId=33

Authorization: OAuth oauth_signature="Ehr7mLrjQ6xn5PjzoUMbIxey29c%3D", oauth_nonce="2324570", oauth_timestamp="1345065979", oauth_consumer_key="eeb6b959-b854-4ad1-b563-e801c83cf81d", oauth_signature_method="HMAC-SHA1", oauth_version="1.0"


Sample JSON Response:

{
    "errors":[],
    "lastPublished":"/Date(1319762442406)/",
    "success":true,
    "version":"3"
}


Sample XML Response:

<grantCreditResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <errors />
  <lastPublished>2012-08-09T06:55:53.9125094Z</lastPublished>
  <success>true</success>
  <version>3</version>
</grantCreditResponse>
Comments