Shared Payment Granted Token

SharedPaymentGrantedToken is the view-only resource of a SharedPaymentIssuedToken, which is a limited-use reference to a PaymentMethod. When another Stripe merchant shares a SharedPaymentIssuedToken with you, you can view attributes of the shared token using the SharedPaymentGrantedToken API, and use it with a PaymentIntent.

Was this section helpful?YesNo
Retrieve a SharedPaymentGrantedToken
GET/v1/shared_payment/granted_tokens/:id
Create a test SharedPaymentGrantedToken
POST/v1/test_helpers/shared_payment/granted_tokens
Revoke a test SharedPaymentGrantedToken
POST/v1/test_helpers/shared_payment/granted_tokens/:id/revoke

The Shared Payment Granted Token object

Attributes

  • idstring

    Unique identifier for the object.

  • objectstring

    String representing the object’s type. Objects of the same type share the same value.

  • agent_detailsnullable object

    Details about the agent that issued this SharedPaymentGrantedToken.

  • createdtimestamp

    Time at which the object was created. Measured in seconds since the Unix epoch.

  • deactivated_atnullable timestamp

    Time at which this SharedPaymentGrantedToken expires and can no longer be used to confirm a PaymentIntent.

  • deactivated_reasonnullable enum

    The reason why the SharedPaymentGrantedToken has been deactivated.

    Possible enum values
    consumed

    consumed indicates that this token has been consumed due to hitting the allowed amount limit.

    expired

    expired indicates that this token has expired.

    resolved

    resolved indicates that this token has been resolved by a seller.

    revoked

    revoked indicates that this token has been revoked by the issuer.

  • livemodeboolean

    If the object exists in live mode, the value is true. If the object exists in test mode, the value is false.

  • payment_method_detailsnullable object

    Details of the PaymentMethod that was shared via this token.

  • risk_detailsnullable object

    Risk details of the SharedPaymentGrantedToken.

  • shared_metadatanullable object

    Metadata about the SharedPaymentGrantedToken.

  • usage_detailsnullable object

    Some details about how the SharedPaymentGrantedToken has been used already.

  • usage_limitsnullable object

    Limits on how this SharedPaymentGrantedToken can be used.

The Shared Payment Granted Token object
{
"id": "spt_1RgaZcFPC5QUO6ZCDVZuVA8q",
"object": "shared_payment.granted_token",
"agent_details": {
"network_business_profile": "profile_test_61U92KWAstyE3VYhXA6U91t01FSQ3ByrZzKJOCR0y5ey"
},
"created": 1751500820,
"deactivated_at": null,
"deactivated_reason": null,
"livemode": false,
"payment_method_details": {
"type": "card",
"billing_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"email": null,
"name": "John Doe",
"phone": null
},
"card": {
"brand": "visa",
"country": "US",
"display_brand": "visa",
"exp_month": 9,
"exp_year": 2029,
"fingerprint": "dyRcYjZNxnHpC51l",
"funding": "credit",
"last4": "4242",
"networks": {
"available": [
"visa"
],
"preferred": null
},
"wallet": null
}
},
"shared_metadata": {},
"usage_details": {
"amount_captured": {
"value": 0,
"currency": "usd"
}
},
"usage_limits": {
"currency": "usd",
"expires_at": 1751587220,
"max_amount": 1000
}
}

Retrieve a SharedPaymentGrantedToken

Retrieves an existing SharedPaymentGrantedToken object

Parameters

No parameters.

Returns

Returns the specified SharedPaymentGrantedToken

GET /v1/shared_payment/granted_tokens/:id
curl https://api.stripe.com/v1/shared_payment/granted_tokens/spt_1RgaZcFPC5QUO6ZCDVZuVA8q \
-u "sk_test_Hrs6SAo...0bZXSN3f6ELNsk_test_Hrs6SAopgFPF0bZXSN3f6ELN:"
Response
{
"id": "spt_1RgaZcFPC5QUO6ZCDVZuVA8q",
"object": "shared_payment.granted_token",
"agent_details": {
"network_business_profile": "profile_test_61U92KWAstyE3VYhXA6U91t01FSQ3ByrZzKJOCR0y5ey"
},
"created": 1751500820,
"deactivated_at": null,
"deactivated_reason": null,
"livemode": false,
"payment_method_details": {
"type": "card",
"billing_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"email": null,
"name": "John Doe",
"phone": null
},
"card": {
"brand": "visa",
"country": "US",
"display_brand": "visa",
"exp_month": 9,
"exp_year": 2029,
"fingerprint": "dyRcYjZNxnHpC51l",
"funding": "credit",
"last4": "4242",
"networks": {
"available": [
"visa"
],
"preferred": null
},
"wallet": null
}
},
"shared_metadata": {},
"usage_details": {
"amount_captured": {
"value": 0,
"currency": "usd"
}
},
"usage_limits": {
"currency": "usd",
"expires_at": 1751587220,
"max_amount": 1000
}
}

Create a test SharedPaymentGrantedTokenTest helper

Creates a new test SharedPaymentGrantedToken object. This endpoint is only available in test mode and allows sellers to create SharedPaymentGrantedTokens for testing their integration

Parameters

  • payment_methodstringRequired

    The PaymentMethod that is going to be shared by the SharedPaymentGrantedToken.

  • usage_limitsobjectRequired

    Limits on how this SharedPaymentGrantedToken can be used.

  • customerstring

    The Customer that the SharedPaymentGrantedToken belongs to. Should match the Customer that the PaymentMethod is attached to if any.

  • shared_metadataobject

    Set of key-value pairs that you can attach to the SharedPaymentGrantedToken.

Returns

Returns the newly created SharedPaymentGrantedToken

POST /v1/test_helpers/shared_payment/granted_tokens
curl https://api.stripe.com/v1/test_helpers/shared_payment/granted_tokens \
-u "sk_test_Hrs6SAo...0bZXSN3f6ELNsk_test_Hrs6SAopgFPF0bZXSN3f6ELN:" \
-d payment_method={{PAYMENT_METHOD_ID}} \
-d "usage_limits[currency]=usd" \
-d "usage_limits[expires_at]=1751587220" \
-d "usage_limits[max_amount]=1000"
Response
{
"id": "spt_1RgaZcFPC5QUO6ZCDVZuVA8q",
"object": "shared_payment.granted_token",
"agent_details": {
"network_business_profile": "profile_test_61U92KWAstyE3VYhXA6U91t01FSQ3ByrZzKJOCR0y5ey"
},
"created": 1751500820,
"deactivated_at": null,
"deactivated_reason": null,
"livemode": false,
"payment_method_details": {
"type": "card",
"billing_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"email": null,
"name": "John Doe",
"phone": null
},
"card": {
"brand": "visa",
"country": "US",
"display_brand": "visa",
"exp_month": 9,
"exp_year": 2029,
"fingerprint": "dyRcYjZNxnHpC51l",
"funding": "credit",
"last4": "4242",
"networks": {
"available": [
"visa"
],
"preferred": null
},
"wallet": null
}
},
"shared_metadata": {},
"usage_details": {
"amount_captured": {
"value": 0,
"currency": "usd"
}
},
"usage_limits": {
"currency": "usd",
"expires_at": 1751587220,
"max_amount": 1000
}
}

Revoke a test SharedPaymentGrantedTokenTest helper

Revokes a test SharedPaymentGrantedToken object. This endpoint is only available in test mode and allows sellers to revoke SharedPaymentGrantedTokens for testing their integration

Parameters

No parameters.

Returns

Returns the revoked SharedPaymentGrantedToken

POST /v1/test_helpers/shared_payment/granted_tokens/:id/revoke
curl -X POST https://api.stripe.com/v1/test_helpers/shared_payment/granted_tokens/spt_1RgaZcFPC5QUO6ZCDVZuVA8q/revoke \
-u "sk_test_Hrs6SAo...0bZXSN3f6ELNsk_test_Hrs6SAopgFPF0bZXSN3f6ELN:"
Response
{
"id": "spt_1RgaZcFPC5QUO6ZCDVZuVA8q",
"object": "shared_payment.granted_token",
"agent_details": {
"network_business_profile": "profile_test_61U92KWAstyE3VYhXA6U91t01FSQ3ByrZzKJOCR0y5ey"
},
"created": 1751500820,
"deactivated_at": 1751587220,
"deactivated_reason": "revoked",
"livemode": false,
"payment_method_details": {
"type": "card",
"billing_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"email": null,
"name": "John Doe",
"phone": null
},
"card": {
"brand": "visa",
"country": "US",
"display_brand": "visa",
"exp_month": 9,
"exp_year": 2029,
"fingerprint": "dyRcYjZNxnHpC51l",
"funding": "credit",
"last4": "4242",
"networks": {
"available": [
"visa"
],
"preferred": null
},
"wallet": null
}
},
"shared_metadata": {},
"usage_details": {
"amount_captured": {
"value": 0,
"currency": "usd"
}
},
"usage_limits": {
"currency": "usd",
"expires_at": 1751587220,
"max_amount": 1000
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.